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

/* CSS变量 - 浅色主题（默认） */
:root {
    --bg-primary: #93c5fd;
    --bg-gradient: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-sidebar: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.15);
    --bg-glass-hover: rgba(255, 255, 255, 0.2);
    --bg-button-primary: linear-gradient(135deg, #4FC3F7 0%, #2196F3 100%);
    --bg-button-secondary: rgba(66, 165, 245, 0.1);
    --bg-button-login: linear-gradient(135deg, #29B6F6 0%, #0D47A1 100%);
    --bg-input: rgba(255, 255, 255, 0.95);
    --bg-search: rgba(255, 255, 255, 0.8);
    --bg-tag: #F0F8FF;
    --bg-category: #E3F2FD;
    --bg-announcement: #f7fafc;
    --bg-comment: #f7fafc;
    
    --text-primary: #333;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-light: white;
    --text-link: #2196F3;
    --text-tag: #0277BD;
    --text-category: #1565C0;
    
    --border-color: rgba(255, 255, 255, 0.25);
    --border-input: #e2e8f0;
    --border-glass: rgba(255, 255, 255, 0.25);
    
    --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --shadow-button: 0 4px 12px rgba(33, 150, 243, 0.4);
    
    --scrollbar-track: rgba(0, 0, 0, 0.05);
    --scrollbar-thumb: rgba(70, 130, 180, 0.3);
    --scrollbar-thumb-hover: rgba(70, 130, 180, 0.5);
}

/* CSS变量 - 深色主题 */
[data-theme="dark"] {
    --bg-primary: #1a202c;
    --bg-gradient: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    --bg-card: rgba(45, 55, 72, 0.95);
    --bg-sidebar: rgba(45, 55, 72, 0.95);
    --bg-glass: rgba(45, 55, 72, 0.15);
    --bg-glass-hover: rgba(45, 55, 72, 0.2);
    --bg-button-primary: linear-gradient(135deg, #63b3ed 0%, #2c5282 100%);
    --bg-button-secondary: rgba(99, 179, 237, 0.1);
    --bg-button-login: linear-gradient(135deg, #4299e1 0%, #2a4365 100%);
    --bg-input: rgba(45, 55, 72, 0.95);
    --bg-search: rgba(45, 55, 72, 0.8);
    --bg-tag: rgba(66, 153, 225, 0.1);
    --bg-category: rgba(99, 179, 237, 0.1);
    --bg-announcement: #2d3748;
    --bg-comment: #2d3748;
    
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --text-light: white;
    --text-link: #63b3ed;
    --text-tag: #63b3ed;
    --text-category: #63b3ed;
    
    --border-color: rgba(45, 55, 72, 0.25);
    --border-input: #4a5568;
    --border-glass: rgba(45, 55, 72, 0.25);
    
    --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-button: 0 4px 12px rgba(99, 179, 237, 0.4);
    
    --scrollbar-track: rgba(255, 255, 255, 0.05);
    --scrollbar-thumb: rgba(99, 179, 237, 0.3);
    --scrollbar-thumb-hover: rgba(99, 179, 237, 0.5);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* 背景装饰圆 */
body::before,
body::after,
body .bg-circle {
    content: '';
    position: fixed;
    border-radius: 50%;
    opacity: 0.3;
    z-index: -1;
}

body::before {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #ff6b9d, #fecfef);
    top: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

body::after {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #4ecdc4, #45b7d1);
    bottom: -80px;
    left: -80px;
    animation: float 8s ease-in-out infinite reverse;
}

body .bg-circle {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #ffd93d, #ffeaa7);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 10s ease-in-out infinite alternate;
}

/* 浮动动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

/* 毛玻璃效果容器 */
.glass-container {
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-glass);
    transition: all 0.3s ease;
}

/* 卡片样式 */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

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

/* 导航栏 */
.navbar {
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-glass);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--text-light);
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    background: var(--bg-glass-hover);
}

/* 主内容区域 */
.main-content {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    gap: 30px;
    padding: 20px;
    align-items: flex-start;
}

/* 侧边栏 */
.sidebar {
    width: 300px;
    background: var(--bg-sidebar);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    position: sticky;
    top: 100px;
    bottom: 20px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    align-self: flex-start;
    margin-left: 10px;
    transition: all 0.3s ease;
}

/* 自定义滚动条 */
.sidebar::-webkit-scrollbar,
.container::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.container::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb,
.container::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.container::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* 主容器 - 毛玻璃卡片效果 */
.container {
    flex: 1;
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-glass);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    transition: all 0.3s ease;
}

/* 侧边栏标题 */
.sidebar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-input);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

/* 侧边栏部分 */
.sidebar-section {
    margin-bottom: 30px;
}

/* 用户信息样式 */
.user-info {
    text-align: center;
}

#user-info-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-button-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.user-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    transition: all 0.3s ease;
}

.user-email {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    transition: all 0.3s ease;
}

.user-stats {
    display: flex;
    gap: 20px;
    margin: 10px 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-weight: 600;
    color: var(--text-link);
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    transition: all 0.3s ease;
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* 公告列表样式 */
.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.announcement-item {
    background: var(--bg-announcement);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--text-link);
    transition: all 0.3s ease;
}

.announcement-item h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.announcement-item p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.announcement-item small {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    text-align: right;
    transition: all 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
    }
}

/* 登录按钮样式 */
.login-btn {
    background: var(--bg-button-login);
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    width: 100%;
    text-align: center;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-button);
}

.register-btn {
    background: transparent;
    color: var(--text-link);
    border: 1px solid var(--text-link);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    width: 100%;
    text-align: center;
}

.register-btn:hover {
    background: var(--text-link);
    color: var(--text-light);
}

/* 标题样式 */
h1, h2, h3, h4 {
    color: var(--text-secondary);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    color: var(--text-light);
    margin: 30px 0;
    transition: all 0.3s ease;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background: var(--bg-button-primary);
    color: var(--text-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-button);
}

.btn-secondary {
    background: var(--bg-button-secondary);
    color: var(--text-link);
    border: 1px solid var(--text-link);
}

.btn-secondary:hover {
    background: rgba(99, 179, 237, 0.2);
}

.btn-danger {
    background: #f56565;
    color: var(--text-light);
}

.btn-danger:hover {
    background: #e53e3e;
    transform: translateY(-2px);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-input);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-input);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--text-link);
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 150px;
}

/* 帖子列表样式 */
.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.post-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.post-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.post-title:hover {
    color: var(--text-link);
}

.post-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: all 0.3s ease;
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    background: var(--bg-tag);
    color: var(--text-tag);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* 分类样式 */
.category-badge {
    background: var(--bg-category);
    color: var(--text-category);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* 搜索和筛选 */
.search-filter {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 300px;
    padding: 12px;
    border: 1px solid var(--border-glass);
    border-radius: 25px;
    background: var(--bg-search);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--text-link);
    background: var(--bg-input);
    box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.1);
}

/* 管理页面样式 */
.manage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .post-list {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        gap: 10px;
    }
    
    .nav-links a {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .search-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .manage-grid {
        grid-template-columns: 1fr;
    }
}

/* 登录注册页面 */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    background: var(--bg-card);
    border-radius: 15px;
    padding: 40px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.auth-title {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.slider-captcha {
    user-select: none;
}

.slider-track {
    position: relative;
    background: #2d3748;
    border-radius: 4px;
    height: 40px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.slider-thumb {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    background: #4299e1;
    cursor: pointer;
}

.slider-text {
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: #a0aec0;
}

/* 页脚样式 */
.footer {
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-glass);
    padding: 20px 0;
    text-align: center;
    color: var(--text-light);
    margin-top: 50px;
    transition: all 0.3s ease;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--text-light);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 消息提示 */
.message {
    padding: 12px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
    transition: all 0.3s ease;
}

.message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.message.info {
    background: #ebf8ff;
    color: #2a4365;
    border: 1px solid #bee3f8;
}

/* 帖子详情页 */
.post-detail {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.post-detail-title {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-primary) !important;
    text-align: left;
    transition: all 0.3s ease;
}

/* 确保帖子详情页的h1标题颜色正确，不受全局h1样式影响 */
.post-detail h1.post-detail-title {
    color: var(--text-primary) !important;
}

.post-detail-content {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

/* 确保帖子内容中的标题显示正确颜色，不受全局h1样式影响 */
.post-detail-content h1,
.post-detail-content h2,
.post-detail-content h3,
.post-detail-content h4,
.post-detail-content h5,
.post-detail-content h6 {
    color: var(--text-primary) !important;
    text-align: left !important;
    margin: 20px 0 !important;
    transition: all 0.3s ease;
}

.post-detail-content h1 {
    font-size: 1.8rem !important;
}

.post-detail-content h2 {
    font-size: 1.6rem !important;
}

.post-detail-content h3 {
    font-size: 1.4rem !important;
}

.post-detail-content h4 {
    font-size: 1.2rem !important;
}

.post-detail-content h5 {
    font-size: 1.1rem !important;
}

.post-detail-content h6 {
    font-size: 1rem !important;
}

/* 评论区 */
.comments-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-input);
    transition: all 0.3s ease;
}

.comment {
    background: var(--bg-comment);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.comment-content {
    color: var(--text-secondary);
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* 主题切换按钮 */
.theme-toggle {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-light);
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
}

