/* 引入字体 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@600;700&display=swap');

:root {
    --primary-pink: #E91E63;
    --hover-pink: #C2185B;
    --text-dark: #212529;  /* 深黑 */
    --text-muted: #6c757d; /* 灰 */
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}



/* 1. 导航栏 (浅色风格) */
.navbar-light {
    background: rgba(255, 255, 255, 0.30); /* 半透明白 */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.text-pink { color: var(--primary-pink) !important; }

/* --- 全局样式修复 --- */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    color: var(--text-dark);
    /* 核心修改：背景图移到 body，并设置固定 */
    background: url('../images/background.png') no-repeat center center fixed;
    background-size: cover;
    /* 关键：给 body 一个白色渐变遮罩，模拟底部变白的效果 */
    /* 这是一个伪元素技巧，写在下面 */
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 创建一个覆盖全屏的白色渐变遮罩 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 从上到下：透明 -> 半透明白 -> 纯白 */
    background: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.6) 80%, #ffffff 100%);
    z-index: -1; /* 放在内容下面，背景图上面 */
    pointer-events: none; /* 让鼠标能穿透它点击内容 */
}

/* Hero Section 现在只需要负责布局，不需要管背景了 */
.hero-section {
    background: transparent; /* 透明 */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}


.hero-title {
    font-weight: 700;
    color: var(--text-dark);
    text-shadow: 0 2px 10px rgba(255,255,255,0.8); /* 白色光晕，防背景干扰 */
}

.hero-subtitle {
    font-weight: 500;
    color: var(--text-dark);
    opacity: 0.85;
}

/* 3. 搜索框组件 (带阴影的白盒子) */
.search-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    padding: 6px; /* 稍微减小内边距 */
    padding-right: 6px; /* 确保右边有一点点空隙给按钮 */
    width: 100%;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center; /* 垂直居中 */
    justify-content: space-between; /* 两端对齐 */
    border: 1px solid rgba(0,0,0,0.05);
}

.search-type-select select {
    border-radius: 50px 0 0 50px;
    padding-left: 20px;
    height: 50px; /* 固定高度 */
    background-color: transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dark);
    border: none; /* 去掉边框 */
}
.search-type-select select:focus {
    box-shadow: none;
    background-color: #f8f9fa;
}

.btn-search {
    background-color: var(--primary-pink);
    color: white;
    border-radius: 50px;
    width: 50px;
    height: 50px;
    flex-shrink: 0; /* 防止按钮被挤扁 */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto; /* 关键：这会把它强行推到最右边 */
    transition: all 0.3s;
}
.btn-search:hover {
    background-color: var(--hover-pink);
    transform: scale(1.05);
    color: white;
}

/* 4. 工具卡片区 */
.tools-section {
    margin-top: 40px; /* 不需要负边距了，因为现在都在 hero-section 里面 */
    position: relative;
    z-index: 10;
    background: transparent; /* 确保透明 */
}

.tool-card {
    background: rgba(255, 255, 255, 0.65); /* 95% 不透明白 */
    border: none;/* 极淡的边框 */
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow);
    border-color: transparent;
}

/* 快速链接 */
.quick-links span {
    color: var(--text-muted) !important;
    font-weight: 500;
}
.quick-links .badge {
    background-color: rgba(255,255,255,0.8);
    border: 1px solid #dee2e6;
    color: var(--text-dark) !important;
}
.quick-links .badge:hover {
    background-color: var(--primary-pink) !important;
    color: white !important;
    border-color: var(--primary-pink);
}
.quick-links .badge:hover i {
    color: white !important;
}

/* 图标背景圆圈 */
.icon-box {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.8rem;
    transition: transform 0.3s;
}

/* --- 页脚 (白色半透明蒙板风格) --- */
.footer {
    
    color: #6c757d; /* 灰色文字 */
    text-align: center;
    padding: 20px 0;
    
    /* 布局控制：如果希望它固定在视口底部（内容少时） */
    margin-top: auto; 
    width: 100%;
}

/* 链接样式：继承颜色，不显示蓝色 */
.footer a {
    color: inherit; /* 继承父元素的灰色 */
    text-decoration: none; /* 去掉下划线 */
    font-weight: 600;
    transition: opacity 0.3s;
}

.footer a:hover {
    opacity: 0.7; /* 悬停时稍微变淡，而不是变蓝 */
    text-decoration: underline;
}

/* 彩蛋链接 (Easter Egg) 保持原样 */
.easter-egg {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
.easter-egg:hover {
    opacity: 0.8;
}

/* 辅助色背景 - 保持不变 */
.bg-pink-light { background-color: #fce4ec; }
.bg-blue-light { background-color: #e3f2fd; }
.bg-purple-light { background-color: #f3e5f5; }
.bg-green-light { background-color: #e8f5e9; }
.bg-orange-light { background-color: #fff3e0; }
.bg-red-light { background-color: #ffebee; }
.bg-teal-light { background-color: #e0f2f1; }
.bg-gray-light { background-color: #f5f5f5; }

/* 分页样式覆盖 Bootstrap 默认蓝 */
.pagination .page-link {
    color: var(--primary-pink);
    border: none;
    margin: 0 5px;
    border-radius: 5px;
    font-weight: 600;
}

.pagination .page-link:hover {
    background-color: #fce4ec;
    color: var(--hover-pink);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-pink);
    color: white;
    border-color: var(--primary-pink);
}

.pagination .page-item.disabled .page-link {
    color: #ccc;
    background-color: transparent;
}

/* --- 基因详情页样式优化 --- */

/* 1. 头部信息区：保持原样 (透明背景，左右布局) */
.gene-header-section {
    background: transparent; /* 关键：透明背景 */
    box-shadow: none;        /* 去掉阴影 */
    padding: 0;              /* 去掉内边距 */
    margin-bottom: 40px;     /* 与下方导航栏的距离 */
}

/* 2. 中间导航栏 (Tab) */
.gene-nav-tabs {
    border: none;
    margin-bottom: 0; /* 紧贴下方内容卡片 */
    display: flex;
    justify-content: center; /* 居中显示 */
    gap: 15px;
    padding-bottom: 20px;
}

.gene-nav-tabs .nav-link {
    border: none;
    background-color: rgba(255, 255, 255, 0.5); /* 半透明白底按钮 */
    color: var(--text-dark);
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.gene-nav-tabs .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    color: var(--primary-pink);
}

.gene-nav-tabs .nav-link.active {
    background-color: var(--primary-pink) !important;
    color: white !important;
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.3);
}

/* 3. 底部内容卡片 (白色大卡片) */
.tab-content-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px 20px; /* 减小顶部内边距 */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    min-height: 600px; /* 从 600px 减小到 400px */
    position: relative;
}

/* 序列框样式优化 */
.seq-box {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-all;
    color: #333;
}

/* --- Basic Info 美化样式 --- */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 响应式网格 */
    gap: 20px;
}

.info-item {
    background-color: #f8f9fa; /* 极浅灰背景 */
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.info-item:hover {
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: var(--primary-pink);
    transform: translateY(-3px);
}

.info-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background-color: rgba(233, 30, 99, 0.1); /* 浅粉色背景 */
    color: var(--primary-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.info-content h6 {
    color: #6c757d;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-bottom: 5px;
    font-weight: 700;
}

.info-content p {
    color: #212529;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0;
}

/* 同源基因表格样式 */
.ortholog-table td {
    vertical-align: middle;
}
.ortholog-badge {
    cursor: pointer;
    transition: all 0.2s;
}
.ortholog-badge:hover {
    background-color: var(--hover-pink) !important;
    transform: scale(1.05);
}

/* --- 1. 定义紫色家族标签样式 --- */
.bg-purple-light {
    background-color: rgba(156, 39, 176, 0.1) !important; /* 浅紫色透明背景 */
}
.text-purple {
    color: #7b1fa2 !important; /* 深紫色文字，保证清晰度 */
}
.border-purple {
    border: 1px solid rgba(156, 39, 176, 0.3) !important;
}




.gene-title-text {
    font-size: 2.8rem;
    font-weight: 800;
    color: #212529;
    /* 核心修改：允许换行并限制最大宽度 */
    word-break: break-all; 
    white-space: normal;   /* 确保它能换行 */
    line-height: 1.1;
    display: inline-block;
    max-width: 100%;       /* 限制在父容器内 */
}

/* 图标大小锁定 */
.gene-title-icon {
    font-size: 3rem;
    flex-shrink: 0; /* 禁止图标被压缩 */
}

/* 按钮文字禁止换行 */
.header-buttons-wrapper .btn {
    white-space: nowrap;
}

/* 按钮容器：绝对禁止缩小 */
.header-buttons-wrapper {
    display: flex;
    gap: 15px;
    flex-shrink: 0;      /* 核心修复：强制禁止按钮被挤小 */
    align-items: center;
}

/* 针对按钮的微调，确保它们整齐 */
.header-buttons-wrapper .btn {
    white-space: nowrap; /* 强制按钮内的文字不换行 */
    height: fit-content;
}



/* 调整 DNA 图标大小以适应两行文字 */
.gene-title-icon {
    font-size: 3.5rem;
    color: var(--primary-pink);
    opacity: 0.9;
}

/* 描述信息的左边框，现在跨度可以更长，更有设计感 */
.gene-desc {
    font-size: 1.2rem;
    color: #6c757d;
    border-left: 4px solid var(--primary-pink);
    padding-left: 15px;
    margin-left: 2px;
}

/* 1. 将黄蓝按钮下移并微调 */
.header-buttons-wrapper {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
    align-items: center;
    /* 核心修改：下移 35px，使其大约与描述信息平行 */
    margin-top: 40px; 
}

/* 2. 酶切位点结果展示样式 */
.enzyme-table {
    font-size: 0.95rem;
}
.enzyme-site {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #2c3e50;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
}
.cut-pos {
    color: var(--primary-pink);
    font-weight: 600;
}

/* --- 翻页按钮美化 --- */
.btn-group-pagination {
    background: rgba(255, 255, 255, 0.8);
    padding: 5px;
    border-radius: 50px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.btn-group-pagination .btn {
    border: none !important;
    border-radius: 50px !important;
    padding: 6px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

/* 上一页/下一页按钮 */
.btn-group-pagination .btn-outline-secondary {
    color: var(--text-dark);
}

.btn-group-pagination .btn-outline-secondary:hover {
    background-color: var(--primary-pink);
    color: white;
}

/* 中间页码显示 */
.btn-group-pagination .btn-light.disabled {
    background: transparent;
    color: var(--primary-pink);
    opacity: 1;
    border: none;
}

/* --- 专业级注释标签 (Professional Tags) --- */
/* --- 1. 左侧小图标容器 --- */
.icon-square {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px; /* 圆角矩形 */
    font-size: 0.9rem;
}
.bg-blue-soft { background-color: rgba(13, 110, 253, 0.1); }
.bg-orange-soft { background-color: rgba(255, 193, 7, 0.1); }
.bg-green-soft { background-color: rgba(25, 135, 84, 0.1); }


/* --- 2. 核心：柔和胶囊标签 (Pill Badges) --- */
/* 这是去掉割裂感的关键：不要边框，只要背景色 */
.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;      /* 稍微宽一点 */
    font-size: 0.85rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; /* 等宽字体 */
    font-weight: 600;
    border-radius: 50rem;   /* 完全圆角 (Pill shape) */
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
}

.badge-pill:hover {
    transform: translateY(-1px);
    text-decoration: none;
    filter: brightness(0.95); /* 悬停稍微变暗 */
}

/* 蓝色系 (GO) */
.pill-blue {
    background-color: #e7f1ff; /* 非常淡的蓝 */
    color: #0c63e4;            /* 深蓝字 */
}

/* 橙色系 (KEGG) */
.pill-orange {
    background-color: #fff3cd; /* 淡黄 */
    color: #856404;            /* 深褐字 */
}

/* 绿色系 (Pfam) */
.pill-green {
    background-color: #d1e7dd; /* 淡绿 */
    color: #0f5132;            /* 深绿字 */
}

/* 调整左侧描述文字的缩进，使其与图标右侧对齐，更整齐 */
.ps-5 {
    padding-left: 2.75rem !important; /* 根据图标宽度微调 */
}

/* 美化复选框为胶囊按钮 */
.species-selector-item {
    position: relative;
}

/* 隐藏原始 checkbox */
.species-selector-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* 自定义 Label 样式 */
.species-selector-item label {
    display: inline-block;
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 50rem; /* 胶囊圆角 */
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

/* 悬停效果 */
.species-selector-item label:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

/* 选中状态 */
.species-selector-item input[type="checkbox"]:checked + label {
    background-color: #E91E63; /* Rosa Pink */
    color: white;
    border-color: #E91E63;
    box-shadow: 0 4px 6px rgba(233, 30, 99, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* --- Logo 放大不撑开导航栏 --- */

/* 1. 稍微减小导航栏上下的内边距 (Bootstrap 默认是 py-2) */
.navbar {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    /* 强制固定导航栏高度，防止抖动 (可选，根据你实际需求) */
    height: 70px; 
}

/* 2. Logo 样式 */
.nav-logo {
    /* 现在的 40px 太小，我们改成 55px 或 60px */
    height: 58px; 
    width: auto; /* 保持比例 */
    
    /* 【核心技巧】使用负边距 */
    /* 让图片向上下“溢出”，不占用文档流的高度 */
    margin-top: -10px; 
    margin-bottom: -10px;
    
    /* 确保图片在最上层，不会被遮挡 */
    position: relative;
    z-index: 100;
    
    /* 增加一点阴影让大 Logo 更立体 (可选) */
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}

/* 3. 调整文字位置 */
/* 因为 Logo 变大了，旁边的 RosaGeno 文字需要垂直居中 */
.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem; /* 文字也可以稍微大一点 */
}

/* 修改 .viz-col 样式 */
        .viz-col { 
            flex-grow: 1; 
            padding: 0 15px; 
            /* 【新增】设置最小宽度，防止挤压，内容多时会出现横向滚动条 */
            min-width: 450px; 
        }
        
        /* 增加绘图区容器的横向滚动能力 */
        .d-flex.w-100 {
            overflow-x: auto;
            padding-bottom: 10px; /* 给滚动条留点位置 */
        }