/* 全局样式 - 与分页统一，避免跳转差异 */
:root {
    --primary: #2c7be5;
    --primary-dark: #1a68d1;
    --secondary: #6c757d;
    --light: #f8f9fa;
    --dark: #343a40;
    --success: #00d97e;
    --danger: #e63757;
    --warning: #f6c343;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    height: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background-color: #f5f7fa;
    color: var(--dark);
    line-height: 1.6;
    transition: none;
}

a {
    text-decoration: none;
    color: var(--primary);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

/* 导航栏样式 */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
    padding: 5px 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
}

.user-menu {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

.login-actions {
    display: flex;
    gap: 10px;
}

.user-info-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

#navUsername {
    font-weight: 500;
    color: var(--dark);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    color: var(--secondary);
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.logout-btn:hover {
    background-color: #f8f9fa;
    border-color: var(--secondary);
    color: var(--dark);
}

/* 角色标识样式 */
.user-roles {
    display: flex;
    flex-direction: column; /* 改为纵向排列 */
    gap: 2px; /* 减少间距 */
    margin-left: 8px;
}

.role-tag {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.role-user {
    background-color: #6c757d;
    color: white;
}

.role-contributor {
    background-color: #17a2b8;
    color: white;
}

.role-admin {
    background-color: #dc3545;
    color: white;
}

.role-vip {
    background-color: #ffc107;
    color: #212529;
}


/* 用户名和角色容器 */
.user-name-roles-container {
    display: flex;
    align-items: center;
}

.panel-roles {
    display: flex;
    flex-direction: row; /* 确保横向排列 */
    gap: 5px;
    margin-top: 5px;
    flex-wrap: wrap; /* 如果角色太多可以换行 */
}

.panel-role-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap; /* 防止文字换行 */
}
/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #2c7be5 0%, #1a68d1 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-top: 0;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 15px 20px;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 5px;
    padding: 10px 25px;
    border-radius: 50px;
    background-color: var(--primary-dark);
    color: white;
    border: none;
    cursor: pointer;
}

/* 通用区块样式 */
.section {
    padding: 80px 0;
    margin: 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 15px;
}

.section-title p {
    color: var(--secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 问题分类 */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.category-card {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.category-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 20px;
}

.category-card h3 {
    margin-bottom: 15px;
}

/* 热门问题 */
.problems {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.problem-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.problem-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.problem-content {
    padding: 25px;
}

.problem-tag {
    display: inline-block;
    background-color: #e6f2ff;
    color: var(--primary);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.problem-card h3 {
    margin-bottom: 10px;
}

.problem-card p {
    color: var(--secondary);
    margin-bottom: 20px;
}

.problem-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--secondary);
}

.rating {
    color: var(--warning);
}

/* 专家咨询 */
.consultation {
    background-color: white;
    border-radius: 8px;
    padding: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 40px;
}

.consultation-content {
    flex: 1;
}

.consultation-image {
    flex: 1;
    text-align: center;
}

.consultation-image img {
    max-width: 100%;
    border-radius: 8px;
}

/* 页脚样式 - 已添加微信小程序列间距调整 */
footer {
    background-color: var(--dark);
    color: white;
    padding: 60px 0 20px;
    margin-top: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

/* 新增：调整微信小程序列与快速链接的间距 */
.footer-column:nth-child(3) {
    margin-left: -150px; /* 减少与快速链接列的间距 */
}

.footer-column h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #adb5bd;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

/* 微信小程序图片样式 */
.mini-program {
    text-align: center;
}

.mini-program img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: block;
    margin: 0 auto;
}

.mini-program p {
    margin-top: 10px;
    font-weight: bold;
    color: #fff;
    text-align: center;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
    color: #adb5bd;
    font-size: 0.9rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-but {
    text-align: center;
}

.form-but .btn {
    margin: 0 10px;
}

.form-switch {
    text-align: center;
    margin-top: 15px;
}

.form-switch a {
    color: var(--primary);
    cursor: pointer;
}

.form-switch a:hover {
    text-decoration: underline;
}

/* 找回密码链接样式 */
.forgot-password {
    text-align: center;
    margin: 15px 0;
}

.forgot-password a {
    color: var(--secondary);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.forgot-password a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* 用户面板 - 恢复原始样式 */
.user-panel {
    background-color: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.login-prompt {
    background-color: white;
    border-radius: 8px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.login-prompt h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--dark);
}

.login-prompt p {
    color: var(--secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.login-prompt .btn {
    margin: 0 15px;
    padding: 12px 30px;
    font-size: 1.1rem;
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.user-actions {
    margin-left: auto;
}

.user-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin-right: 30px;
}
.user-details {
    flex: 1;
}
.user-details h3 {
    margin-bottom: 10px;
    font-size: 1.8rem;
    color: var(--dark);
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* 远程协助 - 白色背景样式 */
.remote-assist {
    background: white;
    border-radius: 12px;
    padding: 50px;
    color: var(--dark);
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.remote-assist h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--dark);
}

.remote-assist p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    text-align: center;
    color: var(--secondary);
}

.remote-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin: 40px 0;
}

.step-card {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.3s ease;
    border: 1px solid #e9ecef;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.step-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.step-card h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.step-card p {
    font-size: 1rem;
    margin-bottom: 0;
    color: var(--secondary);
}

.remote-assist .btn {
    display: inline-block;
    margin: 0 10px;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
}

.remote-assist .btn-primary {
    background-color: var(--primary);
    border: 2px solid var(--primary);
    color: white;
}

.remote-assist .btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.remote-assist .btn-success {
    background-color: var(--success);
    border: 2px solid var(--success);
    color: white;
}

.remote-assist .btn-success:hover {
    background-color: #00c571;
    border-color: #00c571;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 15px 0;
    }

    .nav-links {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links li {
        margin: 0 10px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .consultation {
        flex-direction: column;
    }

    .user-info {
        flex-direction: column;
        text-align: center;
    }

    .user-actions {
        margin: 15px 0 0 0;
    }

    .user-avatar-large {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .user-info-display {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .logout-btn {
        margin-top: 5px;
    }

    .user-roles {
        margin-left: 0;
        margin-top: 5px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .user-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .remote-steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .remote-assist {
        padding: 30px 20px;
    }

    /* 移动端调整微信小程序列间距 */
    .footer-column:nth-child(3) {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .user-stats {
        grid-template-columns: 1fr;
    }

    .remote-steps {
        grid-template-columns: 1fr;
    }
}

/* 评分系统样式 */
.rating-system {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-star {
    color: #ddd;
    font-size: 1rem;
}

.rating-star.active {
    color: var(--warning);
}

.rating-value {
    font-weight: 600;
    color: var(--dark);
}