/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 加载动画 */
.loader{position:fixed;top:0;left:0;width:100%;height:100%;background:white;display:flex;align-items:center;justify-content:center;z-index:9999;transition:opacity .5s ease,visibility .5s ease}
.loader.hidden{opacity:0;visibility:hidden}
.loader-circle{width:50px;height:50px;border:5px solid #f3f3f3;border-top:5px solid #667eea;border-radius:50%;animation:spin 1s linear infinite}
@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 深色模式 */
body.dark {
    color: #e0e0e0;
    background-color: #121212;
}

body.dark .loader {
    background: #121212;
}

body.dark .loader-circle {
    border: 5px solid #2c2c2c;
    border-top: 5px solid #667eea;
}

body.dark nav {
    background: #1e1e1e;
    color: #e0e0e0;
    border-bottom: 1px solid #333;
}

body.dark .nav-links a {
    color: #e0e0e0;
}

body.dark .nav-links a:hover {
    color: #fb7299;
}

body.dark .nav-links a.active {
    color: #fb7299;
}

body.dark .nav-search .search-input {
    border: 1px solid #333;
    background: #2c2c2c;
    color: #e0e0e0;
}

body.dark .nav-search .search-input:focus {
    border-color: #fb7299;
    box-shadow: 0 0 0 2px rgba(251, 114, 153, 0.2);
    background: #2c2c2c;
}

body.dark .nav-search .search-btn {
    color: #999;
}

body.dark .user-avatar {
    color: #e0e0e0;
}

body.dark .avatar-icon {
    background: #2c2c2c;
}

body.dark .user-avatar:hover .avatar-icon {
    background: #333;
}

body.dark .user-dropdown .dropdown-content {
    background-color: #1e1e1e;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

body.dark .dropdown-content a {
    color: #e0e0e0;
}

body.dark .dropdown-content a:hover {
    background-color: #2c2c2c;
    color: #667eea;
}

body.dark .dropdown-content .divider {
    background-color: #333;
}

body.dark .dropdown-content .user-info {
    border-bottom: 1px solid #333;
    color: #e0e0e0;
}

body.dark .login-card {
    background: #1e1e1e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark .login-card-content h3 {
    color: #e0e0e0;
}

body.dark .login-card-content p {
    color: #999;
}

body.dark .login-buttons .register-btn {
    background: #1e1e1e;
    color: #fb7299;
    border: 1px solid #fb7299;
}

body.dark .login-buttons .register-btn:hover {
    background: #2c2c2c;
}

body.dark .tag-cloud a {
    background: #2c2c2c;
    color: #999;
}

body.dark .tag-cloud a:hover {
    background: #667eea;
    color: white;
}

body.dark footer {
    background: #1e1e1e;
    color: #999;
    border-top: 1px solid #333;
}

body.dark .footer-links a {
    color: #999;
}

body.dark .footer-links a:hover {
    color: #fb7299;
}

/* 导航栏样式 */
nav {
    background: #ffffff;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-bottom: 1px solid #eaeaea;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
}

.logo a {
    color: #fb7299;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
}

.logo a:hover {
    color: #ff4d6d;
    transform: scale(1.05);
}

.nav-main {
    display: flex;
    align-items: center;
    flex: 1;
    margin: 0 40px;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    margin-right: 40px;
}

.nav-links li {
    margin-right: 24px;
    position: relative;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 8px 0;
    position: relative;
}

.nav-links a:hover {
    color: #fb7299;
}

.nav-links a.active {
    color: #fb7299;
    font-weight: 600;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fb7299;
}

.nav-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.nav-search .search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #eaeaea;
    border-radius: 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: #f5f5f5;
}

.nav-search .search-input:focus {
    border-color: #fb7299;
    box-shadow: 0 0 0 2px rgba(251, 114, 153, 0.1);
    background: white;
}

.nav-search .search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
}

.nav-search .search-btn:hover {
    color: #fb7299;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.upload-btn {
    background: #fb7299;
    color: white;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #fb7299;
}

.upload-btn:hover {
    background: #ff4d6d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 114, 153, 0.4);
}

.user-avatar {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.avatar-icon {
    font-size: 24px;
    border-radius: 50%;
    background: #f5f5f5;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.user-avatar:hover .avatar-icon {
    background: #eaeaea;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
}

.user-dropdown .dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 4px;
    z-index: 1001;
    margin-top: 5px;
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: #667eea;
}

.dropdown-content .divider {
    height: 1px;
    background-color: #eee;
    margin: 5px 0;
}

.dropdown-content .user-info {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    color: #333;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* 登录卡片 */
.login-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    overflow: hidden;
}

.login-card-content {
    padding: 20px;
    text-align: center;
}

.login-card-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.login-card-content p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.login-buttons {
    display: flex;
    gap: 10px;
}

.login-buttons .login-btn {
    flex: 1;
    background: linear-gradient(135deg, #fb7299 0%, #ff4d6d 100%);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(251, 114, 153, 0.3);
    text-align: center;
}

.login-buttons .login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(251, 114, 153, 0.4);
    background: linear-gradient(135deg, #ff4d6d 0%, #fb7299 100%);
}

.login-buttons .login-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(251, 114, 153, 0.5);
}

.login-buttons .login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.login-buttons .login-btn:hover::before {
    left: 100%;
}

.login-buttons .register-btn {
    flex: 1;
    background: white;
    color: #fb7299;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #fb7299;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.login-buttons .register-btn:hover {
    background: #fef0f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 114, 153, 0.2);
}

.login-buttons .register-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(251, 114, 153, 0.3);
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud a {
    display: inline-block;
    padding: 4px 12px;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    border-radius: 16px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.tag-cloud a:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* 页脚样式 */
footer {
    background: #f8f8f8;
    color: #666;
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
    border-top: 1px solid #eaeaea;
}

footer p {
    font-size: 14px;
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fb7299;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .container {
        max-width: 900px;
    }
    
    .nav-main {
        margin: 0 20px;
    }
    
    .nav-links {
        margin-right: 20px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        padding: 15px;
        height: auto;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .nav-links {
        margin-top: 15px;
        margin-bottom: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 0 10px;
        margin-bottom: 10px;
    }
    
    .nav-links a {
        font-size: 14px;
        padding: 6px 10px;
    }
    
    .nav-search {
        margin-top: 10px;
        width: 100%;
        max-width: none;
    }
    
    .nav-user {
        margin-top: 15px;
    }
    
    .container {
        max-width: 700px;
        padding: 0 15px;
    }
    
    .login-buttons {
        flex-direction: column;
    }
}