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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #faf8f3;
    min-height: 100vh;
    color: #3a3a3a;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 50px 20px 40px;
    background: linear-gradient(135deg, #fff8ee 0%, #f5efe0 100%);
    border-bottom: 1px solid #e8e0d0;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #5b4636;
    margin-bottom: 10px;
}

header h1 i { color: #c49a6c; }

header p {
    color: #8a7a6a;
    font-size: 1.1rem;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.stat-item { text-align: center; }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #c49a6c;
    min-width: 5ch;
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    color: #a09080;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.filters {
    background: #fff;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #ece4d8;
}

.filters .filter-actions {
    display: flex;
    gap: 12px;
    flex-basis: 100%;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.filter-group label {
    font-size: 0.9rem;
    color: #7a6a5a;
    font-weight: 500;
    white-space: nowrap;
}

.filter-group label i { color: #c49a6c; }

select, input[type="text"] {
    background: #faf8f3;
    border: 1px solid #ddd4c6;
    border-radius: 8px;
    padding: 10px 15px;
    color: #3a3a3a;
    font-size: 0.95rem;
    min-width: 150px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.custom-select {
    position: relative;
    min-width: 150px;
    user-select: none;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #faf8f3;
    border: 1px solid #ddd4c6;
    border-radius: 10px;
    padding: 10px 14px;
    color: #3a3a3a;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 8px;
}

.custom-select-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.custom-select-trigger i {
    font-size: 0.7rem;
    color: #c49a6c;
    transition: transform 0.3s ease;
}

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

.custom-select-trigger:hover {
    border-color: #c49a6c;
}

.custom-select.open .custom-select-trigger {
    border-color: #c49a6c;
    box-shadow: 0 0 0 3px rgba(196, 154, 108, 0.15);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd4c6;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    padding: 4px;
}

.custom-select.open .custom-select-options {
    display: block;
    animation: slideDown 0.15s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-select-option {
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #3a3a3a;
    cursor: pointer;
    transition: all 0.15s ease;
}

.custom-select-option:hover {
    background: #f5efe6;
    color: #5b4636;
}

.custom-select-option.selected {
    background: #c49a6c;
    color: #fff;
    font-weight: 500;
}

select:hover, input[type="text"]:hover { border-color: #c49a6c; }

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: #c49a6c;
    box-shadow: 0 0 0 3px rgba(196, 154, 108, 0.15);
}

.filter-group .custom-select,
.filter-group select,
.filter-group input[type="text"] {
    flex: 1;
    min-width: 0;
}

.papers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 20px;
}

.paper-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    border: 1px solid #ece4d8;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
}

.paper-card:hover {
    transform: translateY(-3px);
    border-color: #c49a6c;
    box-shadow: 0 8px 30px rgba(196, 154, 108, 0.12);
}

.paper-venue {
    display: inline-block;
    width: fit-content;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    color: #fff;
}

.paper-type {
    display: inline-block;
    width: fit-content;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.paper-type-oral {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.paper-type-spotlight {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.paper-type-regular {
    background: #f5f5f5;
    color: #757575;
    border: 1px solid #e0e0e0;
}

.paper-type-award {
    background: linear-gradient(135deg, #ff8a00, #e52e71);
    color: #fff;
    border: none;
}

.venue-iclr    { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.venue-neurips { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.venue-icml    { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.venue-acl     { background: linear-gradient(135deg, #10b981, #34d399); }
.venue-emnlp   { background: linear-gradient(135deg, #f59e0b, #f97116); }
.venue-colm    { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }

.paper-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2d2418;
    margin-bottom: 10px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.paper-authors {
    font-size: 0.84rem;
    color: #8a7a6a;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.paper-authors i { color: #c49a6c; }

.paper-abstract {
    font-size: 0.88rem;
    color: #6a5a4a;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
}

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

.tag {
    background: #f5efe6;
    color: #7a6a5a;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.73rem;
    border: 1px solid #ece4d8;
}

.tag.area {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}

.tag.award {
    background: linear-gradient(135deg, #ff8a00, #e52e71);
    color: #fff;
    border: none;
}

.paper-links {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: auto;
}

.paper-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: #faf8f3;
    border: 1px solid #ece4d8;
    border-radius: 8px;
    color: #7a6a5a;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.paper-links a:hover {
    background: #c49a6c;
    color: #fff;
    border-color: #c49a6c;
}

.tldr {
    background: #fdf6ec;
    border-left: 3px solid #c49a6c;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 0 8px 8px 0;
    font-size: 0.84rem;
    color: #6a5a4a;
}

.tldr strong { color: #c49a6c; }

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

.pagination button {
    background: #fff;
    border: 1px solid #ddd4c6;
    color: #5b4636;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.pagination button:hover:not(:disabled) {
    background: #c49a6c;
    color: #fff;
    border-color: #c49a6c;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination span { color: #8a7a6a; font-size: 0.9rem; }

.page-info-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #8a7a6a;
    font-size: 0.9rem;
}

.page-info-wrapper input[type="number"] {
    width: 54px;
    min-width: 54px;
    background: #faf8f3;
    border: 1px solid #ddd4c6;
    border-radius: 8px;
    padding: 6px 8px;
    color: #3a3a3a;
    font-size: 0.9rem;
    text-align: center;
    font-family: inherit;
    -moz-appearance: textfield;
}

.page-info-wrapper input[type="number"]::-webkit-inner-spin-button,
.page-info-wrapper input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.page-info-wrapper input[type="number"]:focus {
    outline: none;
    border-color: #c49a6c;
    box-shadow: 0 0 0 3px rgba(196, 154, 108, 0.15);
}

.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #a09080;
    grid-column: 1 / -1;
}

.no-results i {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: #d4c4b4;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    color: #c49a6c;
    grid-column: 1 / -1;
}

.loading i {
    font-size: 2.5rem;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
    .papers-grid { grid-template-columns: 1fr; }
    header h1 { font-size: 1.8rem; }
    .filters { flex-direction: column; align-items: stretch; }
    .filter-group { flex-direction: column; align-items: stretch; }
    select, input[type="text"] { min-width: 100%; }
    .custom-select { min-width: 100%; }
    .modal { padding: 24px; }
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 10px;
    color: #a09080;
    font-size: 0.82rem;
}

footer a {
    color: #c49a6c;
    text-decoration: underline;
}

footer a:hover {
    color: #8a7a6a;
}
