/* Neumorphic Paper Database Styles — inspired by oplclaw.autodl.com */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --background: #E0E5EC;
    --surface: #E0E5EC;
    --surface-elevated: #E8ECF2;
    --foreground: #3D4852;
    --muted: #718096;
    --border-light: rgba(61, 72, 82, 0.1);
    --accent: #4A90D9;
    --success: #48BB78;
    --warning: #ED8936;

    --font-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

    --shadow-dark: rgba(163, 177, 198, 0.65);
    --shadow-light: rgba(255, 255, 255, 0.55);
    --shadow-dark-hover: rgba(163, 177, 198, 0.75);
    --shadow-light-hover: rgba(255, 255, 255, 0.65);

    --neu-extruded: 9px 9px 16px var(--shadow-dark), -9px -9px 16px var(--shadow-light);
    --neu-extruded-sm: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
    --neu-extruded-hover: 12px 12px 20px var(--shadow-dark-hover), -12px -12px 20px var(--shadow-light-hover);
    --neu-inset: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    --neu-inset-deep: inset 6px 6px 10px var(--shadow-dark), inset -6px -6px 10px var(--shadow-light);

    --radius-base: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --transition: 0.25s ease;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 48px);
}

/* Header */
header {
    margin-bottom: clamp(24px, 4vw, 48px);
}

header h1 {
    font-family: var(--font-display);
    font-size: clamp(36px, 7vw, 64px);
    font-weight: 900;
    color: var(--foreground);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.subtitle {
    font-size: clamp(14px, 1.6vw, 18px);
    color: var(--muted);
    margin-top: 8px;
}

.header-nav {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

.nav-link {
    display: inline-block;
    padding: 10px 20px;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--foreground);
    text-decoration: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    transition: all var(--transition);
}

.nav-link:hover {
    box-shadow: var(--neu-inset);
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: clamp(20px, 3vw, 36px);
    padding: clamp(16px, 2.5vw, 24px);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-extruded);
    background: var(--surface);
}

#searchInput {
    flex: 1;
    min-width: 200px;
    padding: 14px 20px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--foreground);
    background: var(--surface);
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-inset);
    outline: none;
    transition: box-shadow var(--transition);
}

#searchInput:focus {
    box-shadow: var(--neu-inset-deep);
}

#searchInput::placeholder {
    color: var(--muted);
}

#venueFilter, #yearFilter {
    padding: 14px 20px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--foreground);
    background: var(--surface);
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-inset);
    outline: none;
    min-width: 140px;
    cursor: pointer;
}

#venueFilter:disabled, #yearFilter:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: clamp(20px, 3vw, 36px);
}

.stat-item {
    padding: 20px 28px;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--foreground);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

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

.paper-card {
    padding: clamp(16px, 2.5vw, 24px);
    border: 0;
    border-right: 2px solid var(--foreground);
    border-bottom: 2px solid var(--foreground);
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
}

.paper-card:hover {
    background: var(--foreground);
    color: var(--background);
    box-shadow: var(--neu-extruded-hover);
}

.paper-card:hover .paper-authors,
.paper-card:hover .tag {
    color: var(--background);
    border-color: var(--background);
}

.paper-title {
    font-family: var(--font-display);
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    line-height: 1.4;
}

.paper-authors {
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: 10px;
}

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

.tag {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid var(--foreground);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground);
    transition: all var(--transition);
}

.tag.venue {
    border-color: var(--accent);
    color: var(--accent);
}

.tag.has-results {
    border-color: var(--success);
    color: var(--success);
    font-weight: 600;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--foreground);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 18px;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    transition: all var(--transition);
    margin-bottom: 24px;
}

.back-link:hover {
    box-shadow: var(--neu-inset);
}

/* Paper Detail */
.paper-detail {
    padding: clamp(24px, 4vw, 48px);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-extruded);
}

.detail-title {
    font-family: var(--font-display);
    font-size: clamp(24px, 5vw, 42px);
    font-weight: 900;
    color: var(--foreground);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 20px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.meta-item { min-width: 180px; }

.meta-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.meta-value {
    font-size: 0.95rem;
    color: var(--foreground);
    line-height: 1.5;
}

/* Sections */
.section {
    margin-bottom: clamp(24px, 4vw, 40px);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 800;
    color: var(--foreground);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--foreground);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-content {
    font-size: 0.95rem;
    color: var(--foreground);
    line-height: 1.8;
}

.section-content ul {
    padding-left: 20px;
    margin-top: 8px;
}

.section-content li {
    margin-bottom: 6px;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 12px;
    border-radius: var(--radius-base);
    overflow: hidden;
    box-shadow: var(--neu-extruded-sm);
}

.data-table th {
    background: var(--foreground);
    color: var(--background);
    padding: 12px 16px;
    text-align: left;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.data-table td {
    padding: 10px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--surface-elevated);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-best {
    background: var(--success);
    color: #fff;
}

.badge-proposed {
    background: var(--accent);
    color: #fff;
}

.badge-primary {
    background: var(--foreground);
    color: var(--background);
}

.badge-role {
    background: transparent;
    border: 1px solid var(--muted);
    color: var(--muted);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

.pagination button {
    padding: 12px 24px;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--foreground);
    background: var(--surface);
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.pagination button:hover {
    box-shadow: var(--neu-inset);
}

.page-info {
    font-size: 0.875rem;
    color: var(--muted);
    font-weight: 500;
}

/* Loading */
.loading {
    text-align: center;
    padding: 48px;
    color: var(--muted);
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .search-bar { flex-direction: column; }
    #venueFilter { width: 100%; }
    .detail-meta { flex-direction: column; gap: 16px; }
    .data-table { font-size: 0.8rem; }
    .data-table th, .data-table td { padding: 8px 10px; }
    .conference-grid { grid-template-columns: 1fr; }
    .stats-bar { grid-template-columns: repeat(2, 1fr); }

    .search-filters {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .search-main {
        flex-direction: column;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .results-sort {
        width: 100%;
    }

    .results-sort select {
        flex: 1;
    }
}

/* Conference Grid */
.conferences-section {
    margin-top: clamp(32px, 5vw, 64px);
}

.conference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.conference-card {
    padding: clamp(20px, 3vw, 32px);
    border: 0;
    border-right: 2px solid var(--foreground);
    border-bottom: 2px solid var(--foreground);
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
}

.conference-card:hover {
    background: var(--foreground);
    color: var(--background);
    box-shadow: var(--neu-extruded-hover);
}

.conference-card:hover .conference-stats,
.conference-card:hover .conf-stat-label {
    color: var(--background);
}

.conference-name {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.conference-stats {
    display: flex;
    gap: 24px;
    margin-top: 12px;
}

.conf-stat {
    display: flex;
    flex-direction: column;
}

.conf-stat-number {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--foreground);
}

.conference-card:hover .conf-stat-number {
    color: var(--background);
}

.conf-stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

/* Search Section */
.search-section {
    margin-top: clamp(32px, 5vw, 48px);
    margin-bottom: clamp(32px, 5vw, 48px);
}

.search-container {
    padding: clamp(24px, 4vw, 32px);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-extruded);
    background: var(--surface);
}

.search-main {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-main input {
    flex: 1;
    padding: 16px 24px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--foreground);
    background: var(--surface);
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-inset);
    outline: none;
    transition: box-shadow var(--transition);
}

.search-main input:focus {
    box-shadow: var(--neu-inset-deep);
}

.search-main input::placeholder {
    color: var(--muted);
}

.search-filters {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    gap: 20px;
    align-items: start;
}

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

.filter-label {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--foreground);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.year-range-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.range-separator {
    color: var(--muted);
    font-weight: 600;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
}

.btn-secondary {
    padding: 12px 20px;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--foreground);
    background: var(--surface);
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-secondary:hover {
    box-shadow: var(--neu-inset);
}

.search-results {
    margin-top: 32px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--foreground);
}

.results-title {
    font-family: var(--font-display);
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 800;
    color: var(--foreground);
    margin: 0;
}

.results-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-sort label {
    font-size: 0.875rem;
    color: var(--muted);
    font-weight: 600;
}

.results-sort select {
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--foreground);
    background: var(--surface);
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-inset);
    outline: none;
    cursor: pointer;
}

#venueFilter[multiple] {
    min-height: 140px;
    padding: 8px;
}

#venueFilter[multiple] option {
    padding: 10px 12px;
    margin: 2px 0;
    border-radius: 8px;
    cursor: pointer;
}

#venueFilter[multiple] option:checked {
    background: var(--foreground);
    color: var(--background);
    font-weight: 600;
}

#yearFrom, #yearTo {
    flex: 1;
    min-width: 100px;
}

.search-btn {
    padding: 14px 32px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--background);
    background: var(--foreground);
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.search-btn:hover {
    box-shadow: var(--neu-extruded-hover);
}

.search-btn:active {
    box-shadow: var(--neu-inset);
}

#venueFilter[multiple] {
    min-height: 120px;
    padding: 8px;
}

#venueFilter[multiple] option {
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 8px;
}

#venueFilter[multiple] option:checked {
    background: var(--foreground);
    color: var(--background);
}

/* Stats Bar Grid */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: clamp(20px, 3vw, 36px);
}

/* Author List */
.author-list {
    display: grid;
    gap: 16px;
}

.author-card {
    padding: clamp(16px, 2.5vw, 24px);
    border: 0;
    border-right: 2px solid var(--foreground);
    border-bottom: 2px solid var(--foreground);
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
}

.author-card:hover {
    background: var(--foreground);
    color: var(--background);
    box-shadow: var(--neu-extruded-hover);
}

.author-card:hover .author-stats,
.author-card:hover .author-meta,
.author-card:hover .tag {
    color: var(--background);
    border-color: var(--background);
}

.author-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 16px;
}

.author-name {
    font-family: var(--font-display);
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.4;
    flex: 1;
}

.author-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.author-years {
    font-size: 0.875rem;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

.author-card:hover .author-years {
    color: var(--background);
    opacity: 0.8;
}

.author-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.author-stat {
    font-size: 0.875rem;
    color: var(--muted);
}

.author-venues {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.author-keywords {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.author-card:hover .author-keywords {
    border-top-color: rgba(224, 229, 236, 0.3);
}

.author-card:hover .author-keywords .tag {
    color: var(--background);
    border-color: var(--background);
}

/* Alphabet Navigation */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: clamp(24px, 4vw, 36px);
    padding: clamp(16px, 2.5vw, 24px);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-extruded);
    background: var(--surface);
}

.alphabet-btn {
    min-width: 40px;
    padding: 8px 12px;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--foreground);
    background: var(--surface);
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.alphabet-btn:hover {
    box-shadow: var(--neu-inset);
}

.alphabet-btn.active {
    background: var(--foreground);
    color: var(--background);
    box-shadow: var(--neu-inset);
}

.alphabet-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-count {
    font-size: 0.875rem;
    color: var(--muted);
    font-weight: 600;
}

.author-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: clamp(24px, 4vw, 40px);
}

.author-stats-overview .stat-item {
    padding: clamp(20px, 3vw, 28px);
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded);
    background: var(--surface);
}

.filter-info {
    margin-top: 16px;
    padding: 12px 20px;
    border-radius: var(--radius-base);
    background: var(--surface-elevated);
}

.info-text {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
}

/* ===== Brainstorm Styles ===== */
.brainstorm-config, .brainstorm-progress, .brainstorm-gaps, .brainstorm-results, .brainstorm-history {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--neu-extruded, 6px 6px 12px #d1d9e6, -6px -6px 12px #ffffff);
}
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.config-item label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted, #666);
    margin-bottom: 0.3rem;
}
.config-item select, .config-item input {
    width: 100%;
    padding: 0.5rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}
.config-item-wide { grid-column: 1 / -1; }
.year-range-inline { display: flex; align-items: center; gap: 0.5rem; }
.year-range-inline select { flex: 1; }
.config-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}
.paper-preview { font-size: 0.85rem; color: var(--muted, #666); }
.btn-primary {
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    border: none;
    background: var(--accent, #4a90d9);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 3px 3px 6px #b8c0cc, -3px -3px 6px #ffffff;
    transition: all 0.2s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.hidden { display: none !important; }

/* Progress */
.progress-bar-container {
    height: 8px;
    background: #e8edf3;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4a90d9, #67b8f7);
    border-radius: 4px;
    transition: width 0.4s ease;
}
.progress-steps {
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.8rem;
    color: var(--muted, #555);
    margin-bottom: 0.5rem;
}
.step-item { padding: 0.2rem 0; border-bottom: 1px solid #f0f0f0; }
.progress-message { font-size: 0.9rem; font-weight: 500; }

/* Gaps */
.gaps-list { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.gap-card {
    flex: 1 1 280px;
    padding: 0.75rem;
    border-radius: 10px;
    background: #f8f9fb;
    border-left: 4px solid #4a90d9;
    box-shadow: 2px 2px 6px #d1d9e6 inset;
}
.gap-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 0.4rem;
}
.gap-badge.high { background: #ffe0e0; color: #c0392b; }
.gap-badge.medium { background: #fff3cd; color: #856404; }
.gap-badge.low { background: #d4edda; color: #155724; }
.gap-category { font-size: 0.75rem; color: var(--muted, #888); }
.gap-card p { margin: 0.4rem 0 0; font-size: 0.85rem; line-height: 1.4; }

/* Ideas */
.ideas-list { display: flex; flex-direction: column; gap: 1rem; }
.idea-card {
    padding: 1.2rem;
    border-radius: 14px;
    background: var(--card-bg, #fff);
    box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #ffffff;
}
.idea-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.idea-rank {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent, #4a90d9);
    min-width: 2rem;
}
.idea-title { flex: 1; font-size: 1rem; margin: 0; }
.idea-elo {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: #eef4fb;
    color: #4a90d9;
    font-weight: 600;
}
.idea-meta { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.idea-heuristic, .idea-gap {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: #f0f4f8;
    color: #555;
}
.idea-oneliner { font-size: 0.9rem; color: #333; margin: 0.5rem 0; font-style: italic; }
.idea-details { margin-top: 0.75rem; }
.idea-details summary { cursor: pointer; font-size: 0.85rem; color: var(--accent, #4a90d9); }
.idea-section { margin: 0.5rem 0; font-size: 0.85rem; line-height: 1.5; }
.idea-section strong { color: #333; }
.crit-list li { color: #c0392b; font-size: 0.8rem; }
.pos-list li { color: #27ae60; font-size: 0.8rem; }

/* Scores */
.idea-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin-top: 0.75rem; }
.score-item { display: flex; align-items: center; gap: 0.3rem; }
.score-label { font-size: 0.65rem; color: var(--muted, #888); min-width: 55px; text-transform: capitalize; }
.score-bar { flex: 1; height: 6px; background: #e8edf3; border-radius: 3px; overflow: hidden; }
.score-fill { height: 100%; background: linear-gradient(90deg, #4a90d9, #67b8f7); border-radius: 3px; }
.score-val { font-size: 0.7rem; min-width: 22px; text-align: right; }

/* History */
.history-list { max-height: 300px; overflow-y: auto; }
.history-item {
    padding: 0.6rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid #eee;
}
.history-item:hover { background: #f4f7fa; }
.history-meta { display: flex; gap: 0.5rem; align-items: center; font-size: 0.75rem; }
.history-venue { font-weight: 600; }
.history-status { padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.65rem; }
.history-status.completed { background: #d4edda; color: #155724; }
.history-status.running { background: #fff3cd; color: #856404; }
.history-status.failed { background: #f8d7da; color: #721c24; }
.history-time { color: var(--muted, #999); margin-left: auto; }
.history-query { font-size: 0.8rem; color: #555; margin-top: 0.2rem; }
.empty-hint { font-size: 0.85rem; color: var(--muted, #999); text-align: center; padding: 1rem; }

/* Paper Detail Enhancements */
.author-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity var(--transition);
}

.author-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.paper-assets {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.asset-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--foreground);
    text-decoration: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    transition: all var(--transition);
}

.asset-link:hover {
    box-shadow: var(--neu-inset);
}

.asset-link.asset-pdf {
    color: #d32f2f;
    border: 1px solid rgba(211, 47, 47, 0.2);
}

.asset-link.asset-html {
    color: var(--accent);
    border: 1px solid rgba(100, 108, 255, 0.2);
}

.abstract-text {
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--foreground);
    text-align: justify;
}

.overview-block {
    margin-bottom: 12px;
    line-height: 1.8;
}

.overview-block strong {
    color: var(--foreground);
    font-weight: 700;
}

.row-best td {
    background: rgba(72, 187, 120, 0.06) !important;
}

/* Author Detail Page */
.author-hero {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 28px;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), #67b8f7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: var(--neu-extruded-sm);
}

.author-hero-meta {
    display: flex;
    gap: 16px;
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 6px;
}

.author-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.author-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 8px;
}

.institution-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.institution-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
}

.institution-clickable {
    cursor: pointer;
    transition: all var(--transition);
}

.institution-clickable:hover {
    box-shadow: var(--neu-extruded-hover);
    transform: translateY(-1px);
}

.institution-clickable:hover .inst-name {
    color: var(--accent);
}

.inst-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.inst-count {
    font-size: 0.8rem;
    color: var(--muted);
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.active-filters:empty {
    display: none;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.active-filter-remove {
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.active-filter-remove:hover {
    opacity: 1;
}

.collab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.collab-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 10px;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    text-decoration: none;
    color: var(--foreground);
    transition: all var(--transition);
}

.collab-card:hover {
    box-shadow: var(--neu-inset);
}

.collab-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(74, 144, 217, 0.12);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

.collab-name {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collab-count {
    font-size: 0.7rem;
    color: var(--muted);
}

/* Year bar chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding-top: 20px;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}

.bar-fill {
    width: 100%;
    max-width: 32px;
    background: linear-gradient(180deg, var(--accent), #67b8f7);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
}

.bar-label {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 6px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.bar-value {
    position: absolute;
    top: 0;
    font-size: 0.7rem;
    color: var(--foreground);
    font-weight: 600;
}

.paper-abstract-preview {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Paper detail: institutions and keyword tags */
.paper-institutions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.institution-tag {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--foreground);
    text-decoration: none;
    border-radius: var(--radius-full);
    border: 1px solid var(--accent);
    background: rgba(74, 144, 217, 0.06);
    transition: all var(--transition);
}

.institution-tag:hover {
    background: var(--accent);
    color: white;
}

.paper-keywords-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.keyword-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--success);
    border: 1px solid var(--success);
    border-radius: var(--radius-full);
    background: rgba(72, 187, 120, 0.06);
}

/* Author-affiliation paired list */
.author-affil-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.author-affil-item {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.author-inst-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-style: italic;
    text-decoration: none;
    transition: color var(--transition);
}

.author-inst-label::before {
    content: '(';
}

.author-inst-label::after {
    content: ')';
}

.author-inst-label:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Citations section */
.citations-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.citation-col-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--foreground);
}

.citation-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    text-decoration: none;
    color: var(--foreground);
    transition: all var(--transition);
}

.citation-item:hover {
    box-shadow: var(--neu-inset);
}

.citation-title {
    font-size: 0.82rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.citation-year {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.citation-more {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    padding: 8px;
    font-style: italic;
}

.citation-more-link {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    border-radius: var(--radius-base);
    transition: all var(--transition);
}

.citation-more-link:hover {
    background: rgba(74, 144, 217, 0.08);
}

@media (max-width: 768px) {
    .citations-grid { grid-template-columns: 1fr; }
}

/* Raw Citations */
.citation-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.stat-badge {
    background: var(--bg-card);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.raw-citations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.raw-citation-item {
    padding: 12px 16px;
    border-radius: 10px;
    border-left: 4px solid var(--accent);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}
.raw-citation-item.warn {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}
.raw-citation-item.ok {
    border-left-color: var(--accent);
}
.raw-citation-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.raw-citation-order {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    min-width: 30px;
}
.raw-citation-year {
    background: var(--accent);
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}
.raw-citation-missing {
    background: #f59e0b;
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}
.raw-citation-matched {
    background: #10b981;
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
}
.raw-citation-matched:hover {
    opacity: 0.8;
}
.raw-citation-doi {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}
.raw-citation-title {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-primary);
}
.raw-citation-title .missing {
    color: #f59e0b;
    font-style: italic;
}
.raw-citation-raw {
    margin-top: 6px;
}
.raw-citation-raw summary {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    cursor: pointer;
    user-select: none;
}
.raw-citation-raw pre {
    margin-top: 6px;
    padding: 10px;
    background: var(--bg-page);
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-secondary);
    max-height: 200px;
    overflow-y: auto;
}

@media (max-width: 900px) {
    .author-stats-grid { grid-template-columns: repeat(3, 1fr); }
    .papers-filter-bar { flex-direction: column; }
}

@media (max-width: 768px) {
    .author-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .author-grid { grid-template-columns: 1fr; }
    .collab-grid { grid-template-columns: repeat(3, 1fr); }
    .author-hero { flex-direction: column; align-items: flex-start; }
    .disambig-grid { grid-template-columns: 1fr; }
}

/* Disambiguation page */
.disambig-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.disambig-card {
    display: block;
    padding: 20px;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    text-decoration: none;
    color: var(--foreground);
    transition: all var(--transition);
    border-left: 4px solid var(--accent);
}

.disambig-card:hover {
    box-shadow: var(--neu-extruded-hover);
    transform: translateY(-2px);
}

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

.disambig-papers {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
}

.disambig-years {
    font-size: 0.85rem;
    color: var(--muted);
}

.disambig-inst {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    line-height: 1.4;
}

.disambig-keywords {
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
}

/* Institution avatar */
.inst-avatar {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, #48BB78, #38A169);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
    box-shadow: var(--neu-extruded-sm);
}

/* Year Timeline */
.year-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    cursor: pointer;
    transition: all var(--transition);
    min-width: 80px;
}

.timeline-item:hover {
    box-shadow: var(--neu-inset);
    background: var(--foreground);
    color: var(--background);
}

.timeline-item:hover .timeline-cites {
    color: var(--background);
    opacity: 0.7;
}

.timeline-year {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
}

.timeline-count {
    font-size: 0.75rem;
    font-weight: 600;
}

.timeline-cites {
    font-size: 0.65rem;
    color: var(--muted);
}

.paper-rank {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--accent);
    margin-right: 8px;
    min-width: 28px;
}

/* ═══════════════════════════════════════════════════
   Reference Detail Page
   ═══════════════════════════════════════════════════ */

.ref-page {
    min-height: 100vh;
    padding: 24px;
    background: var(--background);
}

.ref-container {
    max-width: 1280px;
    margin: 0 auto;
}

/* Hero */
.ref-hero {
    padding: 32px;
    margin: 16px 0 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-extruded);
}

.ref-eyebrow {
    display: inline-block;
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.ref-hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    font-weight: 800;
    line-height: 1.3;
    margin: 6px 0 14px;
    color: var(--foreground);
}

.ref-hero-title-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.ref-hero-title-link:hover {
    color: var(--primary, #5470c6);
    border-bottom-color: var(--primary, #5470c6);
}

.ref-canonical {
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--muted);
}

.ref-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    align-items: center;
}

/* Badges */
.ref-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1.5px solid var(--foreground);
    background: transparent;
    color: var(--foreground);
    text-decoration: none;
    cursor: default;
    transition: var(--transition);
}

.ref-badge--primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.ref-badge--success {
    background: var(--success);
    color: white;
    border-color: var(--success);
    cursor: pointer;
}

.ref-badge--link {
    border-color: var(--accent);
    color: var(--accent);
    cursor: pointer;
}

.ref-badge--link:hover {
    background: var(--accent);
    color: white;
}

.ref-badge--action {
    cursor: pointer;
    border-color: var(--muted);
    color: var(--muted);
}

.ref-badge--action:hover {
    border-color: var(--foreground);
    color: var(--foreground);
}

.ref-badge--subtle {
    border-color: transparent;
    background: rgba(0,0,0,0.05);
    color: var(--muted);
    font-size: 0.7rem;
}

.ref-badge--fn {
    border-color: rgba(60, 100, 200, 0.35);
    background: rgba(60, 100, 200, 0.08);
    color: #2645a8;
    font-size: 0.72rem;
}
.ref-badge--positive {
    border-color: rgba(34, 139, 34, 0.4);
    background: rgba(34, 139, 34, 0.1);
    color: #1e7a1e;
    font-size: 0.72rem;
}
.ref-badge--negative {
    border-color: rgba(200, 60, 60, 0.4);
    background: rgba(200, 60, 60, 0.1);
    color: #a02525;
    font-size: 0.72rem;
}
.ref-badge--neutral {
    border-color: rgba(120, 120, 120, 0.35);
    background: rgba(120, 120, 120, 0.08);
    color: #555;
    font-size: 0.72rem;
}

/* --- Sentiment / function filter chips --- */
.cf-chips-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 6px 0;
}
.cf-chips-label {
    font-size: 0.72rem;
    color: var(--muted, #6a6a6a);
    margin-right: 6px;
    min-width: 32px;
}
.cf-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid rgba(0,0,0,0.15);
    background: #fff;
    color: #333;
    border-radius: 999px;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
.cf-chip:hover {
    background: rgba(0,0,0,0.04);
}
.cf-chip--on {
    background: rgba(60, 100, 200, 0.14);
    border-color: rgba(60, 100, 200, 0.6);
    color: #1e3a8a;
    font-weight: 600;
}
.cf-chip__n {
    font-size: 0.66rem;
    opacity: 0.7;
    padding-left: 3px;
}
.cf-chip--clear {
    background: transparent;
    border-color: rgba(200, 60, 60, 0.4);
    color: #a02525;
}
.cf-chip--clear:hover {
    background: rgba(200, 60, 60, 0.08);
}
.cf-chip.ref-badge--positive,
.cf-chip.ref-badge--negative,
.cf-chip.ref-badge--neutral {
    padding: 3px 10px;
    font-size: 0.75rem;
}
.cf-chip.ref-badge--positive.cf-chip--on {
    background: rgba(34, 139, 34, 0.22);
    border-color: rgba(34, 139, 34, 0.7);
    color: #14611e;
}
.cf-chip.ref-badge--negative.cf-chip--on {
    background: rgba(200, 60, 60, 0.22);
    border-color: rgba(200, 60, 60, 0.75);
    color: #7d1b1b;
}
.cf-chip.ref-badge--neutral.cf-chip--on {
    background: rgba(120, 120, 120, 0.22);
    border-color: rgba(120, 120, 120, 0.65);
    color: #333;
}

/* Metrics */
.ref-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.ref-metric {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-extruded-sm);
}

.ref-metric__icon {
    font-size: 1.5rem;
    line-height: 1;
}

.ref-metric__value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--foreground);
    line-height: 1.2;
}

.ref-metric__label {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2px;
}

/* Grid layout */
.ref-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

.ref-main {
    min-width: 0;
}

.ref-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 24px;
}

/* Panels */
.ref-panel {
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-extruded-sm);
}

.ref-panel h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin: 4px 0 0;
    color: var(--foreground);
}

.ref-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    gap: 12px;
}

/* Citation list */
.ref-cite-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ref-cite-card {
    padding: 18px 20px;
    border-radius: var(--radius-base);
    border: 1.5px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.35);
    transition: var(--transition);
}

.ref-cite-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(74,144,217,0.08);
}

.ref-cite-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.ref-cite-card__title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.4;
    flex: 1;
}

.ref-cite-card__title:hover {
    text-decoration: underline;
}

.ref-cite-card__meta {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.ref-cite-card__authors {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 6px;
    line-height: 1.4;
}

.ref-cite-card__ref {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
    line-height: 1.6;
}

.ref-cite-card__ref span {
    font-weight: 700;
}

/* Context box */
.ref-ctx {
    margin-top: 12px;
    padding: 14px 16px;
    border-left: 3px solid var(--accent);
    background: rgba(74, 144, 217, 0.04);
    border-radius: 0 var(--radius-base) var(--radius-base) 0;
}

.ref-ctx--empty {
    border-left-color: var(--muted);
    background: rgba(0,0,0,0.02);
}

.ref-ctx--empty p {
    color: var(--muted);
    font-style: italic;
    font-size: 0.82rem;
}

.ref-ctx--ref {
    border-left-color: var(--muted);
    background: rgba(0,0,0,0.02);
}

.ref-ctx--ref .ref-ctx__text {
    color: var(--muted);
    font-size: 0.82rem;
    font-style: italic;
}

.ref-ctx__text {
    font-size: 0.86rem;
    line-height: 1.85;
    color: var(--foreground);
}

.ref-ctx__text mark {
    background: rgba(74, 144, 217, 0.15);
    color: var(--accent);
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
}

/* Pagination */
.ref-pag {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.ref-pag__btn {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1.5px solid rgba(0,0,0,0.1);
    background: transparent;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--foreground);
    cursor: pointer;
    transition: var(--transition);
}

.ref-pag__btn:hover:not(:disabled) {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.ref-pag__btn--active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.ref-pag__btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ref-pag__dots {
    color: var(--muted);
    padding: 0 4px;
}

.ref-pag__info {
    margin-left: 12px;
    font-size: 0.75rem;
    color: var(--muted);
}

/* Year bar chart */
.ref-chart-wrap {
    margin-top: 16px;
    min-height: 180px;
}

.ref-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 160px;
}

.ref-bars__col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    cursor: default;
}

.ref-bars__val {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 4px;
    opacity: 0;
    transition: var(--transition);
}

.ref-bars__col:hover .ref-bars__val {
    opacity: 1;
    color: var(--accent);
}

.ref-bars__bar {
    width: 100%;
    max-width: 32px;
    background: var(--accent);
    border-radius: 4px 4px 0 0;
    min-height: 3px;
    transition: var(--transition);
    opacity: 0.7;
}

.ref-bars__col:hover .ref-bars__bar {
    opacity: 1;
    background: var(--foreground);
}

.ref-bars__yr {
    font-size: 0.62rem;
    color: var(--muted);
    margin-top: 6px;
    font-weight: 600;
}

/* Co-citations */
.ref-co-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    max-height: 480px;
    overflow-y: auto;
}

.ref-co-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    border: 1.5px solid rgba(0,0,0,0.06);
    transition: var(--transition);
    cursor: pointer;
}

.ref-co-card:hover {
    border-color: var(--accent);
    background: rgba(74,144,217,0.04);
}

.ref-co-card__rank {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--accent);
    min-width: 20px;
    text-align: center;
    padding-top: 2px;
}

.ref-co-card__body {
    flex: 1;
    min-width: 0;
}

.ref-co-card__title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--foreground);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ref-co-card__stats {
    font-size: 0.68rem;
    color: var(--muted);
    margin-top: 3px;
}

/* Responsive */
@media (max-width: 1024px) {
    .ref-grid {
        grid-template-columns: 1fr;
    }
    .ref-side {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .ref-side .ref-panel {
        flex: 1;
        min-width: 280px;
    }
}

@media (max-width: 768px) {
    .ref-page {
        padding: 14px;
    }
    .ref-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .ref-hero {
        padding: 20px;
    }
    .ref-hero-title {
        font-size: 1.2rem;
    }
    .ref-cite-card__head {
        flex-direction: column;
    }
    .ref-panel {
        padding: 18px;
    }
    .ref-side {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .ref-metrics {
        grid-template-columns: 1fr;
    }
}

.tag.has-results {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 16px;
}

/* Keyword Cloud */
.keyword-cloud {
    margin: 20px 0;
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-extruded-sm);
}

.keyword-cloud .section-title {
    margin-bottom: 14px;
}

.keyword-cloud-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.keyword-cloud-tag {
    display: inline-block;
    padding: 4px 12px;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-full);
    background: rgba(74, 144, 217, 0.05);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.keyword-cloud-tag:hover,
.keyword-cloud-tag.active {
    background: var(--accent);
    color: white;
}

.keyword-cloud-tag sup {
    font-size: 0.6em;
    margin-left: 2px;
    opacity: 0.6;
}

/* Pivot Table */
.pivot-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pivot-table th {
    white-space: nowrap;
    min-width: 80px;
    font-size: 0.8rem;
}

.pivot-table td {
    font-size: 0.82rem;
    text-align: center;
}

.pivot-table td:first-child,
.pivot-table td:nth-child(2) {
    text-align: left;
    white-space: nowrap;
}

.cell-best {
    background: rgba(72, 187, 120, 0.12) !important;
}

.cell-empty {
    color: var(--muted);
}

@media (max-width: 768px) {
    .keyword-cloud {
        padding: 14px 16px;
    }
}

/* ---- Related Work ---- */
.rw-result-container {
    margin-top: 1.2rem;
}
.rw-text {
    line-height: 1.8;
    font-size: 0.95rem;
    color: var(--foreground);
    white-space: pre-wrap;
}
.rw-text p {
    margin-bottom: 1rem;
    text-indent: 2em;
}
.cite-marker {
    color: var(--accent);
    font-weight: 600;
}
.cite-link {
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}
.cite-link:hover {
    text-decoration: underline;
}
.rw-references li:target {
    background: #fff3cd;
    border-radius: 4px;
    padding: 2px 4px;
    margin-left: -4px;
}
.rw-references {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}
.rw-references h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
}
.rw-references ol {
    padding-left: 1.5rem;
}
.rw-references li {
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
    color: var(--muted);
}
.rw-stats {
    margin-top: 1rem;
    padding: 0.8rem;
    background: var(--surface-elevated);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--muted);
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.rw-stat-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.rw-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.8rem;
}

/* ---- Tabs ---- */
.rw-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border, #e2e8f0);
}
.rw-tab {
    padding: 0.6rem 1.2rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary, #666);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.rw-tab:hover {
    color: var(--accent, #4a7bf7);
}
.rw-tab.active {
    color: var(--accent, #4a7bf7);
    border-bottom-color: var(--accent, #4a7bf7);
    font-weight: 600;
}
.rw-tab-content {
    min-height: 100px;
}

/* ---- Draft sections ---- */
.rw-draft-block {
    margin-bottom: 1.5rem;
    padding: 1rem 1.2rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    border: 1px solid var(--border, #e2e8f0);
}
.rw-draft-block h4 {
    margin: 0 0 0.6rem 0;
    color: var(--text-primary, #2d3748);
    font-size: 1rem;
}
.rw-draft-papers {
    margin: 0.6rem 0;
    padding: 0.6rem;
    background: var(--bg-tertiary, #edf2f7);
    border-radius: 6px;
    font-size: 0.88rem;
}
.rw-draft-papers summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary, #4a5568);
}
.rw-draft-papers ul {
    margin: 0.4rem 0 0;
    padding-left: 1.4rem;
}
.rw-draft-papers li {
    margin-bottom: 0.25rem;
}
.rw-draft-text {
    line-height: 1.7;
}
.rw-draft-text p {
    margin: 0.4em 0;
}

/* ---- Feedback / Revision ---- */
.rw-feedback {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #e2e8f0);
    display: flex;
    gap: 0.8rem;
    align-items: flex-end;
}
.rw-feedback textarea {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    font-size: 0.9rem;
    resize: vertical;
    font-family: inherit;
}
.rw-feedback textarea:focus {
    outline: none;
    border-color: var(--accent, #4a7bf7);
    box-shadow: 0 0 0 2px rgba(74, 123, 247, 0.15);
}
.rw-feedback .btn-primary {
    white-space: nowrap;
    flex-shrink: 0;
}
.rw-editable {
    outline: none;
    border: 1px dashed var(--border, #cbd5e0);
    border-radius: 6px;
    padding: 1rem;
    min-height: 100px;
    cursor: text;
}
.rw-editable:focus {
    border-color: var(--accent, #4a7bf7);
    box-shadow: 0 0 0 2px rgba(74, 123, 247, 0.1);
}

/* ---- Paper Search ---- */
.rw-paper-search {
    margin-bottom: 1.2rem;
}
.search-input-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
}
.search-input-row input {
    flex: 1;
}
.search-results {
    max-height: 1200px;
    overflow-y: auto;
    margin-top: 0.5rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
}
.search-result-item {
    padding: 0.7rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border, #eee);
    transition: background 0.15s;
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover {
    background: var(--bg-secondary, #f0f0f0);
}
.search-result-title {
    font-weight: 600;
    font-size: 0.92rem;
}
.search-result-meta {
    font-size: 0.82rem;
    color: var(--text-secondary, #666);
    margin-top: 0.2rem;
}
.selected-paper {
    margin-top: 0.6rem;
    padding: 0.8rem 1rem;
    background: var(--bg-secondary, #f5f5f5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.selected-paper-info {
    flex: 1;
}
.selected-paper-title {
    font-weight: 600;
    font-size: 0.95rem;
}
.selected-paper-meta {
    font-size: 0.82rem;
    color: var(--text-secondary, #666);
    margin-top: 0.15rem;
}
.direct-id-row {
    margin-top: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-secondary, #666);
}
.direct-id-row label {
    white-space: nowrap;
}
.search-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary, #999);
    font-size: 0.88rem;
}
.rw-paper-section {
    margin: 1rem 0;
}
.rw-paper-section summary {
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--text-secondary, #666);
    padding: 0.4rem 0;
}
.rw-paper-section summary:hover {
    color: var(--text-primary, #333);
}
.rw-paper-section[open] .rw-paper-search {
    margin-top: 0.6rem;
}
.rw-paper-section[open] .seed-inputs {
    margin-top: 0.6rem;
}
.seed-inputs textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}
.seed-inputs textarea:focus {
    outline: none;
    border-color: var(--accent, #4a90d9);
}
.seed-inputs .config-item {
    margin-bottom: 0.8rem;
}

/* ---- Trends Dashboard ---- */

.trends-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: clamp(24px, 4vw, 36px);
    padding: clamp(12px, 2vw, 16px);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-extruded);
    background: var(--surface);
}

.trends-tab {
    padding: 10px 20px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--foreground);
    background: var(--surface);
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.trends-tab:hover {
    box-shadow: var(--neu-inset);
}

.trends-tab.active {
    background: var(--foreground);
    color: var(--background);
    box-shadow: var(--neu-inset-deep);
}

.tab-content {
    display: none;
}

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

.chart-panel {
    padding: clamp(20px, 3vw, 28px);
    border-radius: var(--radius-lg);
    box-shadow: var(--neu-extruded);
    background: var(--surface);
    margin-bottom: 24px;
}

.chart-panel-title {
    font-family: var(--font-display);
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--foreground);
}

.chart-panel-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: -10px;
    margin-bottom: 16px;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-grid .chart-panel {
    margin-bottom: 0;
}

.sparkline-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.sparkline-card {
    padding: 16px;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.sparkline-card:hover {
    box-shadow: var(--neu-inset);
}

.sparkline-card .venue-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.sparkline-card .venue-total {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.tab-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--muted);
}

.tab-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    margin-left: 12px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.trends-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
    margin-bottom: clamp(24px, 4vw, 36px);
}

.trends-stat-card {
    padding: 20px 16px;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    background: var(--surface);
    text-align: center;
}

.trends-stat-card .stat-number {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 800;
    color: var(--foreground);
    display: block;
}

.trends-stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 4px;
    display: block;
}

.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-bar select {
    padding: 8px 14px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--foreground);
    background: var(--surface);
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-inset);
    cursor: pointer;
    appearance: auto;
}

.filter-bar label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.leaderboard-table th {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    text-align: left;
    padding: 8px 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leaderboard-table td {
    padding: 10px 12px;
    font-size: 0.88rem;
    background: var(--surface);
}

.leaderboard-table tr td:first-child {
    border-radius: var(--radius-base) 0 0 var(--radius-base);
}

.leaderboard-table tr td:last-child {
    border-radius: 0 var(--radius-base) var(--radius-base) 0;
}

.leaderboard-table tbody tr {
    box-shadow: var(--neu-extruded-sm);
}

.leaderboard-table .is-best-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: var(--success);
    border-radius: var(--radius-full);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 16px 0;
}

.tag-cloud-item {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    box-shadow: var(--neu-extruded-sm);
    background: var(--surface);
    font-family: var(--font-body);
    color: var(--foreground);
    transition: all var(--transition);
}

.tag-cloud-item:hover {
    box-shadow: var(--neu-inset);
}

@media (max-width: 768px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }
    .sparkline-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .trends-tabs {
        gap: 6px;
    }
    .trends-tab {
        padding: 8px 14px;
        font-size: 0.78rem;
    }
}

/* ── Author Portrait: Research Timeline (Galaxy River Style) ── */
#kwTimeline {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    margin-right: -8px;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

#kwTimeline::-webkit-scrollbar {
    width: 8px;
}

#kwTimeline::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.3);
    border-radius: 4px;
}

#kwTimeline::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #94a3b8, #64748b);
    border-radius: 4px;
    transition: background 0.3s ease;
}

#kwTimeline::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #64748b, #475569);
}

.kw-timeline {
    position: relative;
    padding: 40px 15px;
    background:
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
        linear-gradient(to bottom, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.9));
    border-radius: var(--radius-lg);
    overflow: visible;
    min-height: 500px;
}

.kw-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 30px;
    bottom: 30px;
    width: 2px;
    background: linear-gradient(to bottom,
        transparent,
        rgba(148, 163, 184, 0.3) 10%,
        rgba(148, 163, 184, 0.5) 50%,
        rgba(148, 163, 184, 0.3) 90%,
        transparent);
    transform: translateX(-50%);
    z-index: 0;
}

.kw-year-row {
    position: relative;
    display: flex;
    align-items: center;
    padding: 20px 15px;
    margin-bottom: 25px;
    opacity: 0;
    animation: galaxyFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    scroll-snap-align: start;
    scroll-margin-top: 20px;
}

.kw-year-row:nth-child(odd) {
    flex-direction: row;
    justify-content: flex-end;
}

.kw-year-row:nth-child(even) {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.kw-year-row:nth-child(1) { animation-delay: 0.1s; }
.kw-year-row:nth-child(2) { animation-delay: 0.2s; }
.kw-year-row:nth-child(3) { animation-delay: 0.3s; }
.kw-year-row:nth-child(4) { animation-delay: 0.4s; }
.kw-year-row:nth-child(5) { animation-delay: 0.5s; }
.kw-year-row:nth-child(6) { animation-delay: 0.6s; }
.kw-year-row:nth-child(7) { animation-delay: 0.7s; }
.kw-year-row:nth-child(8) { animation-delay: 0.8s; }
.kw-year-row:nth-child(9) { animation-delay: 0.9s; }
.kw-year-row:nth-child(10) { animation-delay: 1s; }

@keyframes galaxyFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.kw-year-label {
    position: relative;
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    min-width: 90px;
    text-align: center;
    z-index: 10;
    padding: 12px 18px;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(241, 245, 249, 0.95) 100%);
    border: 2px solid rgba(59, 130, 246, 0.2);
    box-shadow:
        0 0 0 6px rgba(59, 130, 246, 0.08),
        0 6px 24px rgba(0, 0, 0, 0.1),
        inset 0 2px 6px rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kw-year-row:hover .kw-year-label {
    transform: scale(1.08) rotate(5deg);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow:
        0 0 0 10px rgba(59, 130, 246, 0.12),
        0 10px 36px rgba(59, 130, 246, 0.25),
        inset 0 2px 6px rgba(255, 255, 255, 1);
}

.kw-year-label::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3), transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    animation: pulse 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.4;
    }
}

.kw-year-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 45%;
    padding: 15px;
    z-index: 1;
}

.kw-year-row:nth-child(odd) .kw-year-tags {
    padding-right: 60px;
}

.kw-year-row:nth-child(even) .kw-year-tags {
    padding-left: 60px;
}

.kw-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 50px;
    color: #fff;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.12),
        0 2px 4px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.kw-chip::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.kw-chip:hover::before {
    opacity: 1;
}

.kw-chip:hover {
    transform: translateY(-6px) scale(1.1);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.22),
        0 5px 10px rgba(0, 0, 0, 0.12),
        0 0 20px currentColor;
    border-color: rgba(255, 255, 255, 0.5);
    filter: brightness(1.12) saturate(1.15);
}

.kw-chip::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 100;
}

.kw-chip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.kw-chip.kw-highlight {
    transform: scale(1.2) rotate(-3deg);
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.4),
        0 0 28px rgba(59, 130, 246, 0.55),
        0 10px 28px rgba(0, 0, 0, 0.25);
    filter: brightness(1.25) saturate(1.35) drop-shadow(0 0 10px currentColor);
    z-index: 100;
    animation: galaxyHighlight 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes galaxyHighlight {
    0%, 100% {
        transform: scale(1.2) rotate(-3deg);
    }
    25% {
        transform: scale(1.3) rotate(3deg);
    }
    50% {
        transform: scale(1.25) rotate(-2deg);
    }
    75% {
        transform: scale(1.27) rotate(2deg);
    }
}

/* Parallax effect on scroll */
.kw-year-row.in-view .kw-year-label {
    animation: floatIn 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes floatIn {
    from {
        transform: scale(0.5) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ── Author Portrait: Narrative ── */
.narrative-text {
    line-height: 1.8;
    font-size: 1rem;
    padding: 1rem 0;
}
.btn-narrative {
    margin-left: 12px;
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-display);
    border: none;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: opacity var(--transition);
    vertical-align: middle;
}
.btn-narrative:hover { opacity: 0.85; }
.btn-narrative:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Research Timeline (multi-dimensional) ── */
.timeline-container { position: relative; padding-left: 0; }
.timeline-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; padding: 8px 0; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.78rem; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

.tl-row { display: flex; gap: 12px; margin-bottom: 4px; align-items: stretch; min-height: 48px; }
.tl-year { min-width: 48px; font-weight: 700; font-size: 0.85rem; color: var(--foreground); display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.tl-paper-count { font-size: 0.7rem; color: var(--muted); font-weight: 400; }
.tl-dot-line { display: flex; flex-direction: column; align-items: center; width: 16px; position: relative; }
.tl-dot-line::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--border-light); transform: translateX(-50%); }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); position: relative; z-index: 1; margin-top: 8px; }
.tl-content { flex: 1; padding: 6px 0 12px; }

.tl-venue-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.tl-venue-seg { transition: width 0.3s; }
.tl-venue-seg:hover { opacity: 0.8; }

.tl-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.tl-chips .kw-chip { font-size: 0.75rem; padding: 2px 8px; border-radius: 12px; cursor: pointer; transition: transform 0.15s; }
.tl-chips .kw-chip:hover { transform: scale(1.08); }

.tl-tasks { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.tl-task-chip { font-size: 0.7rem; padding: 2px 7px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--border-light); color: var(--muted); }

/* ── Research Focus ── */
.research-focus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.focus-card { background: var(--surface); border-radius: var(--radius); padding: 16px; border: 1px solid var(--border-light); }
.focus-card-title { font-size: 0.85rem; font-weight: 600; margin: 0 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.focus-items { display: flex; flex-direction: column; gap: 8px; }
.focus-item { display: grid; grid-template-columns: 1fr 80px 30px; align-items: center; gap: 8px; }
.focus-name { font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-bar-bg { height: 6px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
.focus-bar { height: 100%; border-radius: 3px; background: var(--accent); transition: width 0.4s ease; }
.focus-bar.dataset { background: #10b981; }
.focus-bar.metric { background: #f59e0b; }
.focus-bar.venue { background: #8b5cf6; }
.focus-count { font-size: 0.72rem; color: var(--muted); text-align: right; }

.venue-type-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--border-light);
    color: var(--muted);
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Author Role Distribution ── */
.author-roles-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.role-chart-container {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.role-pie-chart {
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.role-pie-chart path {
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    transform-origin: center;
}

.role-pie-chart path:hover {
    opacity: 1 !important;
    transform: scale(1.05);
}

.role-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.role-legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.role-legend-label {
    flex: 1;
    color: var(--foreground);
    font-weight: 500;
}

.role-legend-value {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Author Role Evolution Chart */
.role-evolution-container {
    padding: 20px;
}

.role-evolution-chart {
    margin-bottom: 20px;
    overflow-x: auto;
}

.role-evolution-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px;
}

/* Venue Timeline Chart */
.venue-timeline-container {
    padding: 20px;
}

.venue-timeline-chart {
    margin-bottom: 15px;
    overflow-x: auto;
}

.venue-timeline-legend {
    display: flex;
    justify-content: center;
    padding: 10px;
}

/* Citation Trend Chart */
.citation-trend-container {
    padding: 20px;
}

.citation-trend-chart {
    margin-bottom: 20px;
    overflow-x: auto;
}

.citation-trend-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
}

.citation-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.citation-legend-line {
    display: block;
}

.citation-legend-label {
    color: var(--text);
    font-size: 0.9rem;
}

/* Research Triangle Chart */
.research-triangle-container {
    padding: 20px;
}

.research-triangle-chart {
    margin-bottom: 15px;
    overflow-x: auto;
}

/* Publication Timeline Chart */
.pub-timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
    justify-content: center;
}

.pub-timeline-chart {
    margin-bottom: 20px;
    overflow-x: auto;
}

.pub-timeline-tasks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.pub-tl-year-tasks {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pub-tl-year-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 45px;
}

/* Conference & Topic Overview */
.conf-topic-overview {
    padding: 10px;
}

.conf-topic-matrix {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.conf-topic-row {
    background: var(--surface);
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid var(--border-light);
    transition: box-shadow 0.2s ease;
}

.conf-topic-row:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.conf-topic-venue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.conf-venue-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.conf-venue-count {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
    background: var(--background);
    padding: 4px 10px;
    border-radius: 12px;
}

.conf-topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.conf-task-tag {
    font-size: 0.85rem;
    padding: 5px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: default;
}

.conf-task-tag:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #dbeafe 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* ── Papers Filter Bar + Pagination ─────────────────────────────────────── */

.papers-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.papers-search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-inset);
    background: var(--surface);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--foreground);
    outline: none;
    transition: box-shadow var(--transition);
}

.papers-search-input:focus {
    box-shadow: var(--neu-inset-deep);
}

.papers-filter-select {
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    background: var(--surface);
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--foreground);
    cursor: pointer;
    outline: none;
}

.papers-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    padding: 12px 0;
}

.pagination-btn {
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    background: var(--surface);
    color: var(--foreground);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.pagination-btn:hover {
    box-shadow: var(--neu-inset);
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--muted);
}

.tag.code-tag {
    color: var(--success);
    border: 1px solid var(--success);
    background: rgba(72, 187, 120, 0.08);
}

.tag.cite-tag {
    color: #e53e3e;
    border: 1px solid #e53e3e;
    background: rgba(229, 62, 62, 0.08);
    font-weight: 600;
}

.papers-sort-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--foreground);
    font-size: 0.9rem;
}

.pagination-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── SOTA Contributions ─────────────────────────────────────────────────── */

.sota-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.sota-card {
    padding: 16px;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    background: var(--surface);
}

.sota-dataset-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.sota-record {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    gap: 8px;
    transition: opacity var(--transition);
}

.sota-record:last-child { border-bottom: none; }
.sota-record:hover { opacity: 0.7; }

.sota-method {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--foreground);
    flex: 1;
}

.sota-metric {
    font-size: 0.8rem;
    color: var(--muted);
}

.sota-year {
    font-size: 0.75rem;
    color: var(--muted);
    min-width: 35px;
    text-align: right;
}

/* ── Top Cited Papers ───────────────────────────────────────────────────── */

.top-cited-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-cited-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-base);
    background: var(--surface);
    box-shadow: var(--neu-extruded-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.top-cited-item:hover {
    box-shadow: var(--neu-extruded-hover);
    transform: translateY(-1px);
}

.top-cited-rank {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 28px;
}

.top-cited-info {
    flex: 1;
    min-width: 0;
}

.top-cited-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--foreground);
    display: block;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-cited-bar-bg {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.top-cited-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #6366f1);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.top-cited-count {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--foreground);
    min-width: 40px;
    text-align: right;
}

.top-cited-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.top-cited-year {
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
}

.top-cited-cite-label {
    font-size: 0.75rem;
    color: var(--muted);
}

/* ── Citation Trend Tabs ──────────────────────────────────────────────────── */

.citation-trend-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.citation-tab-btn {
    padding: 6px 14px;
    border-radius: 6px 6px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.citation-tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.citation-tab-btn:hover:not(.active) {
    background: var(--background);
    color: var(--foreground);
}

/* ── Floating Section Nav ───────────────────────────────────────────────── */

.floating-section-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
    padding: 12px 8px;
    border-radius: var(--radius-base);
    box-shadow: var(--neu-extruded-sm);
    background: var(--surface);
}

.nav-anchor-link {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-anchor-link:hover {
    color: var(--accent);
    background: rgba(74, 144, 217, 0.08);
}

@media (max-width: 1200px) {
    .floating-section-nav { display: none; }
}

/* ── Author Comparison Page ───────────────────────────────────────────────── */

.compare-search-panel {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.compare-search-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.compare-search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--foreground);
    font-size: 0.95rem;
}

.compare-search-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    display: none;
}

.compare-search-results.active {
    display: block;
}

.compare-search-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare-search-item:hover {
    background: var(--background);
}

.compare-search-item:last-child {
    border-bottom: none;
}

.compare-selected-authors {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.compare-author-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

.compare-author-chip .chip-remove {
    cursor: pointer;
    opacity: 0.7;
    font-size: 1.1em;
}

.compare-author-chip .chip-remove:hover {
    opacity: 1;
}

.compare-btn {
    padding: 10px 24px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.compare-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compare-btn:hover:not(:disabled) {
    opacity: 0.85;
}

.compare-results {
    display: none;
}

.compare-results.active {
    display: block;
}

.compare-stats-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
}

.compare-stats-table th,
.compare-stats-table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.compare-stats-table th {
    background: var(--surface);
    font-weight: 600;
    color: var(--foreground);
}

.compare-stats-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--muted);
}

.compare-stats-table tr:hover td {
    background: var(--surface);
}

.compare-stats-table .highlight {
    font-weight: 700;
    color: var(--accent);
}

.compare-section {
    margin: 32px 0;
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
}

.compare-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--foreground);
}

.compare-chart {
    overflow-x: auto;
}

.compare-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.compare-overlap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.overlap-card {
    background: var(--background);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--border-light);
}

.overlap-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--foreground);
}

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

.overlap-tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    background: rgba(74, 144, 217, 0.1);
    color: var(--accent);
    border: 1px solid rgba(74, 144, 217, 0.2);
}

.overlap-tag.shared {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success);
    border-color: rgba(72, 187, 120, 0.3);
    font-weight: 600;
}

.btn-compare {
    display: inline-block;
    padding: 8px 18px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: opacity 0.2s;
    margin-left: 12px;
}

.btn-compare-inline {
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--accent);
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    margin-left: auto;
}

.btn-compare-inline:hover {
    background: var(--accent);
    color: #fff;
}

.btn-compare:hover {
    opacity: 0.85;
}

/* Author Comparison Page Enhancements */
.compare-slots {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.compare-slot {
    position: relative;
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.compare-vs {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--muted);
    padding: 0 8px;
}

.compare-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
}

.compare-dropdown[style*="display: block"] {
    display: block;
}

.dropdown-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: var(--background);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-name {
    display: block;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 4px;
}

.dropdown-meta {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
}

.dropdown-empty {
    padding: 12px 14px;
    color: var(--muted);
    text-align: center;
    font-size: 0.9rem;
}

.selected-author {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--accent) 0%, #5ba3e8 100%);
    border-radius: 10px;
    color: white;
    position: relative;
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.2);
}

.selected-name {
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
}

.selected-inst {
    font-size: 0.82rem;
    opacity: 0.9;
    margin-right: auto;
}

.btn-remove-author {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-author:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.btn-add-slot {
    padding: 10px 20px;
    border: 2px dashed var(--border);
    background: transparent;
    color: var(--accent);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 150px;
}

.btn-add-slot:hover {
    border-color: var(--accent);
    background: rgba(74, 144, 217, 0.05);
}

/* Comparison Results */
.compare-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.compare-author-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.compare-author-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.compare-author-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 6px;
}

.compare-author-inst {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 18px;
    min-height: 20px;
}

.compare-stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.compare-stat {
    text-align: center;
    padding: 10px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.compare-stat-val {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.compare-stat-lbl {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Legend improvements */
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--foreground);
    font-weight: 500;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

/* Keyword overlap section */
.kw-overlap-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kw-overlap-group h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 10px;
}

.shared-kw {
    background: rgba(72, 187, 120, 0.15);
    color: var(--success);
    border-color: rgba(72, 187, 120, 0.4);
    font-weight: 600;
}

/* Venue comparison table */
.compare-venue-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.compare-venue-table thead {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
}

.compare-venue-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--foreground);
}

.compare-venue-table th:first-child {
    text-align: left;
    min-width: 200px;
}

.compare-venue-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
}

.compare-venue-table td:first-child {
    font-weight: 500;
}

.compare-venue-table td:not(:first-child) {
    text-align: center;
    font-weight: 600;
    color: var(--accent);
}

.compare-venue-table tr:hover {
    background: var(--surface);
}

.compare-venue-table tr:hover td:first-child {
    color: var(--accent);
}

/* Similarity Overview Cards */
.similarity-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.similarity-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    transition: all 0.2s;
}

.similarity-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.similarity-icon {
    font-size: 2rem;
    line-height: 1;
}

.similarity-content {
    flex: 1;
}

.similarity-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1.2;
}

.similarity-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

/* Co-author Overlap */
.coauthor-overlap-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.coauthor-pair {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
}

.coauthor-pair h4 {
    margin: 0 0 16px 0;
    color: var(--foreground);
    font-size: 1.1rem;
}

.coauthor-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.coauthor-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--background);
    border-radius: 6px;
}

.coauthor-stat-item.highlight {
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.1) 0%, rgba(74, 144, 217, 0.05) 100%);
    border: 1px solid rgba(74, 144, 217, 0.3);
}

.coauthor-stat-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.coauthor-stat-value {
    color: var(--foreground);
    font-weight: 600;
    font-size: 0.95rem;
}

.shared-coauthors-list {
    padding: 12px;
    background: var(--background);
    border-radius: 6px;
    font-size: 0.9rem;
}

.coauthor-tag {
    display: inline-block;
    padding: 4px 10px;
    margin: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--foreground);
}

/* Topic Similarity */
.topic-sim-detail {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.topic-sim-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.topic-metric-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.topic-metric-label {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.topic-metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 8px;
}

.topic-metric-desc {
    font-size: 0.85rem;
    color: var(--muted);
}

.shared-topics {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.shared-topics h4 {
    margin: 0 0 12px 0;
    color: var(--foreground);
    font-size: 1rem;
}

/* Similarity Matrix */
.topic-sim-matrix {
    overflow-x: auto;
}

.similarity-matrix {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
}

.similarity-matrix th,
.similarity-matrix td {
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.similarity-matrix thead th {
    background: var(--background);
    color: var(--foreground);
    font-weight: 600;
}

.similarity-matrix tbody th {
    background: var(--background);
    color: var(--foreground);
    font-weight: 600;
    text-align: left;
}

.matrix-self {
    background: var(--background);
    color: var(--muted);
}

.matrix-empty {
    background: var(--surface);
}

.matrix-cell {
    font-weight: 600;
    font-size: 0.95rem;
    cursor: help;
}

.matrix-high {
    background: rgba(72, 187, 120, 0.2);
    color: #2d7a4d;
}

.matrix-medium {
    background: rgba(237, 137, 54, 0.2);
    color: #c77d2e;
}

.matrix-low {
    background: rgba(229, 62, 62, 0.15);
    color: #c53030;
}

.matrix-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    font-size: 0.85rem;
}

.matrix-legend span {
    padding: 6px 12px;
    border-radius: 4px;
}

.legend-high {
    background: rgba(72, 187, 120, 0.2);
    color: #2d7a4d;
}

.legend-medium {
    background: rgba(237, 137, 54, 0.2);
    color: #c77d2e;
}

.legend-low {
    background: rgba(229, 62, 62, 0.15);
    color: #c53030;
}

/* Institution Detail Enhancements */
.venue-list-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.venue-item-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--surface);
    border-radius: 6px;
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.venue-item-compact:hover {
    background: var(--background);
    border-color: var(--accent);
}

.venue-name-compact {
    font-size: 0.9rem;
    color: var(--foreground);
    font-weight: 500;
}

.venue-count-compact {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    background: rgba(74, 144, 217, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
}

.top-papers-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-paper-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.top-paper-item:hover {
    transform: translateX(4px);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.top-paper-rank {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-paper-content {
    flex: 1;
}

.top-paper-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 8px;
    line-height: 1.4;
}

.top-paper-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 0.85rem;
}

.bar-item {
    position: relative;
}

.bar-fill {
    position: relative;
}

.bar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 4px;
}

.bar-item:hover .bar-tooltip {
    opacity: 1;
}

.inst-avatar {
    font-size: 3.5rem;
}

/* Influence Prediction Styles */
.influence-pred-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.influence-pred-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.pred-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    transition: all 0.2s;
}

.pred-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pred-icon {
    font-size: 2rem;
    line-height: 1;
}

.pred-content {
    flex: 1;
}

.pred-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.pred-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.pred-subtext {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}

.pred-chart-section {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
}

.pred-chart-title {
    margin: 0 0 20px 0;
    font-size: 1.1rem;
    color: var(--foreground);
    font-weight: 600;
}

.pred-table-section {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
}

.pred-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.pred-table th,
.pred-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.pred-table th {
    background: var(--background);
    color: var(--foreground);
    font-weight: 600;
    font-size: 0.9rem;
}

.pred-table tbody tr:hover {
    background: var(--background);
}

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

.pred-disclaimer {
    margin-top: 16px;
    padding: 12px;
    background: rgba(237, 137, 54, 0.1);
    border-left: 3px solid #ED8936;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.6;
}

.pred-disclaimer strong {
    color: var(--foreground);
}

/* ---- Honors & Awards (author attributes) ---- */
.honors-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.honor-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.honor-group-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 600;
}

.honor-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.honor-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    line-height: 1.4;
    border: 1px solid transparent;
    cursor: default;
    max-width: 100%;
}

.honor-badge .honor-label {
    font-weight: 600;
}

.honor-badge .honor-year {
    color: var(--muted);
    font-size: 0.75rem;
}

.honor-badge .honor-org {
    color: var(--muted);
    font-size: 0.75rem;
}

.honor-badge .honor-zh {
    color: var(--muted);
    font-size: 0.72rem;
    margin-left: 2px;
}

.honor-nat {
    background: rgba(56, 161, 105, 0.12);
    color: #276749;
    border-color: rgba(56, 161, 105, 0.3);
}

.honor-title {
    background: rgba(66, 153, 225, 0.12);
    color: #2b6cb0;
    border-color: rgba(66, 153, 225, 0.3);
}

.honor-award {
    background: rgba(237, 137, 54, 0.15);
    color: #b7791f;
    border-color: rgba(237, 137, 54, 0.35);
}

.honor-position {
    background: rgba(128, 90, 213, 0.12);
    color: #553c9a;
    border-color: rgba(128, 90, 213, 0.3);
}

.honor-editorial {
    background: rgba(113, 128, 150, 0.15);
    color: #4a5568;
    border-color: rgba(113, 128, 150, 0.3);
}

/* Nationality inline badge (authors search list) */
.nat-badge {
    display: inline-block;
    margin-right: 6px;
    font-size: 0.9em;
    vertical-align: middle;
    line-height: 1;
    cursor: default;
}
.nat-badge.nat-cn { }
.nat-badge.nat-non { opacity: 0.55; }

/* Citation author enrichment */
.citation-authors {
    font-size: 0.85em;
    color: var(--muted, #666);
    margin-top: 4px;
    line-height: 1.4;
}
.citation-authors .author-link {
    color: var(--muted, #555);
    font-weight: 400;
}
.citation-authors .author-link:hover {
    color: var(--accent);
    text-decoration: underline;
}
.raw-citation-authors {
    font-size: 0.85em;
    margin: 6px 0 4px;
    line-height: 1.5;
}
.raw-citation-pre {
    white-space: pre-wrap;
    word-break: break-word;
}
.raw-citation-pre .author-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.08);
    padding: 0 2px;
    border-radius: 2px;
}
.raw-citation-pre .author-link:hover {
    background: rgba(59, 130, 246, 0.18);
    text-decoration: underline;
}
.ref-hero-authors .author-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    margin-right: 2px;
}
.ref-canonical .author-link {
    color: var(--accent);
    text-decoration: underline dotted;
    text-underline-offset: 2px;
}

/* ─── Reference page: author-attribute filter chips ─── */
.ref-attr-filter {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.ref-attr-filter__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.ref-attr-filter__clear {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 3px 10px;
    font-size: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
}
.ref-attr-filter__clear:hover {
    background: #f3f4f6;
    color: #374151;
}
.ref-attr-group {
    margin-top: 8px;
}
.ref-attr-group:first-child {
    margin-top: 0;
}
.ref-attr-group__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    font-weight: 600;
}
.ref-attr-group__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ref-attr-chips__loading {
    color: #9ca3af;
    font-size: 0.85rem;
}

.attr-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    line-height: 1.4;
    border: 1px solid;
    background: white;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.attr-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.attr-chip__value {
    font-weight: 500;
}
.attr-chip__zh {
    color: #9ca3af;
    font-size: 0.72rem;
}
.attr-chip__count {
    background: rgba(0,0,0,0.06);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #4b5563;
}

.attr-chip--nat {
    color: #276749;
    border-color: rgba(56,161,105,0.35);
}
.attr-chip--title {
    color: #2b6cb0;
    border-color: rgba(66,153,225,0.35);
}
.attr-chip--award {
    color: #b7791f;
    border-color: rgba(237,137,54,0.4);
}
.attr-chip--venue {
    color: #6b46c1;
    border-color: rgba(128,90,213,0.35);
}
.attr-chip--venue.attr-chip--active {
    background: #805ad5;
    border-color: #805ad5;
}

.attr-chip--active {
    color: white !important;
}
.attr-chip--nat.attr-chip--active {
    background: #38a169;
    border-color: #38a169;
}
.attr-chip--title.attr-chip--active {
    background: #4299e1;
    border-color: #4299e1;
}
.attr-chip--award.attr-chip--active {
    background: #ed8936;
    border-color: #ed8936;
}
.attr-chip--active .attr-chip__count {
    background: rgba(255,255,255,0.25);
    color: white;
}
.attr-chip--active .attr-chip__zh {
    color: rgba(255,255,255,0.75);
}

/* ─── Inline author + attribute badges (in citation list) ─── */
.author-with-attrs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.author-attr-badge {
    display: inline-block;
    font-size: 0.65rem;
    line-height: 1.2;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
    vertical-align: middle;
    cursor: default;
    white-space: nowrap;
}
.author-attr-badge--title {
    background: rgba(66,153,225,0.15);
    color: #2b6cb0;
    border: 1px solid rgba(66,153,225,0.3);
}
.author-attr-badge--award {
    background: rgba(237,137,54,0.18);
    color: #b7791f;
    border: 1px solid rgba(237,137,54,0.4);
}
.author-attr-badge--position {
    background: rgba(128,90,213,0.12);
    color: #553c9a;
    border: 1px solid rgba(128,90,213,0.3);
}
.author-attr-badge--editorial {
    background: rgba(113,128,150,0.15);
    color: #4a5568;
    border: 1px solid rgba(113,128,150,0.3);
}

/* Related Work PR-5 additions */
.rw-warnings {
    background: rgba(237, 137, 54, 0.08);
    border: 1px solid rgba(237, 137, 54, 0.35);
    color: #7b341e;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 12px 0 18px;
    font-size: 14px;
}
.rw-warnings.hidden { display: none; }
.rw-warnings-title { font-weight: 600; margin-bottom: 6px; }
.rw-warnings ul { margin: 0; padding-left: 20px; }
.rw-advanced {
    border: 1px dashed #cbd5e0;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    background: rgba(247, 250, 252, 0.6);
}
.rw-advanced > summary {
    cursor: pointer;
    font-weight: 600;
    padding: 4px 0;
    color: #2d3748;
}
.rw-advanced[open] > summary { margin-bottom: 8px; }
label .hint {
    color: #718096;
    font-weight: 400;
    font-size: 12px;
    margin-left: 6px;
}
