/* ── Reset & Base (papers page only) ── */
.papers-page *, .papers-page *::before, .papers-page *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.papers-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fafafa;
    color: #1a1a2e;
    line-height: 1.6;
    min-height: 100vh;
}

.papers-page a { text-decoration: none; color: inherit; }

/* ── Layout ── */
.page-wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ── Header ── */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #111;
    margin-bottom: 0.25rem;
}

.page-header p {
    color: #6b7280;
    font-size: 0.95rem;
}

/* ── Search ── */
.search-bar {
    position: relative;
    margin-bottom: 1rem;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: #1a1a2e;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-bar input::placeholder {
    color: #9ca3af;
}

.search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.search-icon svg {
    width: 18px;
    height: 18px;
}

/* ── Tags filter ── */
.tags-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag-btn {
    padding: 0.375rem 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    font-size: 0.8rem;
    font-family: inherit;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.tag-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.tag-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* ── Results counter ── */
.results-info {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

/* ── Paper list ── */
.papers-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.paper-item {
    background: #fff;
    padding: 1.25rem 1.5rem;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.paper-item:hover {
    background: #f9fafb;
}

.paper-item.hidden {
    display: none;
}

/* Top row: year + venue */
.paper-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.paper-year {
    font-weight: 600;
    color: #6b7280;
}

.paper-venue {
    padding: 0.125rem 0.5rem;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Title */
.paper-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111;
    line-height: 1.4;
    transition: color 0.2s;
}

.paper-title-link:hover .paper-title {
    color: #2563eb;
}

/* Authors */
.paper-authors {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Tags row */
.paper-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.paper-tag {
    padding: 0.175rem 0.6rem;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
    display: none;
}

.empty-state.visible {
    display: block;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ── Footer ── */
.page-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
}

.page-footer a {
    color: #6b7280;
    transition: color 0.2s;
}

.page-footer a:hover {
    color: #2563eb;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .page-wrapper {
        padding: 1.25rem 1rem 3rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .paper-item {
        padding: 1rem 1.125rem;
    }

    .paper-title {
        font-size: 0.95rem;
    }
}
