/* 全局样式 - 响应式设计 */
: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 15px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
}

.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: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    z-index: 1001;
}

.logo img {
    width: 32px;
    height: 32px;
    margin-right: 8px;
}

/* 移动端汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: var(--dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.nav-links {
    display: flex;
    list-style: none;
    transition: all 0.3s ease;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
    padding: 8px 0;
    position: relative;
    font-size: 14px;
    white-space: nowrap;
}

.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;
    z-index: 1001;
}

.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;
    font-size: 16px;
}

.login-actions {
    display: flex;
    gap: 8px;
}

.user-info-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

#navUsername {
    font-weight: 500;
    color: var(--dark);
    font-size: 14px;
}

.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: 12px;
    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 6px;
    border-radius: 3px;
    font-size: 10px;
    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;
}

/* 英雄区域 - 移动端优化 */
.hero {
    background: linear-gradient(135deg, #2c7be5 0%, #1a68d1 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-top: 0;
}

.hero h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

.hero p {
    font-size: 1rem;
    max-width: 100%;
    margin: 0 auto 25px;
    opacity: 0.9;
    line-height: 1.5;
    padding: 0 10px;
}

.search-box {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    padding: 0 15px;
}

.search-box input {
    width: 100%;
    padding: 14px 20px;
    border-radius: 50px;
    border: none;
    font-size: 16px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    -webkit-appearance: none;
}

.search-box button {
    position: absolute;
    right: 20px;
    top: 7px;
    padding: 10px 20px;
    border-radius: 50px;
    background-color: var(--primary-dark);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

/* 通用区块样式 */
.section {
    padding: 40px 0;
    margin: 0;
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 10px;
}

.section-title h2 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.section-title p {
    color: var(--secondary);
    max-width: 100%;
    margin: 0 auto;
    font-size: 0.95rem;
}

/* 问题分类 - 移动端网格 */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.category-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.category-icon {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 15px;
}

.category-card h3 {
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.3;
}

.category-card p {
    font-size: 0.85rem;
    margin-bottom: 15px;
    color: var(--secondary);
    flex-grow: 1;
}

.category-card .btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* 热门问题 - 移动端单列 */
.problems {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.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: 20px;
}

.problem-tag {
    display: inline-block;
    background-color: #e6f2ff;
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 12px;
}

.problem-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.problem-card p {
    color: var(--secondary);
    margin-bottom: 15px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.problem-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--secondary);
}

.rating {
    color: var(--warning);
}

/* 专家咨询区域 - 移动端垂直布局 */
.consultation {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.consultation-content {
    flex: 1;
}

.consultation-image {
    flex: 1;
    text-align: center;
}

.consultation-image img {
    max-width: 100%;
    border-radius: 8px;
    height: auto;
}

/* 用户面板 */
.user-panel {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.login-prompt {
    background-color: white;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.login-prompt h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.login-prompt p {
    color: var(--secondary);
    margin-bottom: 25px;
    font-size: 1rem;
}

.login-prompt .btn {
    margin: 5px;
    padding: 10px 20px;
    font-size: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.user-actions {
    margin-top: 15px;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.user-details {
    flex: 1;
    width: 100%;
}

.user-details h3 {
    margin-bottom: 8px;
    font-size: 1.3rem;
    color: var(--dark);
}

.panel-roles {
    display: flex;
    flex-direction: row;
    gap: 5px;
    margin: 10px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.panel-role-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* 远程协助 */
.remote-assist {
    background: white;
    border-radius: 12px;
    padding: 30px;
    color: var(--dark);
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.remote-assist h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: center;
    color: var(--dark);
}

.remote-assist p {
    font-size: 1rem;
    margin-bottom: 25px;
    text-align: center;
    color: var(--secondary);
    line-height: 1.5;
}

.remote-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 25px 0;
}

.step-card {
    text-align: center;
    padding: 20px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.3s ease;
    border: 1px solid #e9ecef;
}

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

.step-icon {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.step-card h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.step-card p {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--secondary);
}

.remote-assist .btn {
    display: inline-block;
    margin: 5px;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 50px;
}

/* 页脚样式 */
footer {
    background-color: var(--dark);
    color: white;
    padding: 40px 0 20px;
    margin-top: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.footer-column h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #adb5bd;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
}

/* 微信小程序图片样式 */
.mini-program {
    text-align: center;
    grid-column: 1 / -1;
    margin-top: 10px;
}

.mini-program img {
    width: 120px;
    height: 120px;
    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;
    font-size: 0.95rem;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
    color: #adb5bd;
    font-size: 0.85rem;
}

/* 模态框 - 移动端优化 */
.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);
    padding: 15px;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    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.2rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--secondary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    -webkit-appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-but {
    text-align: center;
    display: flex;
    gap: 10px;
}

.form-but .btn {
    flex: 1;
    padding: 12px;
    font-size: 16px;
}

.form-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.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;
}

/* 评分系统样式 */
.rating-system {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-star {
    color: #ddd;
    font-size: 0.9rem;
}

.rating-star.active {
    color: var(--warning);
}

.rating-value {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

/* 快速行动按钮 */
.user-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
}

.user-quick-actions .btn {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

/* Toast通知样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 15px;
    left: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    padding: 15px;
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    max-width: 100%;
}

.toast.show {
    transform: translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.toast-content i {
    font-size: 18px;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-success i {
    color: #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-error i {
    color: #dc3545;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-info i {
    color: #17a2b8;
}

/* 响应式设计 - 平板 */
@media (min-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
        max-width: 700px;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .categories {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .problems {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .user-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .remote-steps {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .mini-program {
        grid-column: auto;
        margin-top: 0;
    }
    
    .user-info {
        flex-direction: row;
        text-align: left;
        align-items: center;
    }
    
    .user-avatar-large {
        margin-right: 20px;
        margin-bottom: 0;
    }
    
    .panel-roles {
        justify-content: flex-start;
    }
    
    .consultation {
        flex-direction: row;
        padding: 40px;
    }
    
    .toast {
        right: 30px;
        left: auto;
        max-width: 350px;
    }
}

/* 响应式设计 - 桌面端 */
@media (min-width: 992px) {
    .categories {
        grid-template-columns: repeat(6, 1fr);
        gap: 25px;
    }
    
    .problems {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .user-stats {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .nav-links li {
        margin-left: 25px;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .hero h1 {
        font-size: 2.8rem;
    }
    
    .search-box {
        max-width: 600px;
    }
}

/* 移动端导航菜单 */
@media (max-width: 991px) {
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: white;
        flex-direction: column;
        padding: 80px 20px 30px;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links li {
        margin: 0 0 15px 0;
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 12px 15px;
        border-radius: 4px;
        font-size: 16px;
    }
    
    .nav-links a:hover {
        background-color: #f8f9fa;
    }
    
    .nav-links a.active::after {
        display: none;
    }
    
    .nav-links a.active {
        background-color: var(--primary);
        color: white;
    }
    
    /* 移动端用户菜单调整 */
    .user-menu {
        position: static;
    }
    
    .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;
    }
}

/* 小屏幕手机优化 */
@media (max-width: 375px) {
    .categories {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .user-stats {
        grid-template-columns: 1fr;
    }
    
    .remote-steps {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .user-quick-actions .btn {
        min-width: 100px;
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .form-but {
        flex-direction: column;
    }
}

/* 防止移动端缩放 */
input, select, textarea {
    font-size: 16px !important;
}

/* 移动端优化触摸目标 */
.btn, 
.nav-links a,
.form-control,
.close-modal {
    min-height: 44px;
    min-width: 44px;
}

/* 修复移动端滚动条 */
.modal-content {
    -webkit-overflow-scrolling: touch;
}