:root {
    --primary: #2563eb;
    --secondary: #1e40af;
    --dark: #0f172a;
    --light: #f1f5f9;
    --accent: #f59e0b;
    --gray: #64748b;
    --light-gray: #cbd5e1;
    --sidebar-bg: #0f0c29;
    --sidebar-active: rgba(37, 99, 235, 0.2);
    --content-bg: #f0f2f5;
    --card-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--content-bg);
    color: #333;
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 360px;
    background: linear-gradient(135deg, var(--dark), #1e293b);
    color: white;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    color: var(--primary);
}

.logo i {
    color: var(--accent);
}

.logo .logo-img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    vertical-align: middle;
    object-fit: contain;
    border-radius: 4px;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
}

.btn-primary:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
}

 /* 登录页面 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    color: #e2e8f0;
    border: 1px solid rgba(59, 130, 246, 0.3);
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.3s;
}


.modal-content {
    padding: 40px; 
    max-width: 450px; 
}

.close-modal:hover {
    color: #f8fafc;
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-header p {
    color: #94a3b8;
    font-size: 1rem;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 25px;
    font-weight: 700;
    font-size: 1.8rem;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #334155;
    background-color: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
    font-size: 1rem;
    transition: all 0.3s;
}

/* 需要添加/修改 */
.form-group label {
    color: #e2e8f0; /* 添加标签颜色 */
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.form-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #94a3b8; /* 添加颜色 */
}

.form-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(to right, #2563eb, #1e40af);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    margin-top: 10px;
}

.form-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.95rem;
    color: #94a3b8;
}

.form-footer a {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    margin-left: 5px;
}

.form-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #64748b;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #334155, transparent);
}

.form-divider span {
    padding: 0 15px;
}

.terms {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 15px;
}

.social-login {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.google {
    background: #DB4437;
}

.github {
    background: #333;
}

.microsoft {
    background: #0078d7;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.form-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4);
}

.close-modal:hover {
    color: #f8fafc;
}

#registerForm .form-group:last-child {
    margin-bottom: 10px;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.form-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.form-options a {
    color: #93c5fd;
    text-decoration: none;
    transition: color 0.3s;
}

.form-options a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.login-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(to right, #2563eb, #1e40af);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.login-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4);
}

.signup-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.95rem;
    color: #94a3b8;
}

.signup-link a {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.signup-link a:hover {
    text-decoration: underline;
}


.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}


.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    /* 修改点：背景透明 + 添加白色边框 */
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3); /* 半透明白色边框 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background-size: cover;
    background-position: center;
    /* 修改点：文字颜色改为白色确保可读性 */
    color: white;
}

/* 模型卡片中的作者头像也需要修改 */
.author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    /* 修改点：背景透明 + 添加边框 */
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1); /* 主内容区用浅色边框 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--dark); /* 使用深色文字 */
    font-weight: bold;
}




.user-details p {
    background-color: #ff9800;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

.user-details h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.user-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-value {
    font-weight: bold;
    color: var(--accent);
}

.sidebar-menu {
    padding: 0 20px;
}

.menu-group {
    margin-bottom: 25px;
}

.menu-group-title {
    font-size: 14px;
    color: var(--light-gray);
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
    color: rgba(255, 255, 255, 0.8);
}

.menu-item:hover {
    background: var(--sidebar-active);
    color: white;
}

.menu-item.active {
    background: var(--sidebar-active);
    color: white;
    font-weight: 500;
    border-left: 3px solid var(--primary);
}

.menu-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.menu-item .badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.footer-title {
    font-size: 14px;
    margin-bottom: 15px;
    color: var(--light-gray);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

/* 备案 */
.copyright {
    margin-top: 20px; /* 增加与上方内容的间距 */
    text-align: center;
    font-size: 12px; /* 减小字体大小 */
    color: rgba(255, 255, 255, 0.6); /* 调浅颜色 */
    line-height: 1.5; /* 增加行高 */
}

.copyright p {
    margin-bottom: 8px; /* 段落间距 */
}

.copyright a {
    color: rgba(255, 255, 255, 0.7); /* 链接颜色 */
    text-decoration: none;
    transition: color 0.3s;
}

.copyright a:hover {
    color: white; /* 悬停效果 */
    text-decoration: underline;
}


/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 顶部工具栏 */
.topbar {
    background-color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--light);
    border-radius: 30px;
    padding: 10px 15px;
    width: 600px;
}

.search-bar input {
    border: none;
    background: transparent;
    padding: 0 10px;
    font-size: 14px;
    width: 100%;
    outline: none;
}

.search-bar i {
    color: var(--gray);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--gray);
    gap: 10px;
}

.loading-spinner {
    border: 3px solid rgba(37, 99, 235, 0.2);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

.error-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

.category {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category:hover:not(.active) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.category.active {
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.categories {
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--light-gray) var(--light);
}

.categories::-webkit-scrollbar {
    height: 8px;
}

.categories::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 4px;
}

.categories::-webkit-scrollbar-thumb {
    background-color: var(--light-gray);
    border-radius: 4px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light);
    cursor: pointer;
    transition: all 0.3s;
}

.action-icon:hover {
    background: var(--light-gray);
}

.content {
    padding: 30px;
    flex: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.model-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark);
}

.model-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--gray);
    font-size: 14px;
}

.author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff9e6d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
}

.model-stats {
    display: flex;
    justify-content: space-between;
    color: var(--gray);
    font-size: 13px;
    margin-bottom: 15px;
}

.model-actions {
    display: flex;
    gap: 10px;
}

.model-btn {
    flex: 1;
    background: var(--light);
    border: none;
    padding: 8px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.model-btn.primary {
    background: var(--primary);
    color: white;
}

.model-btn:hover {
    background: var(--light-gray);
}

.model-btn.primary:hover {
    background: var(--secondary);
}

/* 模型分类 */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.category {
    background: var(--light);
    border-radius: 30px;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.category:hover, .category.active {
    background: var(--primary);
    color: white;
}

.model-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
	cursor: pointer;
}

.model-image {
    height: 300px;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
	cursor: pointer;
}

@media (min-width: 768px) {
    .model-image {
        height: 380px;
    }
}

@media (min-width: 1200px) {
    .model-image {
        height: 480px;
    }
}

.model-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.model-info {
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.model-title {
    font-size: 14px;
    line-height: 1.2;
}

.model-author {
    font-size: 12px;
}

.model-stats {
    font-size: 11px;
    border-top: 1px solid var(--light);
    padding-top: 5px;
    margin-top: 5px;
}

.author-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: white;
    font-weight: bold;
}

.model-actions {
    display: none;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
    grid-auto-rows: 1fr;
}

.model-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 移动端元素 */
.mobile-menu-toggle {
    display: none;
    padding: 15px;
    text-align: center;
    color: white;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu-toggle i {
    font-size: 20px;
}

/* 移动端统计信息 */
.mobile-stats {
    display: none;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin: 0 10px 15px; /* 修复：顶部0, 左右10px, 底部15px */
    flex-wrap: wrap;
}

.mobile-stat-item {
    text-align: center;
    padding: 8px;
    font-size: 13px;
}

.mobile-stat-item div:first-child {
    color: var(--light-gray);
    margin-bottom: 5px;
}

.mobile-stat-item div:last-child {
    font-weight: bold;
    color: var(--accent);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .sidebar {
        width: 240px;
    }
    
    .search-bar {
        width: 300px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 70px;
        overflow: visible;
    }
    
    .sidebar-header, .user-info, .user-details, .stat-name, 
    .menu-group-title, .menu-item span, .sidebar-footer {
        display: none;
    }
    
    .menu-item {
        padding: 15px;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .menu-item i {
        margin: 0;
        font-size: 20px;
    }
    
    .avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* 修正点：在移动端媒体查询中 */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    /* 隐藏桌面端用户信息和统计信息 */
    .user-info, 
    .user-stats,
    .sidebar-footer {
        display: none;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 10px;
        display: flex;
        flex-direction: column;
    }
    
    .sidebar-header {
        display: flex;
        align-items: center;
        padding: 10px;
        order: 1;
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 10px 0;
        order: 2;
    }

    /* 显示移动端元素 */
    .mobile-menu-toggle {
        display: block;
        order: 3;
    }

    .mobile-stats {
        order: 4;
        display: flex;
        justify-content: space-between;
        margin: 0 10px 15px;
    }
    
    .logo {
        margin: 0;
        flex: 1;
    }
    
    .menu-group {
        display: flex;
        margin: 0;
    }
    
    .menu-item {
        margin: 0 5px;
        white-space: nowrap;
    }
   
    .mobile-stat-item {
        flex: 1;
        min-width: 45%;
        margin: 5px;
    }

    .model-card {
        min-height: 250px;
    }
    
    .models-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .topbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .search-bar {
        width: 100%;
    }
}