/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f6f6f6;
    color: #1a1a1a;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航 */
.header {
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #0084ff;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    color: #8590a6;
    font-size: 16px;
    transition: color 0.3s;
}

.nav a:hover,
.nav a.active {
    color: #0084ff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-actions .btn {
    height: 32px;
    padding: 0 16px;
    font-size: 14px;
}

/* 按钮 */
.btn {
    padding: 8px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #0084ff;
    color: white;
}

.btn-primary:hover {
    background: #0073e6;
}

.btn-login {
    background: transparent;
    color: #0084ff;
    border: 1px solid #0084ff;
}

.btn-login:hover {
    background: #f0f7ff;
}

.btn-action {
    background: #f0f2f5;
    color: #1a1a1a;
    padding: 6px 12px;
    border-radius: 20px;
    margin-right: 10px;
}

.btn-action:hover {
    background: #e0e2e5;
}

/* 主要内容区 */
.main-content {
    padding: 20px 0;
}

.content-wrapper {
    display: flex;
    gap: 20px;
}

.content-main {
    flex: 1;
    max-width: 800px;
}

.content-sidebar {
    width: 320px;
}

/* 标签 */
.tabs {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
}

.tabs a {
    color: #8590a6;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.tabs a:hover,
.tabs a.active {
    color: #0084ff;
    background: #f0f7ff;
}

/* 问题列表项 */
.question-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    gap: 20px;
    transition: box-shadow 0.3s;
}

.question-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.question-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 80px;
}

.stat-item {
    text-align: center;
}

.stat-item .count {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #1a1a1a;
}

.stat-item .label {
    font-size: 12px;
    color: #8590a6;
}

.question-content {
    flex: 1;
}

.question-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.question-title a:hover {
    color: #0084ff;
}

.question-excerpt {
    color: #8590a6;
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.question-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background: #f0f2f5;
    color: #8590a6;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    transition: all 0.3s;
}

.tag:hover {
    background: #e0e2e5;
    color: #0084ff;
}

.author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #8590a6;
}

.avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.avatar-medium {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

/* 通用头像样式（用于导航栏） */
.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.3s;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

/* 分页 */
.pagination {
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination a {
    padding: 8px 12px;
    border-radius: 4px;
    background: #f0f2f5;
    transition: all 0.3s;
}

.pagination a:hover,
.pagination a.active {
    background: #0084ff;
    color: white;
}

/* 侧边栏 */
.sidebar-widget {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.sidebar-widget h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.hot-topics li,
.recommended-users li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
}

.hot-topics li:last-child,
.recommended-users li:last-child {
    border-bottom: none;
}

.hot-topics a,
.recommended-users a {
    color: #1a1a1a;
    transition: color 0.3s;
}

.hot-topics a:hover,
.recommended-users a:hover {
    color: #0084ff;
}

.hot-topics span {
    font-size: 12px;
    color: #8590a6;
    margin-left: 10px;
}

.recommended-users img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 10px;
}

/* 问题详情 */
.question-detail {
    background: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.question-detail .question-title {
    font-size: 24px;
    margin-bottom: 20px;
}

.question-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f2f5;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 500;
    color: #1a1a1a;
}

.time {
    font-size: 12px;
    color: #8590a6;
}

.question-stats {
    color: #8590a6;
    font-size: 14px;
}

.question-stats span {
    margin-left: 15px;
}

.question-body {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.question-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.question-actions {
    padding-top: 20px;
    border-top: 1px solid #f0f2f5;
}

/* 回答区域 */
.answers-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
}

.answers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f2f5;
}

.answers-sort a {
    margin-left: 15px;
    color: #8590a6;
    font-size: 14px;
}

.answers-sort a:hover,
.answers-sort a.active {
    color: #0084ff;
}

.answer-form {
    background: #f0f2f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.answer-form h3 {
    margin-bottom: 15px;
}

.answer-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-size: 14px;
    margin-bottom: 10px;
}

.answer-form .btn {
    float: right;
}

.login-prompt {
    background: #f0f7ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.login-prompt a {
    color: #0084ff;
    font-weight: 500;
}

/* 回答列表 */
.answer-item {
    padding: 20px 0;
    border-bottom: 1px solid #f0f2f5;
    position: relative;
}

.answer-item:last-child {
    border-bottom: none;
}

.answer-item.accepted {
    background: #f0fff4;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.accepted-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #52c41a;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.answer-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.answer-body {
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.answer-actions {
    display: flex;
    gap: 10px;
}

/* 轮播图 */
.banner-container {
    position: relative;
    width: 100%;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.banner-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    cursor: pointer;
}

.banner-slide.active {
    opacity: 1;
}

.banner-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.banner-dot.active {
    background: white;
}

.banner-prev,
.banner-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.3s;
}

.banner-prev {
    left: 10px;
}

.banner-next {
    right: 10px;
}

.banner-prev:hover,
.banner-next:hover {
    background: rgba(0,0,0,0.5);
}

/* 页脚 */
.footer {
    background: white;
    padding: 30px 0;
    text-align: center;
    color: #8590a6;
    font-size: 14px;
    margin-top: 40px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 后台管理样式 */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: #001529;
    color: white;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.admin-logo {
    font-size: 20px;
    font-weight: bold;
}

.admin-nav {
    display: flex;
    gap: 20px;
}

.admin-nav a {
    color: rgba(255,255,255,0.7);
    transition: color 0.3s;
}

.admin-nav a:hover {
    color: white;
}

.admin-content {
    display: flex;
    margin-top: 20px;
    gap: 20px;
}

.admin-sidebar {
    width: 240px;
    background: white;
    border-radius: 8px;
    padding: 20px;
}

.admin-sidebar ul li {
    margin-bottom: 10px;
}

.admin-sidebar ul li a {
    display: block;
    padding: 10px;
    border-radius: 4px;
    color: #1a1a1a;
    transition: all 0.3s;
}

.admin-sidebar ul li a:hover,
.admin-sidebar ul li a.active {
    background: #f0f7ff;
    color: #0084ff;
}

.admin-main {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 30px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f2f5;
}

.admin-table th {
    background: #fafafa;
    font-weight: 500;
}

.admin-table tr:hover {
    background: #fafafa;
}

.btn-edit {
    background: #52c41a;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.btn-delete {
    background: #ff4d4f;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
}

/* 统计图表 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-card .number {
    font-size: 32px;
    font-weight: bold;
}

/* 响应式 */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .content-sidebar {
        width: 100%;
    }
    
    .question-item {
        flex-direction: column;
    }
    
    .question-stats {
        flex-direction: row;
        justify-content: flex-start;
    }
}

 
 