/* ============================================
   ConStory-Bench - Clean & Professional Style
   Inspired by SWEBench and EQBench aesthetics
   ============================================ */

/* ============================================
   1. Reset & Base
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Clean Color Palette - Light Mode */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-hover: #f3f4f6;
    
    --border-color: #e5e7eb;
    --border-hover: #d1d5db;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Typography */
    --font-family: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', 'Arial', sans-serif;
    --font-calibri: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', 'Arial', sans-serif;
    --font-numbers: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Transitions */
    --transition: 150ms ease;
}

/* Dark Mode */
body.dark-mode {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-hover: #374151;
    
    --border-color: #374151;
    --border-hover: #4b5563;
}

body.dark-mode {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

body.dark-mode .navbar {
    background: var(--bg-primary);
    border-bottom-color: var(--border-color);
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 2px 16px rgba(0, 0, 0, 0.3),
        0 1px 8px rgba(0, 0, 0, 0.2);
}

body.dark-mode .filter-group {
    background: rgba(31, 41, 55, 0.6);
    border-color: rgba(75, 85, 99, 0.8);
}

body.dark-mode .leaderboard-table thead {
    background: #374151;
    border-bottom-color: #4b5563;
}

body.dark-mode .leaderboard-table tbody tr:nth-child(odd) {
    background: #1f2937;
}

body.dark-mode .leaderboard-table tbody tr:nth-child(even) {
    background: #111827;
}

body.dark-mode .leaderboard-table tbody tr:hover {
    background: #374151;
}

body.dark-mode .progress-bar {
    background: linear-gradient(to bottom, #374151, #1f2937);
}

body.dark-mode .github-link {
    background: #f9fafb;
    color: #111827 !important;
}

body.dark-mode .github-link svg {
    color: #111827;
    fill: #111827;
}

body.dark-mode .github-link:hover {
    background: #e5e7eb;
    color: #000000 !important;
}

body.dark-mode .github-link:hover svg {
    color: #000000;
    fill: #000000;
}

body.dark-mode .btn-secondary {
    background: #f9fafb;
    color: #111827;
    border-color: #e5e7eb;
}

body.dark-mode .btn-secondary:hover {
    background: #e5e7eb;
    color: #000000;
}

html {
    font-size: 16.25px;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: min(92%, 1360px);
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: var(--spacing-xl) 0;
}

/* ============================================
   2. Navigation
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.12),
        0 2px 12px rgba(0, 0, 0, 0.08),
        0 1px 6px rgba(0, 0, 0, 0.06);
    z-index: 1000;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    min-height: 110px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    text-decoration: none;
}

.logo-img {
    width: 96px;
    height: 96px;
    border-radius: 8px;
}

.logo-text {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
    transition: all 0.2s ease;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: #f3f4f6;
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--primary-color);
    background: #eff6ff;
}

.github-link {
    background: var(--text-primary);
    color: white !important;
    padding: 0.5rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.github-link:hover {
    background: #1f2937;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.github-link:hover {
    background: var(--text-secondary);
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    position: relative;
}

.theme-toggle:hover {
    background: #f3f4f6;
    color: var(--text-primary);
    transform: translateY(-1px);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    transition: all 0.3s ease;
}

.theme-toggle .moon-icon {
    display: none;
}

/* Dark mode active state */
body.dark-mode .theme-toggle .sun-icon {
    display: none;
}

body.dark-mode .theme-toggle .moon-icon {
    display: block;
}

.mobile-menu-toggle {
    display: none;
}

/* ============================================
   3. Page Content System
   ============================================ */
.page-content {
    display: none;
    padding-top: 120px;
    min-height: calc(100vh - 100px);
}

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

/* Override for Overview page with paper layout */
#page-overview.page-content {
    padding-top: 120px;
    padding-left: 0;
    padding-right: 0;
    background: #f5f7fa;
}

#page-overview.page-content.active {
    display: block;
}

/* ============================================
   4. Hero Section
   ============================================ */
.hero {
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-bottom: var(--spacing-xl);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font-family);
}

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

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

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

/* ============================================
   5. Section Headers
   ============================================ */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.leaderboard-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.section-description {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* ============================================
   6. About Section
   ============================================ */
.about {
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.about-card {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.about-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.about-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ============================================
   7. Categories Section
   ============================================ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.category-card {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.category-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.category-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ============================================
   8. Leaderboard
   ============================================ */
.leaderboard {
    background: var(--bg-secondary);
}

.leaderboard-controls {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.filter-group {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-family);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.filter-btn:hover::before {
    opacity: 1;
}

.filter-btn:hover {
    background: rgba(243, 244, 246, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(0);
}

.filter-btn.active::before {
    opacity: 0;
}

.filter-btn:active {
    transform: translateY(0) scale(0.98);
}

.leaderboard .table-container {
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: hidden;
    max-width: 100%;
    margin: 0 auto;
}

.leaderboard .container {
    width: min(98%, 1760px);
    max-width: 1760px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 0;
}

.leaderboard-table thead {
    background: #5c5652;
    border-bottom: 2px solid #4a4440;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 10;
}

.leaderboard-table th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.84rem;
    color: #ffffff;
    text-transform: capitalize;
    letter-spacing: 0.05em;
    font-family: var(--font-calibri);
    white-space: nowrap;
    vertical-align: middle;
    position: relative;
}

.leaderboard-table th.sortable,
.leaderboard-table th.sortable-grr {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    position: relative;
    padding-right: 2rem;
}

.leaderboard-table th.sortable:hover,
.leaderboard-table th.sortable-grr:hover {
    background: #6a6561;
}

/* Sort indicators */
.leaderboard-table th.sortable::after,
.leaderboard-table th.sortable-grr::after {
    content: '⬍';
    position: absolute;
    right: 0.5rem;
    opacity: 0.3;
    font-size: 0.75rem;
    transform: rotate(90deg);
    display: inline-block;
}

.leaderboard-table th.sortable.sort-desc::after,
.leaderboard-table th.sortable-grr.sort-desc::after {
    content: '⬇';
    opacity: 1;
    transform: rotate(0deg);
}

.leaderboard-table th.sortable.sort-asc::after,
.leaderboard-table th.sortable-grr.sort-asc::after {
    content: '⬆';
    opacity: 1;
    transform: rotate(0deg);
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table tbody tr:hover {
    background: var(--bg-secondary);
}

.leaderboard-table tbody tr:last-child {
    border-bottom: none;
}

/* Zebra striping - alternating white and light gray backgrounds */
.leaderboard-table tbody tr {
    transition: all 0.2s ease;
}

.leaderboard-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.leaderboard-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.leaderboard-table tbody tr:hover {
    background: #e8eef5;
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.leaderboard-table td {
    padding: 0.52rem 0.5rem;
    font-size: 0.84rem;
    font-family: var(--font-calibri);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-col {
    width: 5%;
    text-align: center !important;
    vertical-align: middle;
}

/* Rank column header alignment */
.leaderboard-table th.rank-col {
    text-align: center !important;
    vertical-align: middle;
}

.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: var(--font-calibri);
}

.rank-1 {
    background: #fef3c7;
    color: #92400e;
}

.rank-2 {
    background: #e5e7eb;
    color: #374151;
}

.rank-3 {
    background: #fecaca;
    color: #991b1b;
}

.rank-other {
    background: transparent;
    color: var(--text-muted);
}

.model-col {
    width: 18%;
}

.model-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font-calibri);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-col {
    width: 12%;
}

.org-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.org-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

.org-name {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: var(--font-calibri);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-col {
    width: 10.5%;
    text-align: center !important;
    vertical-align: middle;
}

.overall-col {
    width: 10%;
    text-align: center;
    vertical-align: middle;
}

/* Overall column header alignment */
.leaderboard-table th.overall-col {
    text-align: center;
    vertical-align: middle;
}

/* Score column header alignment */
.leaderboard-table th.score-col {
    text-align: center !important;
    vertical-align: middle;
}

.score {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: var(--font-calibri);
    display: inline-block;
    text-align: center;
}

.score-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: linear-gradient(to bottom, #f3f4f6, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.progress-fill {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    position: relative;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 8px 8px 0 0;
}

/* Rank-based progress bar colors - soft elegant gradients with low saturation */
.progress-fill.rank-1 { 
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 50%, #f87171 100%);
}
.progress-fill.rank-2 { 
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 50%, #fb923c 100%);
}
.progress-fill.rank-3 { 
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fcd34d 100%);
}
.progress-fill.rank-4 { 
    background: linear-gradient(135deg, #ecfccb 0%, #d9f99d 50%, #bef264 100%);
}
.progress-fill.rank-5 { 
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 50%, #6ee7b7 100%);
}
.progress-fill.rank-6 { 
    background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 50%, #5eead4 100%);
}
.progress-fill.rank-7 { 
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 50%, #93c5fd 100%);
}
.progress-fill.rank-8 { 
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 50%, #a5b4fc 100%);
}
.progress-fill.rank-9 { 
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 50%, #c4b5fd 100%);
}
.progress-fill.rank-10 { 
    background: linear-gradient(135deg, #fae8ff 0%, #f5d0fe 50%, #f0abfc 100%);
}
.progress-fill.rank-11 { 
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 50%, #f9a8d4 100%);
}
.progress-fill.rank-12 { 
    background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 50%, #fda4af 100%);
}
.progress-fill.rank-13 { 
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 50%, #fdba74 100%);
}
.progress-fill.rank-14 { 
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 50%, #fde047 100%);
}
.progress-fill.rank-15 { 
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 50%, #fef08a 100%);
}
.progress-fill.rank-16 { 
    background: linear-gradient(135deg, #f7fee7 0%, #ecfccb 50%, #d9f99d 100%);
}
.progress-fill.rank-17 { 
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 50%, #86efac 100%);
}
.progress-fill.rank-18 { 
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 50%, #6ee7b7 100%);
}
.progress-fill.rank-19 { 
    background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 50%, #5eead4 100%);
}
.progress-fill.rank-20 { 
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 50%, #67e8f9 100%);
}
.progress-fill.rank-21 { 
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 50%, #7dd3fc 100%);
}
.progress-fill.rank-22 { 
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 50%, #93c5fd 100%);
}
.progress-fill.rank-23 { 
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 50%, #a5b4fc 100%);
}
.progress-fill.rank-24 { 
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 50%, #c4b5fd 100%);
}
.progress-fill.rank-25 { 
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 50%, #d8b4fe 100%);
}
.progress-fill.rank-26 { 
    background: linear-gradient(135deg, #fae8ff 0%, #f5d0fe 50%, #f0abfc 100%);
}
.progress-fill.rank-27 { 
    background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 50%, #f5d0fe 100%);
}
.progress-fill.rank-28 { 
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 50%, #f9a8d4 100%);
}
.progress-fill.rank-29 { 
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 50%, #fecdd3 100%);
}
.progress-fill.rank-default { 
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 50%, #d1d5db 100%);
}

/* score-high, score-medium, score-low classes removed - all scores now use black color */

.length-col {
    width: 8.5%;
    text-align: center !important;
    vertical-align: middle;
    font-family: var(--font-calibri);
}

/* Length column header alignment */
.leaderboard-table th.length-col {
    text-align: center !important;
    vertical-align: middle;
}

.length-value {
    font-family: var(--font-calibri);
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
    display: inline-block;
    text-align: center;
}

.leaderboard-note {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   9. Submit Section
   ============================================ */
.submit-content {
    max-width: 700px;
    margin: 0 auto;
}

.submit-card {
    background: var(--bg-primary);
    padding: var(--spacing-xl);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.submit-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.submit-card ol {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.submit-card li {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

/* ============================================
   10. Paper Section
   ============================================ */
.paper-placeholder {
    text-align: center;
    padding: var(--spacing-xl);
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* ============================================
   11. Footer
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-lg) 0;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   12. Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
    }
    
    .mobile-menu-toggle span {
        width: 24px;
        height: 2px;
        background: var(--text-primary);
    }
    
    .hero-title {
        font-size: 2rem;
        white-space: normal;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .filter-group {
        flex-wrap: wrap;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .leaderboard-table {
        font-size: 0.8125rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 1480px) {
    .leaderboard .table-container {
        overflow-x: auto;
    }

    .leaderboard-table {
        min-width: 1380px;
        table-layout: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .logo-img {
        width: 72px;
        height: 72px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
        white-space: normal;
    }
}

.paper-layout {
    display: flex !important;
    gap: 1.5rem;
    max-width: 1680px;
    margin: 0 auto !important;
    padding: 1.5rem 1.25rem !important;
    min-height: calc(100vh - 80px);
    background: #f5f7fa !important;
    position: relative;
    width: 100%;
    justify-content: center;
    align-items: flex-start;
}

/* Sidebar Navigation */
.paper-sidebar {
    width: 260px !important;
    min-width: 260px;
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    position: sticky !important;
    top: 100px !important;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 100;
}

/* Custom scrollbar for sidebar */
.paper-sidebar::-webkit-scrollbar {
    width: 6px;
}

.paper-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.paper-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.paper-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.paper-sidebar.collapsed {
    transform: translateX(-260px);
    width: 0;
}

.sidebar-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e8ecf1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 12px 12px 0 0;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a5568;
    margin: 0;
    letter-spacing: 0.05em;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #718096;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    color: #2d3748;
}

.sidebar-toggle svg {
    transition: transform 0.3s ease;
}

.paper-sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list > li {
    margin: 0;
}

.nav-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #4a5568;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #e8eaf0;
    color: #2d3748;
}

.nav-item.active {
    background: #e0e7ff;
    color: #3b82f6;
    border-left-color: #3b82f6;
}

.nav-sublist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-subitem {
    display: block;
    padding: 0.5rem 1.5rem 0.5rem 3rem;
    color: #718096;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-subitem:hover {
    background: #e8eaf0;
    color: #4a5568;
}

.nav-subitem.active {
    background: #e0e7ff;
    color: #3b82f6;
    border-left-color: #3b82f6;
}

/* Hero Section */
.hero-section {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4ff 0%, #fef0f5 100%);
    padding: 2rem;
    width: 100%;
    margin: 0;
}

.hero-content {
    max-width: 1680px;
    width: 100%;
    text-align: center;
    background: transparent;
    padding: 3.25rem 1.5rem 2.75rem;
    border-radius: 16px;
    box-shadow: none;
}

.hero-title {
    font-size: clamp(1.86rem, 2.15vw, 2.22rem);
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 2rem;
    line-height: 1.18;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

@media (max-width: 1500px) {
    .hero-title {
        white-space: normal;
    }
}

.hero-meta {
    margin-bottom: 2rem;
}

.hero-authors,
.hero-affiliations {
    font-size: 1rem;
    color: #4a5568;
    margin: 0.5rem 0;
    line-height: 1.6;
}

.hero-authors {
    font-size: 1.14rem;
    font-weight: 700;
}

.hero-correspondence {
    font-size: 0.95rem;
    color: #4a5568;
    margin: 0.8rem 0 0;
    word-break: break-word;
}

.hero-logo {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.hero-logo-img {
    height: 86px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.hero-logo-img:hover {
    opacity: 1;
}

.hero-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.68rem 1.8rem;
    border: 2px solid;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.96rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: white;
}

.hero-btn-icon {
    width: 20px;
    height: 20px;
}

.hero-btn.paper-btn {
    border-color: #3b82f6;
    color: #3b82f6;
}

.hero-btn.paper-btn:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.hero-btn.code-btn {
    border-color: #1f2937;
    color: #1f2937;
}

.hero-btn.code-btn:hover {
    background: #1f2937;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.3);
}

.hero-btn.dataset-btn {
    border-color: #f59e0b;
    color: #f59e0b;
}

.hero-btn.dataset-btn:hover {
    background: #f59e0b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.hero-btn.hero-btn-disabled {
    cursor: default;
    pointer-events: none;
    opacity: 1;
}

/* Main Content */
.paper-content {
    flex: 1 !important;
    max-width: 1240px;
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    padding: 2.35rem 2.15rem !important;
    margin: 0 !important;
}

/* Paper Sections */
.paper-section {
    margin-bottom: 3rem;
    scroll-margin-top: 100px;
}

.title-section {
    text-align: center;
    padding-bottom: 2rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid #e8ecf1;
}

/* Organization Logo */
.organization-logo {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.org-logo-img {
    height: 86px;
    width: auto;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.org-logo-img:hover {
    opacity: 1;
}

.hf-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 1.2rem;
    line-height: 1;
}

/* Resource Links */
.resource-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.resource-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border: 2px solid;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background: white;
}

.resource-icon {
    width: 20px;
    height: 20px;
}

.paper-btn {
    border-color: #dc2626;
    color: #dc2626;
}

.paper-btn:hover {
    background: #dc2626;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.code-btn {
    border-color: #1f2937;
    color: #1f2937;
}

.code-btn:hover {
    background: #1f2937;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.3);
}

.dataset-btn {
    border-color: #f59e0b;
    color: #f59e0b;
}

.dataset-btn:hover {
    background: #f59e0b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.paper-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.paper-subtitle {
    font-size: 1.25rem;
    color: #4a5568;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.paper-meta {
    margin-top: 1.5rem;
}

.paper-authors,
.paper-affiliations {
    font-size: 1rem;
    color: #1f2937;
    margin: 0.5rem 0;
}

.section-heading {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid #3b82f6;
}

.section-content {
    font-size: 1.03rem;
    line-height: 1.8;
    color: #1f2937;
}

.section-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: #1f2937;
}

/* List styles with proper indentation */
.section-content ul,
.section-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
    padding-left: 0;
}

.section-content ul li,
.section-content ol li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    color: #1f2937;
}

.section-content ul {
    list-style-type: disc;
}

.section-content ol {
    list-style-type: decimal;
}

/* Subsections */
.paper-subsection {
    margin-top: 2rem;
    margin-bottom: 4rem;
    margin-left: 0;
    scroll-margin-top: 100px;
}

.subsection-heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.subsection-content {
    font-size: 1.03rem;
    line-height: 1.8;
    color: #1f2937;
}

.subsection-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: #1f2937;
}

/* List styles with proper indentation for subsections */
.subsection-content ul,
.subsection-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
    padding-left: 0;
}

.subsection-content ul li,
.subsection-content ol li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    color: #1f2937;
}

.subsection-content ul {
    list-style-type: disc;
}

.subsection-content ol {
    list-style-type: decimal;
}

/* Citation Box */
.citation-box {
    background: #f8f9fb;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.citation-box pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #1f2937;
    overflow-x: auto;
}

.citation-box code {
    font-family: inherit;
}

/* Sidebar Toggle Button (when collapsed) */
.sidebar-toggle-btn {
    position: fixed;
    left: 1rem;
    top: 100px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 101;
    transition: all 0.3s ease;
}

.sidebar-toggle-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.paper-sidebar.collapsed ~ .sidebar-toggle-btn {
    display: flex;
}

/* Responsive */
@media (max-width: 1024px) {
    .paper-layout {
        padding: 1rem;
    }
    
    .paper-sidebar {
        position: fixed;
        left: 1rem;
        top: 100px;
        transform: translateX(-320px);
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        z-index: 1000;
    }
    
    .paper-sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-toggle-btn {
        display: flex;
    }
    
    .paper-content {
        padding: 2rem 1.5rem;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .paper-layout {
        padding: 0.5rem;
    }
    
    .paper-title {
        font-size: 2rem;
    }
    
    .paper-subtitle {
        font-size: 1.1rem;
    }
    
    .section-heading {
        font-size: 1.5rem;
    }
    
    .subsection-heading {
        font-size: 1.2rem;
    }
    
    .paper-content {
        padding: 1.5rem 1.25rem;
        border-radius: 8px;
    }
    
    .paper-sidebar {
        border-radius: 8px;
    }
}

/* ============================================
   Dark Mode for Paper Layout
   ============================================ */
body.dark-mode #page-overview.page-content {
    background: #111827 !important;
}

body.dark-mode .paper-layout {
    background: #111827 !important;
}

body.dark-mode .paper-sidebar {
    background: #1f2937 !important;
    border: 1px solid #374151;
}

body.dark-mode .sidebar-header {
    background: #1f2937 !important;
    border-bottom-color: #374151;
}

body.dark-mode .sidebar-header h3 {
    color: #f9fafb;
}

body.dark-mode .sidebar-toggle {
    color: #9ca3af;
}

body.dark-mode .sidebar-toggle:hover {
    color: #f9fafb;
}

body.dark-mode .nav-item {
    color: #d1d5db;
}

body.dark-mode .nav-item:hover {
    background: #374151;
    color: #f9fafb;
}

body.dark-mode .nav-item.active {
    background: #1e3a8a;
    color: #60a5fa;
    border-left-color: #60a5fa;
}

body.dark-mode .nav-subitem {
    color: #9ca3af;
}

body.dark-mode .nav-subitem:hover {
    background: #374151;
    color: #d1d5db;
}

body.dark-mode .nav-subitem.active {
    background: #1e3a8a;
    color: #60a5fa;
    border-left-color: #60a5fa;
}

body.dark-mode .paper-content {
    background: #1f2937 !important;
    border: 1px solid #374151;
}

body.dark-mode .paper-title {
    color: #f9fafb;
}

body.dark-mode .paper-subtitle {
    color: #d1d5db;
}

body.dark-mode .paper-authors,
body.dark-mode .paper-affiliations {
    color: #9ca3af;
}

body.dark-mode .section-heading {
    color: #f9fafb;
    border-bottom-color: #60a5fa;
}

body.dark-mode .section-content {
    color: #d1d5db !important;
}

body.dark-mode .section-content p {
    color: #d1d5db !important;
}

body.dark-mode .subsection-heading {
    color: #e5e7eb;
}

body.dark-mode .subsection-content {
    color: #d1d5db !important;
}

body.dark-mode .subsection-content p {
    color: #d1d5db !important;
}

body.dark-mode .section-content ul,
body.dark-mode .section-content li,
body.dark-mode .subsection-content ul,
body.dark-mode .subsection-content li {
    color: #d1d5db !important;
}

body.dark-mode .section-content strong,
body.dark-mode .subsection-content strong {
    color: #f9fafb;
}

body.dark-mode .section-content em,
body.dark-mode .subsection-content em {
    color: #d1d5db;
}

body.dark-mode .title-section {
    border-bottom-color: #374151;
}

body.dark-mode .citation-box {
    background: #111827;
    border-color: #374151;
}

body.dark-mode .citation-box pre {
    color: #e5e7eb;
}

/* ============================================
   Finding Cards
   ============================================ */
.finding-card {
    margin: 1.5rem 0 2rem 0;
    padding: 1.25rem 1.5rem;
    background: #fefcf5;
    border: 2px solid #3d3d3d;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.25s ease;
    font-size: 1.05rem;
}

.finding-card:hover {
    transform: translateY(-2px) scale(1.005);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.finding-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #1f2937;
}

.finding-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1f2937;
    margin-right: 0.25rem;
}

.finding-text {
    font-style: italic;
    color: #1f2937;
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Highlight styles for key terms */
.highlight-blue {
    color: #2563eb;
    font-weight: 600;
    font-style: normal;
}

.highlight-green {
    color: #059669;
    font-weight: 600;
    font-style: normal;
}

.highlight-purple {
    color: #7c3aed;
    font-weight: 600;
    font-style: normal;
}

.highlight-orange {
    color: #ea580c;
    font-weight: 600;
    font-style: normal;
}

/* Dark mode styles for Finding cards */
body.dark-mode .finding-card {
    background: #2a2520;
    border-color: #4b5563;
}

body.dark-mode .finding-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .finding-content {
    color: #e5e7eb;
}

body.dark-mode .finding-title {
    color: #f9fafb;
}

body.dark-mode .finding-text {
    color: #d1d5db;
}

body.dark-mode .highlight-blue {
    color: #60a5fa;
}

body.dark-mode .highlight-green {
    color: #34d399;
}

body.dark-mode .highlight-purple {
    color: #a78bfa;
}

body.dark-mode .highlight-orange {
    color: #fb923c;
}

/* ============================================
   Paper Content Styles
   ============================================ */

/* Figure containers */
.figure-container {
    margin: 2rem 0;
    text-align: center;
}

.figure-container.figure-small {
    max-width: 68%;
    margin-left: auto;
    margin-right: auto;
}

.figure-container.figure-wide {
    max-width: 88%;
    margin-left: auto;
    margin-right: auto;
}

.figure-container.figure-small .paper-figure {
    width: 100%;
    max-width: 100%;
}

/* Side-by-side figures */
.figures-row {
    display: flex;
    gap: 1.5rem;
    margin: 2rem 0;
    align-items: flex-start;
}

.figure-container-half {
    flex: 1;
    text-align: center;
}

@media (max-width: 900px) {
    .figures-row {
        flex-direction: column;
    }

    .figure-container.figure-small,
    .figure-container.figure-wide {
        max-width: 100%;
    }

    .figure-smaller {
        max-width: 66%;
    }
}

.paper-figure {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.figure-smaller {
    max-width: 40%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.paper-figure-compact {
    max-height: 470px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.figure-caption {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.6;
    margin-top: 0.5rem;
    text-align: center;
}

/* Data tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.data-table thead {
    background: #f3f4f6;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid #e5e7eb;
}

.data-table th {
    font-weight: 600;
    color: #1f2937;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table .total-row {
    background: #f3f4f6;
    font-weight: 600;
}

/* Research questions list */
.research-questions {
    list-style: none;
    counter-reset: rq-counter;
    padding-left: 0;
    margin-left: 2rem;
}

.research-questions li {
    counter-increment: rq-counter;
    margin-bottom: 1rem;
    padding-left: 3.5rem;
    position: relative;
    line-height: 1.6;
}

.research-questions li strong em {
    font-family: 'Lora', serif;
    font-style: italic;
    font-weight: 700;
}

/* Question styling in subsection content */
.subsection-content p strong em {
    font-family: 'Lora', serif;
    font-style: italic;
    font-weight: 700;
}

/* RQ color styling - matching matplotlib colors */
.rq-color-1 {
    color: #1f77b4; /* mplBlue */
}

.rq-color-2 {
    color: #ff7f0e; /* mplOrange */
}

.rq-color-3 {
    color: #2ca02c; /* mplGreen */
}

.rq-color-4 {
    color: #d62728; /* mplRed */
}

.rq-color-5 {
    color: #9467bd; /* mplPurple */
}

.research-questions li::before {
    content: "RQ" counter(rq-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #2563eb;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Compact table style */
.compact-table {
    max-width: 600px;
    margin: 1.5rem auto;
    font-size: 0.9rem;
}

.compact-table th,
.compact-table td {
    padding: 0.5rem 0.75rem;
}

/* Contributions list */
.contributions-list {
    list-style: disc;
    padding-left: 0;
    margin-left: 2rem;
}

.contributions-list li {
    margin-bottom: 0.75rem;
    padding-left: 0;
    position: static;
    text-indent: 0;
    margin-left: 0;
    line-height: 1.7;
}

/* Taxonomy table (paper-like layout) */
.taxonomy-layout {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 1.4rem;
    align-items: start;
}

.taxonomy-figure-panel {
    margin: 0;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.taxonomy-example-figure {
    width: 100%;
    max-height: 760px;
    object-fit: contain;
    margin-bottom: 0.6rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: none;
}

.taxonomy-table-panel {
    min-width: 0;
}

.taxonomy-table-panel .taxonomy-table-wrap {
    margin: 0;
    max-width: none;
}

.taxonomy-note {
    margin-top: 0.7rem;
}

.taxonomy-table-wrap {
    margin: 1.5rem auto 0;
    max-width: 820px;
    border-top: 2px solid #111827;
    border-bottom: 2px solid #111827;
}

.taxonomy-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Lora', serif;
    font-size: 0.94rem;
    line-height: 1.35;
}

.taxonomy-table thead th {
    text-align: left;
    font-weight: 700;
    color: #111827;
    padding: 0.55rem 0.75rem;
    border-bottom: 2px solid #111827;
    background: #ffffff;
}

.taxonomy-table td {
    padding: 0.28rem 0.75rem;
    vertical-align: top;
    color: #111827;
}

.taxonomy-table .tax-type {
    width: 42%;
    font-weight: 700;
}

.taxonomy-table .tax-blue td {
    background: #dfe2f4;
}

.taxonomy-table .tax-green td {
    background: #d9efdd;
}

.taxonomy-table .tax-yellow td {
    background: #f4f1df;
}

.taxonomy-table .tax-orange td {
    background: #f7ece1;
}

.taxonomy-table .tax-purple td {
    background: #f2e3ef;
}

@media (max-width: 900px) {
    .taxonomy-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .taxonomy-figure-panel {
        max-width: 740px;
        margin: 0 auto;
    }

    .taxonomy-table-wrap {
        max-width: 100%;
        overflow-x: auto;
    }

    .taxonomy-table {
        min-width: 640px;
    }
}

/* Pipeline stages */
.pipeline-stages {
    margin: 1.6rem 0 1.8rem;
    border-top: 1px solid #d1d5db;
}

.pipeline-stage {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
    background: transparent;
    border-radius: 0;
    transition: none;
}

.pipeline-stage:hover {
    background: transparent;
    transform: none;
}

.stage-number {
    flex-shrink: 0;
    width: 1.85rem;
    height: 1.85rem;
    background: #e5e7eb;
    color: #1f2937;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    border: 1px solid #d1d5db;
    box-shadow: none;
}

.stage-content {
    flex: 1;
}

.stage-content h4 {
    margin-top: 0;
    margin-bottom: 0.28rem;
    color: #111827;
    font-size: 1.02rem;
    font-weight: 650;
}

.stage-content p {
    margin: 0;
    color: #374151;
    line-height: 1.65;
    font-size: 0.97rem;
}

/* Performance table styles */
.paper-content .table-container {
    overflow-x: auto;
    margin: 2rem auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: fit-content;
}

.performance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: white;
    min-width: 900px;
}

.performance-table thead {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.performance-table th {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
}

.performance-table th[rowspan="2"] {
    vertical-align: middle;
}

.performance-table tbody tr {
    transition: background-color 0.2s ease;
}

.performance-table tbody tr:hover:not(.category-row) {
    background: #f0f9ff;
}

.performance-table td {
    padding: 0.6rem 0.5rem;
    text-align: center;
    border: 1px solid #e5e7eb;
    color: #1f2937;
}

.performance-table td:first-child {
    text-align: left;
    font-weight: 500;
    padding-left: 1rem;
}

.category-row {
    background: #f3f4f6 !important;
    font-weight: 600;
}

.category-row td {
    padding: 0.5rem 1rem;
    text-align: center !important;
    color: #4b5563;
    border: none;
    border-top: 2px solid #d1d5db;
    border-bottom: 1px solid #d1d5db;
}

.highlight-row {
    background: #fef3c7;
}

.best-value {
    background: #dcfce7;
    color: #166534;
    font-weight: 700;
}

.table-note {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 1rem;
    line-height: 1.6;
    font-style: italic;
}

/* Dark mode adjustments for paper content */
body.dark-mode .figure-caption {
    color: #9ca3af;
}

/* Dark mode hero section */
body.dark-mode .hero-section {
    background: linear-gradient(135deg, #1e293b 0%, #312e81 100%);
}

body.dark-mode .hero-title {
    color: #f9fafb;
}

body.dark-mode .hero-authors,
body.dark-mode .hero-affiliations {
    color: #d1d5db;
}

body.dark-mode .hero-correspondence {
    color: #d1d5db;
}

body.dark-mode .hero-btn {
    background: transparent;
}

body.dark-mode .hero-btn.paper-btn {
    border-color: #60a5fa;
    color: #60a5fa;
}

body.dark-mode .hero-btn.paper-btn:hover {
    background: #60a5fa;
    color: #1f2937;
}

body.dark-mode .hero-btn.code-btn {
    border-color: #f9fafb;
    color: #f9fafb;
}

body.dark-mode .hero-btn.code-btn:hover {
    background: #f9fafb;
    color: #1f2937;
}

body.dark-mode .hero-btn.dataset-btn {
    border-color: #fbbf24;
    color: #fbbf24;
}

body.dark-mode .hero-btn.dataset-btn:hover {
    background: #fbbf24;
    color: #1f2937;
}

body.dark-mode .resource-btn {
    background: #1f2937;
}

body.dark-mode .paper-btn {
    border-color: #ef4444;
    color: #ef4444;
}

body.dark-mode .paper-btn:hover {
    background: #ef4444;
    color: white;
}

body.dark-mode .code-btn {
    border-color: #f9fafb;
    color: #f9fafb;
}

body.dark-mode .code-btn:hover {
    background: #f9fafb;
    color: #1f2937;
}

body.dark-mode .dataset-btn {
    border-color: #fbbf24;
    color: #fbbf24;
}

body.dark-mode .dataset-btn:hover {
    background: #fbbf24;
    color: #1f2937;
}

body.dark-mode .performance-table {
    background: #1f2937;
}

body.dark-mode .performance-table thead {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
}

body.dark-mode .performance-table td {
    border-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .category-row {
    background: #374151 !important;
}

body.dark-mode .category-row td {
    color: #d1d5db;
    border-top-color: #4b5563;
    border-bottom-color: #4b5563;
    text-align: center !important;
}

body.dark-mode .highlight-row {
    background: #422006;
}

body.dark-mode .best-value {
    background: #064e3b;
    color: #6ee7b7;
}

body.dark-mode .table-note {
    color: #9ca3af;
}

body.dark-mode .performance-table tbody tr:hover:not(.category-row) {
    background: #374151;
}

/* Uncertainty table styles */
.uncertainty-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
    max-width: 800px;
    margin: 0 auto;
}

.uncertainty-table thead {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
}

.uncertainty-table th {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
}

.uncertainty-table th[rowspan="2"] {
    vertical-align: middle;
}

.uncertainty-table tbody tr {
    transition: background-color 0.2s ease;
}

.uncertainty-table tbody tr:hover:not(.metric-header) {
    background: #faf5ff;
}

.uncertainty-table td {
    padding: 0.6rem 0.5rem;
    text-align: center;
    border: 1px solid #e5e7eb;
    color: #1f2937;
}

.uncertainty-table td:first-child {
    text-align: left;
    font-weight: 500;
    padding-left: 1rem;
}

.metric-header {
    background: #f3f4f6 !important;
    font-weight: 600;
}

.metric-header td {
    padding: 0.5rem 1rem;
    text-align: left !important;
    color: #4b5563;
    border: none;
    border-top: 2px solid #d1d5db;
    border-bottom: 1px solid #d1d5db;
}

.highlight-diff {
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
}

/* Dark mode for uncertainty table */
body.dark-mode .uncertainty-table {
    background: #1f2937;
}

body.dark-mode .uncertainty-table thead {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
}

body.dark-mode .uncertainty-table td {
    border-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .metric-header {
    background: #374151 !important;
}

body.dark-mode .metric-header td {
    color: #d1d5db;
    border-top-color: #4b5563;
    border-bottom-color: #4b5563;
}

body.dark-mode .highlight-diff {
    background: #422006;
    color: #fbbf24;
}

body.dark-mode .uncertainty-table tbody tr:hover:not(.metric-header) {
    background: #374151;
}

/* Position table styles */
.position-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: white;
    max-width: 900px;
    margin: 0 auto;
}

.position-table thead {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.position-table th {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    line-height: 1.3;
}

.position-table th[rowspan="2"] {
    vertical-align: middle;
}

.position-table tbody tr {
    transition: background-color 0.2s ease;
}

.position-table tbody tr:hover {
    background: #f0fdf4;
}

.position-table td {
    padding: 0.6rem 0.5rem;
    text-align: center;
    border: 1px solid #e5e7eb;
    color: #1f2937;
}

.position-table td:first-child {
    text-align: left;
    font-weight: 600;
    padding-left: 1rem;
    background: #f9fafb;
}

.highlight-gap {
    background: #fef3c7 !important;
}

.highlight-gap td {
    font-weight: 600;
}

.gap-small {
    background: #dcfce7 !important;
    color: #166534;
}

.gap-large {
    background: #fee2e2 !important;
    color: #991b1b;
}

/* Dark mode for position table */
body.dark-mode .position-table {
    background: #1f2937;
}

body.dark-mode .position-table thead {
    background: linear-gradient(135deg, #059669, #047857);
}

body.dark-mode .position-table td {
    border-color: #374151;
    color: #e5e7eb;
}

body.dark-mode .position-table td:first-child {
    background: #374151;
}

body.dark-mode .highlight-gap {
    background: #422006 !important;
}

body.dark-mode .gap-small {
    background: #064e3b !important;
    color: #6ee7b7;
}

body.dark-mode .gap-large {
    background: #7f1d1d !important;
    color: #fca5a5;
}

body.dark-mode .position-table tbody tr:hover {
    background: #374151;
}

body.dark-mode .data-table thead {
    background: #374151;
}

body.dark-mode .data-table th {
    color: #f9fafb;
}

body.dark-mode .data-table th,
body.dark-mode .data-table td {
    border-color: #4b5563;
}

body.dark-mode .data-table tbody tr:hover {
    background: #374151;
}

body.dark-mode .data-table .total-row {
    background: #374151;
}

body.dark-mode .taxonomy-table-wrap {
    border-top-color: #d1d5db;
    border-bottom-color: #d1d5db;
}

body.dark-mode .taxonomy-figure-panel {
    background: #111827;
    border-color: #374151;
    box-shadow: none;
}

body.dark-mode .taxonomy-example-figure {
    border-color: #374151;
}

body.dark-mode .taxonomy-table thead th {
    color: #f9fafb;
    background: #111827;
    border-bottom-color: #d1d5db;
}

body.dark-mode .taxonomy-table td {
    color: #e5e7eb;
}

body.dark-mode .taxonomy-table .tax-blue td {
    background: #303854;
}

body.dark-mode .taxonomy-table .tax-green td {
    background: #2e4b39;
}

body.dark-mode .taxonomy-table .tax-yellow td {
    background: #4a4734;
}

body.dark-mode .taxonomy-table .tax-orange td {
    background: #4d3d31;
}

body.dark-mode .taxonomy-table .tax-purple td {
    background: #47374b;
}

body.dark-mode .pipeline-stages {
    border-top-color: #4b5563;
}

body.dark-mode .pipeline-stage {
    background: transparent;
    border-bottom-color: #4b5563;
}

body.dark-mode .pipeline-stage:hover {
    background: transparent;
}

body.dark-mode .stage-number {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .stage-content h4 {
    color: #f9fafb;
}

body.dark-mode .stage-content p {
    color: #d1d5db;
}
