/* 社区页样式（精美动画版） */
.page-nav {
    background: var(--primary);
    border-bottom: none;
    padding: 0;
    position: sticky;
    top: 72px;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.page-nav-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 16px 0;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
}

.community-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.community-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: white;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.tab-btn:hover::before {
    left: 100%;
}

.tab-btn:hover {
    background: white;
    color: var(--primary);
}

.tab-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 153, 85, 0.4);
}

/* 搜索栏 */
.search-bar {
    max-width: 900px;
    margin: 0 auto 40px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 8px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,136,0,0.1);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    margin-right: 12px;
    flex-shrink: 0;
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text-primary);
    background: transparent;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 12px;
}

.search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.search-tags {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.tag-label {
    font-size: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-tag {
    background: rgba(0,136,0,0.1);
    color: var(--primary);
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-tag:hover {
    background: var(--primary);
    color: white;
}

/* 提问表单 */
.ask-form-card {
    background: linear-gradient(135deg, rgba(0,136,0,0.08), rgba(0,136,0,0.02));
    border: 2px dashed var(--primary);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.ask-form-title {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.ask-form-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.ask-form-card .form-group {
    margin-bottom: 16px;
}

.ask-form-card .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ask-form-card .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: all 0.3s ease;
}

.ask-form-card .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,136,0,0.1);
}

.ask-form-card .form-group textarea::placeholder {
    color: var(--text-muted);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
}

/* 内容区 */
.community-content {
    padding: 60px 0;
    background: var(--bg-light);
    min-height: calc(100vh - 300px);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 问答列表 */
.qa-list {
    max-width: 900px;
    margin: 0 auto;
}

.qa-item {
    background: white;
    border-radius: 16px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.qa-item:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.qa-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(0,136,0,0.05), rgba(0,136,0,0.02));
    border-bottom: 1px solid rgba(0,136,0,0.1);
}

.q-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.q-text {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.qa-answer {
    display: flex;
    gap: 16px;
    padding: 24px;
}

.a-icon {
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 4px;
}

.answer-content {
    flex: 1;
}

.answer-content p {
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
    text-indent: 2em;
}

.answer-content p:last-child {
    margin-bottom: 0;
}

.no-result {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 16px;
}

/* 文章列表 */
.article-list {
    display: grid;
    gap: 24px;
}

.article-card {
    display: flex;
    gap: 24px;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.article-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transform: translateY(-4px);
    border-color: transparent;
}

.article-img {
    width: 200px;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-img img {
    transform: scale(1.05);
}

.article-info {
    flex: 1;
}

.article-info h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.article-card:hover .article-info h3 {
    color: var(--primary);
}

.article-info p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.article-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.article-date {
    color: var(--text-muted);
    font-size: 13px;
}

.article-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
}

/* 动态列表 */
.news-list {
    display: grid;
    gap: 24px;
}

.news-card {
    display: flex;
    gap: 24px;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.news-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transform: translateY(-4px);
    border-color: transparent;
}

.news-img {
    width: 180px;
    height: 130px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-img img {
    transform: scale(1.05);
}

.news-info {
    flex: 1;
}

.news-tag {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 153, 85, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(255, 153, 85, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 153, 85, 0); }
}

.news-info h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.news-card:hover .news-info h3 {
    color: var(--primary);
}

.news-info p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.news-date {
    color: var(--text-muted);
    font-size: 13px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .page-nav {
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        z-index: 999;
        transform: translateY(-100%);
        opacity: 0;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    }
    
    .page-nav.visible {
        transform: translateY(0);
        opacity: 1;
    }
    
    .page-nav-inner {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 8px 16px;
    }
    
    .page-title {
        font-size: 14px;
        font-weight: 600;
        flex-shrink: 0;
        width: auto;
    }
    
    .community-tabs {
        padding: 4px 0;
        width: 100%;
    }
    
    .tab-btn {
        padding: 8px 16px;
        font-size: 13px;
        flex-shrink: 0;
    }
    
    .community-content {
        padding-top: 30px;
    }
    
    .search-input-wrapper {
        padding: 6px 16px;
    }
    
    .search-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .search-tags {
        gap: 8px;
    }
    
    .search-tag {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .qa-header,
    .qa-answer {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .q-icon,
    .a-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .q-text {
        font-size: 15px;
    }
    
    .article-card,
    .news-card {
        flex-direction: column;
    }
    
    .article-img,
    .news-img {
        width: 100%;
        height: 180px;
    }
}
