body {
    font-family: sans-serif;
    background-color: #f0f0f0;
}

/* 修复输入框和表单样式 */
.form-control {
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    background-color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease !important;
}

.form-control:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
    background-color: #ffffff !important;
}

.form-control:hover {
    border-color: #c8d4ea !important;
}

/* 修复下拉菜单样式 */
.form-control select,
select.form-control {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 12px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px 16px !important;
    padding-right: 40px !important;
    cursor: pointer !important;
}

/* 文本域样式 */
textarea.form-control {
    resize: vertical !important;
    min-height: 120px !important;
}

/* 输入组样式 */
.input-group .form-control {
    border-radius: 8px 0 0 8px !important;
}

.input-group-append .btn {
    border-radius: 0 8px 8px 0 !important;
    border-left: none !important;
}

/* 标签样式 */
.form-label, label {
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 8px !important;
}

/* 必填字段标识 */
.text-danger {
    color: #ef4444 !important;
}

/* 表单组间距 */
.form-group {
    margin-bottom: 1.5rem !important;
}

/* 小文本提示 */
.form-text {
    color: #6b7280 !important;
    font-size: 0.875rem !important;
}

/* 按钮组样式改进 */
.btn-group .btn {
    border: 2px solid #e9ecef !important;
    background-color: #ffffff !important;
    color: #374151 !important;
    transition: all 0.3s ease !important;
}

.btn-group .btn:hover {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
}

.btn-group .btn.btn-primary {
    background-color: #667eea !important;
    border-color: #667eea !important;
    color: #ffffff !important;
}

/* 搜索框特别样式 */
.search-box .form-control {
    border-radius: 25px !important;
    padding-left: 20px !important;
    padding-right: 50px !important;
}

/* 表单卡片内的样式 */
.card .form-control {
    border: 2px solid #e5e7eb !important;
}

/* 错误状态 */
.form-control.is-invalid {
    border-color: #ef4444 !important;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.25) !important;
}

/* 成功状态 */
.form-control.is-valid {
    border-color: #10b981 !important;
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.25) !important;
}

/* 下拉菜单特别样式 - 确保完全显示 */
.form-group {
    position: relative !important;
    z-index: 1 !important;
}

select.form-control {
    height: auto !important;
    min-height: 48px !important;
    line-height: 1.5 !important;
}

/* 确保下拉选项可见 */
select.form-control option {
    padding: 8px 12px !important;
    background-color: #ffffff !important;
    color: #374151 !important;
    border: none !important;
}

select.form-control option:hover,
select.form-control option:focus {
    background-color: #f3f4f6 !important;
    color: #1f2937 !important;
}

/* 特别针对创建帖子页面的样式 */
.create-post-form .form-group {
    margin-bottom: 2rem !important;
}

.create-post-form select.form-control {
    font-size: 16px !important;
    padding: 14px 16px !important;
    border-radius: 8px !important;
}

/* 字符计数样式 */
#content-count {
    font-weight: 600 !important;
    color: #667eea !important;
}

/* 预览卡片样式 */
#preview-card {
    margin-top: 2rem !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
}

#preview-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-radius: 10px 10px 0 0 !important;
}

/* 发帖须知样式 */
.alert-info {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%) !important;
    border: 2px solid #0ea5e9 !important;
    border-radius: 10px !important;
    color: #0c4a6e !important;
}

.alert-info h6 {
    color: #0c4a6e !important;
    font-weight: 600 !important;
}

.alert-info ul li {
    margin-bottom: 8px !important;
    line-height: 1.6 !important;
}

/* 按钮样式改进 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3) !important;
}

.btn-secondary {
    background-color: #6b7280 !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-secondary:hover {
    background-color: #4b5563 !important;
    transform: translateY(-2px) !important;
}

/* 卡片样式增强 */
.card {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
}

.card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 1.5rem !important;
    border: none !important;
}

.card-body {
    padding: 2rem !important;
}

/* 个人中心特殊样式 */
.profile-form .form-group,
.profile-form .mb-3 {
    margin-bottom: 1.8rem !important;
}

.profile-form .form-label {
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 10px !important;
    font-size: 1rem !important;
}

.profile-form .form-control {
    font-size: 16px !important;
    padding: 14px 16px !important;
    border-radius: 10px !important;
    border: 2px solid #e5e7eb !important;
}

.profile-form .form-control:disabled {
    background-color: #f9fafb !important;
    border-color: #d1d5db !important;
    color: #6b7280 !important;
}

/* 登录和注册页面样式 */
.login-form .form-group,
.register-form .form-group {
    margin-bottom: 1.8rem !important;
}

.login-form .form-control,
.register-form .form-control {
    font-size: 16px !important;
    padding: 14px 16px !important;
    border-radius: 10px !important;
}

/* 搜索页面样式 */
.search-form .form-group {
    margin-bottom: 1.5rem !important;
}

.search-form .form-control {
    font-size: 16px !important;
    padding: 12px 16px !important;
}

/* 小文本提示增强 */
.text-muted,
.form-text {
    font-size: 0.875rem !important;
    color: #6b7280 !important;
    margin-top: 6px !important;
}

/* 分隔线样式 */
hr {
    border: none !important;
    height: 2px !important;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent) !important;
    margin: 2rem 0 !important;
}

/* 响应式改进 */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem !important;
    }
    
    .form-control {
        font-size: 16px !important;
        padding: 12px 14px !important;
    }
    
    .btn {
        padding: 12px 20px !important;
        font-size: 1rem !important;
    }
}

/* 论坛样式 */
.forum-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.post-item, .reply-item {
    transition: background-color 0.2s ease;
}

.post-item:hover, .reply-item:hover {
    background-color: #f8f9fa;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #dee2e6;
}

.user-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #dee2e6;
}

.user-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
}

.post-content, .reply-content {
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.post-meta {
    color: #6c757d;
    font-size: 0.875rem;
}

.post-stats {
    text-align: center;
    color: #6c757d;
    font-size: 0.875rem;
}

.post-stats i {
    margin-right: 3px;
}

.forum-category-filter .btn {
    margin-bottom: 5px;
}

.pinned-post {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.locked-post {
    opacity: 0.7;
}

.reply-item {
    border-bottom: 1px solid #eee;
    padding: 15px;
}

.reply-item:last-child {
    border-bottom: none;
}

.reply-header {
    margin-bottom: 10px;
}

.reply-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.post-title {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
}

.post-title:hover {
    color: #007bff;
    text-decoration: none;
}

.category-badge {
    font-size: 0.75rem;
    font-weight: 500;
}

.user-info {
    text-align: center;
    padding: 10px;
}

.user-info h6 {
    margin-bottom: 5px;
    font-weight: 600;
}

.user-stats {
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.4;
}

.forum-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.forum-header h2 {
    margin: 0;
    font-weight: 300;
}

.create-post-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s;
}

.create-post-btn:hover {
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.pagination .page-link {
    color: #667eea;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #667eea;
    border-color: #667eea;
}

.pagination .page-link:hover {
    color: #495057;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .user-avatar {
        width: 35px;
        height: 35px;
    }
    
    .user-avatar-large {
        width: 50px;
        height: 50px;
    }
    
    .post-stats, .user-stats {
        font-size: 0.75rem;
    }
    
    .forum-header {
        padding: 15px;
    }
    
    .create-post-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}