/* Modern Academic Research Portal Design */
:root {
    --primary: #1a73e8;
    --primary-hover: #1557b0;
    --secondary: #5f6368;
    --accent: #ea4335;
    --success: #1e8e3e;
    --background: #ffffff;
    --surface: #f8f9fa;
    --surface-hover: #f1f3f4;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #80868b;
    --border: #dadce0;
    --shadow-sm: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    --shadow-md: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
    --shadow-lg: 0 2px 6px 2px rgba(60,64,67,.15), 0 8px 24px 4px rgba(60,64,67,.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body.dark {
    --primary: #8ab4f8;
    --primary-hover: #aecbfa;
    --secondary: #9aa0a6;
    --accent: #f28b82;
    --success: #81c995;
    --background: #202124;
    --surface: #292a2d;
    --surface-hover: #35363a;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-tertiary: #5f6368;
    --border: #3c4043;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Header */
.header {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 18px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.brand-link {
    color: var(--text-primary);
    text-decoration: none;
}

.brand-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
}

.title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.toggle-mode-wrapper {
    display: flex;
}

.toggle-mode {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--background);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.toggle-mode:hover {
    background: var(--surface-hover);
    color: var(--primary);
}

.description {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Featured Papers */
.featured-section {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.section-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--success);
    margin-bottom: 2px;
}

.section-heading h2 {
    font-size: 24px;
    line-height: 1.25;
    color: var(--text-primary);
}

.section-link,
.featured-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.section-link:hover,
.featured-link:hover {
    color: var(--primary-hover);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.featured-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.featured-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.featured-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.featured-rank {
    color: var(--success);
}

.featured-card h3 {
    font-size: 17px;
    line-height: 1.35;
}

.featured-card h3 a,
.paper-title a {
    color: var(--primary);
    text-decoration: none;
}

.featured-card h3 a:hover,
.paper-title a:hover {
    color: var(--primary-hover);
}

.featured-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}

.featured-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.featured-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.featured-actions .featured-link {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text-secondary);
}

.featured-actions .featured-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.featured-actions .featured-link-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.featured-actions .featured-link-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

.featured-actions .unavailable {
    opacity: 0.65;
}

/* Stats Toolbar */
.ia-toolbar {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.stats-strip {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    background: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

/* Active Filters */
.active-filters {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.active-filters-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.active-filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.active-filters-empty {
    font-size: 14px;
    color: var(--text-tertiary);
    font-style: italic;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.filter-chip button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.filter-chip button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.quick-clear {
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-clear:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    color: var(--primary);
}

/* Filter Bar */
.filter-bar {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 10px 18px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.1;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.filter-btn:hover::before {
    width: 200px;
    height: 200px;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.filter-btn.active:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Custom Select Dropdown */
.custom-select {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.select-trigger:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.1);
}

.select-trigger.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.select-trigger i {
    color: var(--text-tertiary);
    transition: transform 0.2s;
}

.select-trigger.active i {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.select-dropdown.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.select-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
    color: var(--text-primary);
}

.select-option:hover {
    background: var(--surface-hover);
    color: var(--primary);
}

.select-option.selected {
    background: rgba(26, 115, 232, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.select-option:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.select-option:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* Custom scrollbar for dropdown */
.select-dropdown::-webkit-scrollbar {
    width: 8px;
}

.select-dropdown::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 4px;
}

.select-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.select-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Search Box */
/* Search Box */
.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: var(--background);
    color: var(--text-primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

.search-box input:hover {
    border-color: var(--primary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
    transform: translateY(-1px);
}

.search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s;
}

.search-box input:focus + i,
.search-box input:hover + i {
    color: var(--primary);
}

/* Paper List */
.paper-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.paper-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.paper-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
    transform: translateY(-2px);
}

.paper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.paper-venue {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.llm-badge {
    padding: 4px 10px;
    background: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

body.dark .llm-badge {
    background: rgba(76, 175, 80, 0.2);
    border-color: #66bb6a;
    color: #81c784;
}

.paper-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.2s;
}

.paper-title:hover {
    color: var(--primary-hover);
}

.paper-authors {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.paper-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.paper-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.paper-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 4px 10px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.paper-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.paper-link:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

/* Loader */
.loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    color: var(--text-secondary);
}

.loader.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

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

.empty-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.reset-button, .clear-all {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.reset-button:hover, .clear-all:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-sm);
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
}

#resultsCount {
    font-weight: 600;
    color: var(--primary);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.row {
    display: flex;
    flex-direction: row;
}

.gap-8 {
    gap: 8px;
}

.align-center {
    align-items: center;
}

/* Group Filter Bar */
.group-filter-bar {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.group-filter-bar .filter-btn {
    padding: 8px 16px;
}

/* Analysis Page */
.analysis-main {
    max-width: 1100px;
}

.analysis-header .title {
    font-size: 24px;
}

.analysis-deck {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.analysis-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.analysis-eyebrow {
    color: var(--success);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.analysis-hero h1 {
    font-size: 34px;
    line-height: 1.18;
    margin-bottom: 12px;
}

.analysis-hero p {
    color: var(--text-secondary);
    font-size: 17px;
    max-width: 780px;
}

.analysis-slides {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.reading-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.reading-wide {
    grid-column: 1 / -1;
}

.reading-study-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.reading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.reading-tags {
    margin-top: 16px;
}

.reading-note-card {
    min-height: 300px;
}

.reading-roadmap,
.reading-term-list,
.reading-comment-list {
    list-style: none;
    padding-left: 0;
}

.reading-step {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

.reading-step:first-child,
.reading-term-card:first-child,
.reading-comment:first-child {
    border-top: none;
    padding-top: 0;
}

.reading-step-number {
    color: var(--success);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.reading-step strong,
.reading-term-card strong,
.reading-comment span {
    display: block;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.reading-step p,
.reading-term-card p,
.reading-comment p {
    color: var(--text-secondary);
}

.reading-term-card,
.reading-comment {
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.reading-comment span {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.paper-figure-list {
    display: grid;
    gap: 18px;
}

.paper-figure-card {
    display: grid;
    grid-template-columns: minmax(280px, 1.15fr) minmax(240px, 0.85fr);
    gap: 18px;
    align-items: start;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.paper-figure-card:first-child {
    padding-top: 0;
    border-top: none;
}

.paper-figure-card figure {
    margin: 0;
}

.paper-figure-zoom {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    text-align: inherit;
}

.paper-figure-zoom:focus-visible {
    outline: 3px solid rgba(26, 115, 232, 0.35);
    outline-offset: 4px;
}

.paper-figure-card img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
}

.paper-figure-card figcaption {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin-top: 8px;
}

.paper-figure-card figcaption strong {
    display: block;
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 2px;
}

.paper-figure-notes {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.paper-figure-notes h3 {
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.3;
    margin-bottom: 10px;
}

.paper-figure-notes ul {
    color: var(--text-secondary);
    padding-left: 18px;
}

.paper-figure-notes li + li {
    margin-top: 10px;
}

body.lightbox-open {
    overflow: hidden;
}

.figure-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.78);
}

.figure-lightbox.hidden {
    display: none;
}

.figure-lightbox-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    width: min(1200px, 96vw);
    max-height: 94vh;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.figure-lightbox-close {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    color: var(--text-primary);
    cursor: pointer;
}

.figure-lightbox-close:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.figure-lightbox-image-wrap {
    overflow: auto;
    max-height: 78vh;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.figure-lightbox-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.figure-lightbox-caption {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.figure-lightbox-caption strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.reading-graph {
    display: grid;
    gap: 18px;
}

.reading-graph-center,
.reading-graph-node,
.reading-flow-step {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--background);
    padding: 14px;
}

.reading-graph-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-color: var(--primary);
    box-shadow: inset 4px 0 0 var(--primary);
}

.reading-graph-center span,
.reading-graph-node span,
.reading-flow-step span {
    display: block;
    color: var(--success);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.reading-graph-center strong,
.reading-graph-node strong,
.reading-flow-step strong {
    display: block;
    color: var(--text-primary);
    line-height: 1.35;
}

.reading-graph-branch,
.reading-graph-flow {
    display: grid;
    gap: 12px;
}

.reading-graph-concepts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reading-graph-node {
    border-top: 3px solid var(--success);
}

.reading-graph-node p,
.reading-flow-step p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-top: 6px;
}

.reading-graph-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reading-flow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -13px;
    width: 12px;
    border-top: 2px solid var(--border);
}

.analysis-slide {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    min-height: 240px;
    box-shadow: var(--shadow-sm);
}

.slide-number {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.analysis-slide h2 {
    font-size: 22px;
    line-height: 1.25;
    margin-bottom: 14px;
}

.analysis-slide ul {
    padding-left: 20px;
    color: var(--text-secondary);
}

.analysis-slide li + li {
    margin-top: 10px;
}

.analysis-bottom-nav {
    display: flex;
    justify-content: center;
    padding: 8px 0 24px;
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        padding: 16px 12px;
    }

    .header {
        padding: 24px 20px;
    }

    .title {
        font-size: 24px;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .brand-lockup {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .brand-logo {
        width: 68px;
        height: 68px;
    }

    .stats-strip {
        flex-direction: column;
    }

    .stat-card {
        min-width: 100%;
    }

    .paper-card {
        padding: 20px 16px;
    }

    .paper-card-actions {
        justify-content: stretch;
        width: 100%;
    }

    .paper-card-actions .paper-link {
        flex: 1 1 100%;
        justify-content: center;
    }

    .paper-title {
        font-size: 16px;
    }

    .filter-bar, .ia-toolbar {
        padding: 16px;
    }

    .featured-section {
        padding: 16px;
    }

    .section-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .section-link {
        white-space: normal;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .featured-card {
        min-height: auto;
    }

    .analysis-hero {
        padding: 24px 18px;
    }

    .analysis-hero h1 {
        font-size: 25px;
    }

    .analysis-slides {
        grid-template-columns: 1fr;
    }

    .reading-layout {
        grid-template-columns: 1fr;
    }

    .reading-study-grid {
        grid-template-columns: 1fr;
    }

    .reading-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .reading-actions .paper-link {
        justify-content: center;
        white-space: normal;
    }

    .paper-figure-card {
        grid-template-columns: 1fr;
    }

    .reading-graph-concepts,
    .reading-graph-flow {
        grid-template-columns: 1fr;
    }

    .reading-flow-step:not(:last-child)::after {
        display: none;
    }

    .analysis-slide {
        min-height: auto;
        padding: 20px 18px;
    }

    .figure-lightbox {
        padding: 12px;
    }

    .figure-lightbox-panel {
        width: 100%;
        padding: 12px;
    }
}

/* Smooth Transitions */
* {
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
