/**
 * 全民基因健康 - 自定义样式
 * 从HTML模板提取，保持100%一致
 *
 * @package Gene_Health
 * @version 1.0.0
 */

/* ========================================
   基础样式
   ======================================== */
body { 
    font-family: 'Noto Sans SC', system-ui, -apple-system, sans-serif; 
    background-color: #F8FAFC;
    color: #1F2937;
}

/* ========================================
   导航栏样式
   ======================================== */
.nav-link { 
    position: relative; 
    white-space: nowrap; 
}

.nav-link::after {
    content: ''; 
    position: absolute; 
    width: 0; 
    height: 2px; 
    bottom: -2px; 
    left: 0;
    background-color: #2563EB; 
    transition: width 0.3s ease;
}

.nav-link:hover::after { 
    width: 100%; 
}

/* ========================================
   卡片悬停微交互
   ======================================== */
.hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ========================================
   搜索框聚焦光晕
   ======================================== */
.search-input:focus-within {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
    border-color: #3B82F6;
}

/* ========================================
   分类激活态
   ======================================== */
.category-active {
    background-color: #EFF6FF;
    color: #2563EB;
    font-weight: 600;
    border-right: 3px solid #2563EB;
}

/* ========================================
   文章卡片交互
   ======================================== */
.article-card {
    transition: all 0.2s ease;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ========================================
   问答卡片交互
   ======================================== */
.qa-card {
    transition: all 0.2s ease;
}

.qa-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #BFDBFE;
}

/* ========================================
   文章正文排版优化
   ======================================== */
.article-content { 
    font-size: 1.05rem; 
    line-height: 1.8; 
    color: #334155; 
}

.article-content h2 { 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: #1E293B; 
    margin-top: 2.5rem; 
    margin-bottom: 1rem; 
    border-left: 4px solid #2563EB; 
    padding-left: 1rem; 
}

.article-content h3 { 
    font-size: 1.25rem; 
    font-weight: 600; 
    color: #1E293B; 
    margin-top: 2rem; 
    margin-bottom: 0.75rem; 
}

.article-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1E293B;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-content p { 
    margin-bottom: 1.5rem; 
    text-align: justify; 
}

.article-content ul { 
    list-style-type: disc; 
    padding-left: 1.5rem; 
    margin-bottom: 1.5rem; 
}

.article-content ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.article-content li { 
    margin-bottom: 0.5rem; 
}

.article-content strong { 
    color: #0F172A; 
    font-weight: 600; 
}

.article-content blockquote { 
    background: #F1F5F9; 
    border-left: 4px solid #94A3B8; 
    padding: 1rem; 
    margin-bottom: 1.5rem; 
    font-style: italic; 
    color: #475569; 
    border-radius: 0 0.5rem 0.5rem 0; 
}

.article-content img { 
    max-width: 100%; 
    border-radius: 0.5rem; 
    margin: 2rem auto; 
    display: block; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); 
}

.article-content a {
    color: #2563EB;
    text-decoration: underline;
}

.article-content a:hover {
    color: #1D4ED8;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.article-content th,
.article-content td {
    border: 1px solid #E2E8F0;
    padding: 0.75rem 1rem;
    text-align: left;
}

.article-content th {
    background-color: #F8FAFC;
    font-weight: 600;
}

.article-content pre {
    background: #1E293B;
    color: #E2E8F0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
}

.article-content code {
    background: #F1F5F9;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
}

.article-content pre code {
    background: transparent;
    padding: 0;
}

/* ========================================
   目录吸顶
   ======================================== */
.sticky-toc { 
    position: sticky; 
    top: 6rem; 
    max-height: calc(100vh - 8rem); 
    overflow-y: auto; 
}

/* ========================================
   侧边栏卡片交互
   ======================================== */
.sidebar-card {
    transition: all 0.2s ease;
}

.sidebar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ========================================
   搜索高亮
   ======================================== */
.highlight {
    background-color: #FEF08A;
    color: #854D0E;
    padding: 0 2px;
    border-radius: 2px;
}

/* ========================================
   筛选Tab激活
   ======================================== */
.filter-tab.active {
    color: #2563EB;
    border-bottom: 2px solid #2563EB;
    font-weight: 700;
}

/* ========================================
   专家卡片
   ======================================== */
.expert-card {
    transition: all 0.3s ease;
}

.expert-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ========================================
   流程步骤
   ======================================== */
.process-step {
    position: relative;
}

.process-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 2rem;
    left: 50%;
    width: 100%;
    height: 2px;
    background-color: #E5E7EB;
    z-index: 0;
}

@media (max-width: 768px) {
    .process-step:not(:last-child)::after {
        display: none;
    }
}

/* ========================================
   标签详情页特有样式
   ======================================== */
.tag-hero-pattern {
    background-color: #ffffff;
    background-image: radial-gradient(#E2E8F0 1px, transparent 1px);
    background-size: 20px 20px;
}

.content-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ========================================
   标签样式
   ======================================== */
.tag-pill {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.tag-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 标签颜色变体 */
.tag-hot { 
    background-color: #FEF2F2; 
    color: #DC2626; 
    border-color: #FEE2E2; 
    font-weight: 700; 
    font-size: 1rem; 
}

.tag-hot:hover { 
    background-color: #DC2626; 
    color: white; 
    border-color: #DC2626; 
}

.tag-blue { 
    background-color: #EFF6FF; 
    color: #2563EB; 
    border-color: #DBEAFE; 
}

.tag-blue:hover { 
    background-color: #2563EB; 
    color: white; 
    border-color: #2563EB; 
}

.tag-green { 
    background-color: #F0FDF4; 
    color: #16A34A; 
    border-color: #DCFCE7; 
}

.tag-green:hover { 
    background-color: #16A34A; 
    color: white; 
    border-color: #16A34A; 
}

.tag-pink { 
    background-color: #FDF2F8; 
    color: #DB2777; 
    border-color: #FCE7F3; 
}

.tag-pink:hover { 
    background-color: #DB2777; 
    color: white; 
    border-color: #DB2777; 
}

.tag-gray { 
    background-color: #F3F4F6; 
    color: #4B5563; 
    border-color: #E5E7EB; 
}

.tag-gray:hover { 
    background-color: #4B5563; 
    color: white; 
    border-color: #4B5563; 
}

/* ========================================
   专家回答样式
   ======================================== */
.expert-answer {
    background-color: #F0F9FF;
    border: 1px solid #BAE6FD;
    position: relative;
}

.expert-badge {
    background: linear-gradient(90deg, #2563EB, #1D4ED8);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* ========================================
   404页面 DNA动画
   ======================================== */
.dna-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* ========================================
   移动端咨询栏空间
   ======================================== */
@media (max-width: 767px) {
    body {
        padding-bottom: 56px;
    }
}

/* ========================================
   加载动画
   ======================================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #E2E8F0;
    border-radius: 50%;
    border-top-color: #2563EB;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   工具提示
   ======================================== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: #1E293B;
    color: #fff;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   滚动条样式
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F1F5F9;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ========================================
   选中文字样式
   ======================================== */
::selection {
    background: #BFDBFE;
    color: #1E40AF;
}

/* ========================================
   焦点样式（无障碍）
   ======================================== */
:focus-visible {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}

/* ========================================
   隐藏滚动条
   ======================================== */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ========================================
   打印样式
   ======================================== */
@media print {
    header, footer, .sidebar, .mobile-consult-bar {
        display: none !important;
    }
    
    .article-content {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ========================================
   个人中心 & 专家主页样式
   ======================================== */

/* 侧边栏菜单激活态 */
.menu-item.active {
    background-color: #EFF6FF;
    color: #2563EB;
    border-left: 3px solid #2563EB;
    font-weight: 600;
}

/* Tab 激活样式 */
.tab-active {
    border-bottom: 2px solid #2563EB;
    color: #2563EB;
    font-weight: 700;
}

/* 专家主页封面 */
.profile-cover {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    height: 160px;
}

/* 用户等级徽章 */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.level-badge.lv1 {
    background-color: #F3F4F6;
    color: #6B7280;
}

.level-badge.lv2 {
    background-color: #DBEAFE;
    color: #2563EB;
}

.level-badge.lv3 {
    background-color: #D1FAE5;
    color: #059669;
}

.level-badge.lv4 {
    background-color: #FEF3C7;
    color: #D97706;
}

.level-badge.lv5 {
    background-color: #EDE9FE;
    color: #7C3AED;
}

/* 认证徽章 */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: #FEF3C7;
    color: #D97706;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #FDE68A;
}

/* 统计数字动画 */
.stat-number {
    transition: transform 0.3s ease;
}

.stat-number:hover {
    transform: scale(1.1);
}

/* 订阅标签样式 */
.subscription-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background-color: #EFF6FF;
    color: #2563EB;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #BFDBFE;
    transition: all 0.2s ease;
}

.subscription-tag:hover {
    background-color: #DBEAFE;
}

.subscription-tag .remove-btn {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.subscription-tag .remove-btn:hover {
    opacity: 1;
}

/* 专家关注按钮 */
.follow-btn {
    transition: all 0.2s ease;
}

.follow-btn.following {
    background-color: #EFF6FF;
    color: #2563EB;
    border-color: #BFDBFE;
}

.follow-btn.following:hover {
    background-color: #FEE2E2;
    color: #DC2626;
    border-color: #FECACA;
}

/* 问题状态标签 */
.question-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.question-status.expert-replied {
    background-color: #D1FAE5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.question-status.waiting {
    background-color: #F3F4F6;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

.question-status.answered {
    background-color: #DBEAFE;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}

/* 分页样式 */
.gene-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.gene-pagination li {
    display: inline-block;
}

.gene-pagination a,
.gene-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #64748B;
    text-decoration: none;
    transition: all 0.2s ease;
}

.gene-pagination a:hover {
    background-color: #F1F5F9;
    border-color: #CBD5E1;
    color: #334155;
}

.gene-pagination .current {
    background-color: #2563EB;
    border-color: #2563EB;
    color: white;
}

/* 加载更多按钮 */
.gene-load-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: transparent;
    color: #2563EB;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gene-load-more:hover {
    background-color: #EFF6FF;
}

.gene-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gene-load-more.loading::before {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #BFDBFE;
    border-radius: 50%;
    border-top-color: #2563EB;
    animation: spin 1s linear infinite;
}

/* 空状态样式 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: #94A3B8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 0.875rem;
}

.empty-state a {
    color: #2563EB;
}

.empty-state a:hover {
    text-decoration: underline;
}
