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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* ===== 头部导航 ===== */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo a {
    color: #3498db;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    transition: color 0.3s;
}

.logo a:hover {
    color: #2980b9;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 10px;
}

.main-nav a {
    color: #2c3e50;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: #3498db;
    color: white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-menu a {
    color: #2c3e50;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
}

.user-menu a:hover {
    background-color: #f0f2f5;
}

.login-btn,
.register-btn,
.logout-btn {
    font-weight: 500;
}

.login-btn {
    color: #3498db;
    border: 1px solid #3498db;
}

.login-btn:hover {
    background-color: #3498db;
    color: white;
}

.register-btn {
    background-color: #3498db;
    color: white;
}

.register-btn:hover {
    background-color: #2980b9;
}

/* ===== 统计卡片 ===== */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stat-icon {
    font-size: 40px;
    margin-right: 20px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
}

/* ===== 帖子列表 ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 22px;
    color: #2c3e50;
    position: relative;
    padding-left: 15px;
}

.section-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: #3498db;
    border-radius: 2px;
}

.btn-new-post {
    background-color: #3498db;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-new-post:hover {
    background-color: #2980b9;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.post-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.post-avatar {
    width: 60px;
    height: 60px;
    margin-right: 20px;
    flex-shrink: 0;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f2f5;
}

.post-content {
    flex: 1;
}

.post-title {
    margin-bottom: 10px;
}

.post-title a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    transition: color 0.3s;
}

.post-title a:hover {
    color: #3498db;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #7f8c8d;
}

.post-meta a {
    color: #3498db;
    text-decoration: none;
}

.post-meta a:hover {
    text-decoration: underline;
}

.post-excerpt {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

/* ===== 帖子详情页 ===== */
.breadcrumb {
    margin-bottom: 20px;
    color: #7f8c8d;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.post-detail {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.post-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.post-header h1 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.post-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 30px;
}

.post-actions {
    display: flex;
    gap: 10px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* ===== 回复区域 ===== */
.replies-section {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.replies-list {
    margin-bottom: 30px;
}

.reply-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.reply-item:last-child {
    border-bottom: none;
}

.reply-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.reply-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.reply-info {
    flex: 1;
}

.reply-author {
    font-weight: 600;
    margin-right: 10px;
}

.reply-author a {
    color: #2c3e50;
    text-decoration: none;
}

.reply-time {
    color: #7f8c8d;
    font-size: 12px;
    margin-right: 10px;
}

.reply-floor {
    color: #95a5a6;
    font-size: 12px;
}

.reply-content {
    padding-left: 55px;
    color: #333;
    line-height: 1.6;
}

.reply-actions {
    padding-left: 55px;
    margin-top: 10px;
}

/* ===== 表单样式 ===== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.auth-box {
    background: white;
    border-radius: 10px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
}

.auth-title {
    text-align: center;
    color: #3498db;
    margin-bottom: 10px;
}

.auth-subtitle {
    text-align: center;
    font-size: 18px;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-weight: normal;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-check {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.forgot-link {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #7f8c8d;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

.btn-edit {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
}

/* ===== 提示框 ===== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

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

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

/* ===== 个人中心 ===== */
.profile-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

.profile-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.profile-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.profile-avatar {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f2f5;
}

.change-avatar-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
}

.profile-username {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 20px;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.profile-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.empty-message {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ===== 管理员标签 ===== */
.admin-badge {
    background-color: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}

.pagination a:hover {
    background: #f8f9fa;
}

.pagination .current {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* ===== 页脚 ===== */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 30px 0;
    margin-top: 50px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .post-item {
        flex-direction: column;
    }
    
    .post-avatar {
        margin-bottom: 15px;
    }
    
    .profile-container {
        grid-template-columns: 1fr;
    }
    
    .profile-sidebar {
        position: static;
    }
    
    .auth-box {
        margin: 20px;
        padding: 20px;
    }
}
/* 新增样式 - 添加到 style.css 末尾 */

/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    z-index: 1000;
    margin-top: 10px;
}

.dropdown-content a {
    color: #2c3e50;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.dropdown-content a:hover {
    background-color: #f8f9fa;
}

.dropdown-content a:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-content a:last-child {
    border-radius: 0 0 8px 8px;
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

/* 热门标签 */
.hot-badge {
    background: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    margin-left: 8px;
    font-weight: normal;
}

/* 侧边栏小工具 */
.sidebar-widget {
    margin-bottom: 20px;
}

.sidebar-widget h3 {
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
    color: #2c3e50;
}

/* 管理员小徽章 */
.admin-badge-small {
    background: #f39c12;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    margin-left: 5px;
}

/* 页脚链接 */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #3498db;
}

.footer-info p {
    margin: 5px 0;
    font-size: 12px;
    opacity: 0.8;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 50px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}