* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
}

.cover {
    height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: black;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    position: relative;
}

.cover h1 {
    font-size: clamp(2.5em, 5vw, 4em);
    font-weight: 500;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    text-align: center;
}

.cover p {
    background-color: #e7eef3;
    font-size: clamp(1.1em, 2.5vw, 1.5em);
    margin-bottom: 2.5rem;
    max-width: 1000px;
    line-height: 1.7;
    opacity: 0.95;
    color: #155a8a;
    text-align: center;
}

.cover .cta-button {
    padding: 1.2rem 3rem;
    background: #1f77b4;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.cover .cta-button:hover {
    background: #155a8a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.logo-image {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
    display: block;
    margin-left: 0;
}

.motif-image {
    max-width: 100%;
    height: auto;
    margin-top: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.H_exoresssion-image,
.M_exoresssion-image {
    width: 100%;
    max-height: 700px;
    object-fit: contain;
    margin-top: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}   

.H_ipa-image,
.M_ipa-image,
.H_utrAPA-image,
.M_utrAPA-image{
    width: 100%;
    max-height: 700px;
    object-fit: contain;
    margin-top: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.two-column-container {
    display: flex;
    flex-direction: row;
    gap: 2rem;
}

.left-column,
.right-column {
    flex: 1;
}

.lab-info {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.lab-info p {
    margin: 0.5rem 0;
    font-size: 1em;
    color: #333;
}

.apa-type-container {
    margin-bottom: 2rem;
}

.apa-type-container h3 {
    text-align: left;
    color: #0d0d0e;
    margin-bottom: 1rem;
    font-size: 1.5em;
}

.apa-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.apa-type-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.apa-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.apa-type-card h4 {
    color: #1f77b4;
    margin-bottom: 0.5rem;
    font-size: 1.3em;
}

.apa-type-card p {
    color: #666;
    font-size: 1em;
}

/* Limit APA Type images so they don't become too large on small screens */
.apa-type-card img {
    display: block;
    margin: 0.5rem auto 0;
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 220px; /* prevent excessive height */
    object-fit: contain;
    border-radius: 8px;
}

.filter-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.search-row {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
}

.search-row input {
    flex: 1;
}

.filter-group label {
    font-weight: bold;
    color: #1f77b4;
    margin-bottom: 0.5rem;
    font-size: 1em;
}

.filter-group select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    background: white;
    transition: border-color 0.3s;
}

.filter-group select:focus {
    outline: none;
    border-color: #1f77b4;
}

.search-button {
    padding: 0.75rem 2rem;
    background: #1f77b4;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    align-self: flex-end;
}

.search-button:hover {
    background: #155a8a;
}

.results-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2.5em;
    font-weight: bold;
    color: #1f77b4;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.header p {
    font-size: 1.2em;
    color: #666;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    z-index: 1000;
    border-bottom: 1px solid #e9ecef;
}

.sidebar h2 {
    margin-bottom: 1rem;
    color: #1f77b4;
    display: inline-block;
    margin-right: 2rem;
}

.sidebar ul {
    list-style: none;
    display: inline-block;
}

.sidebar li {
    display: inline-block;
    margin-right: 1rem;
}

.sidebar a {
    display: inline-block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #333;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.sidebar a:hover, .sidebar a.active {
    background-color: #1f77b4;
    color: white;
}

.main-content {
    padding: 2rem;
    padding-top: 5rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.metric-value {
    font-size: 2em;
    font-weight: bold;
    color: #1f77b4;
}

.metric-label {
    color: #666;
    margin-top: 0.5rem;
}

.chart-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.table-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.search-container {
    margin-bottom: 1rem;
}

.search-container input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 100%;
}

.gene-info {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-wrapper {
    position: relative;
    height: 400px;
}

.species-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.species-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.species-card:hover {
    transform: translateY(-5px);
}

.species-image {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
}

.species-img {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
    border-radius: 8px;
    display: none; /* 默认隐藏图片 */
}

.species-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    display: block; /* 默认显示emoji */
}

.human-icon {
    color: #1f77b4;
}

.mouse-icon {
    color: #ff7f0e;
}

.species-card h3 {
    color: #1f77b4;
    margin-bottom: 0.5rem;
    font-size: 1.4em;
}

.species-card p {
    color: #666;
    margin-bottom: 1rem;
}

.species-stats {
    display: flex;
    justify-content: space-around;
    font-weight: bold;
    color: #333;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.metric-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #1f77b4;
    text-align: center;
}

.metric-label {
    text-align: center;
    color: #666;
    margin-top: 0.5rem;
}

/* Charts */
.chart-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.chart-wrapper {
    position: relative;
    height: 400px;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #1f77b4;
}

.timeline-stage {
    font-weight: bold;
    color: #1f77b4;
    margin-bottom: 0.5rem;
}

.timeline-description {
    color: #666;
}

/* Gene Browser */
.search-container {
    margin-bottom: 1rem;
}

.search-container input, .search-container select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 100%;
}

.gene-info {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Tables */
.table-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #1f77b4;
}

.stat-label {
    color: #666;
    margin-top: 0.25rem;
}

/* Heatmap */
.heatmap-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    max-width: 600px;
    margin: 0 auto;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
}

/* Removed mobile media queries to force desktop-style rendering on small screens.
   If later needed, add targeted, conservative rules instead of broad overrides. */

th, td {
    word-wrap: break-word;
}

/* Pagination */
.pagination-btn {
    padding: 0.5rem 1rem;
    background: #1f77b4;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s;
    margin: 0 0.25rem;
}

.pagination-btn:hover:not(:disabled) {
    background: #155a8a;
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#page-info {
    display: inline-block;
    margin: 0 1rem;
    font-weight: bold;
    color: #1f77b4;
}

.gene-list {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.gene-row {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gene-row h4 {
    color: #1f77b4;
    margin-bottom: 0.5rem;
}

.gene-row p {
    margin-bottom: 0.5rem;
}

.gene-row button {
    padding: 0.5rem 1rem;
    background: #1f77b4;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    margin-bottom: 1rem;
}

.gene-row button:hover {
    background: #155a8a;
}

#gene-rows-container .chart-container {
    margin-top: 1rem;
}

/* Download Section Styles */
.download-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.btn-download {
    padding: 0.75rem 1.5rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-download:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn-download:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.download-status {
    font-size: 0.9em;
    font-weight: 500;
}

/* Tools Results Styles */
.tools-results-container {
    margin-top: 2rem;
}

.analysis-complete {
    background: rgba(223, 250, 237, 0.9);
    border: 1px solid #c3e6cb;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.analysis-error {
    background: rgba(253, 236, 234, 0.9);
    border: 1px solid #f5c6cb;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.success-message {
    color: #155724;
    font-weight: bold;
    margin-bottom: 1rem;
}

.error-message {
    color: #721c24;
    font-weight: bold;
    margin-bottom: 1rem;
}

.command-display {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 1rem;
    margin: 1rem 0;
}

.command-display h4 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.command-display pre {
    margin: 0;
    font-size: 0.9em;
    color: #495057;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 5px;
    overflow: hidden;
}

.results-table th, .results-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.results-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.output-files-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 5px;
    overflow: hidden;
}

.output-files-table th, .output-files-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.output-files-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.download-commands {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 1rem;
    margin: 1rem 0;
}

.download-commands h4 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.download-commands ul {
    margin: 0.5rem 0 0 1.5rem;
}

.download-commands code {
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.loading-indicator {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
}

.loading-spinner {
    font-size: 1.2em;
    color: #1f77b4;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.error-details {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 1rem;
    margin: 1rem 0;
}

.error-details h4 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.error-details pre {
    margin: 0;
    font-size: 0.9em;
    color: #495057;
}

.note {
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
}

.gene-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.gene-table th, .gene-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.gene-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* APA Dynamics Images */
.apa-dynamics-images {
    margin-top: 1rem;
}

.apa-dynamics-images.side-by-side {
    display: flex;
    gap: 1rem;
    justify-content: space-around;
}

.apa-dynamics-images.side-by-side img {
    flex: 1;
    max-width: 40%;
    height: auto;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.apa-dynamics-images.centered {
    display: flex;
    justify-content: center;
}

.apa-dynamics-images.centered img {
    max-width: 40%;
    height: auto;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

