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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.95;
}

.date-display {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 1.1em;
    color: #667eea;
    font-weight: 600;
}

.loading {
    text-align: center;
    color: white;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #ff6b6b;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
}

.papers-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.date-section {
    margin-top: 30px;
    margin-bottom: 20px;
}

.date-section:first-child {
    margin-top: 0;
}

.date-header {
    font-size: 1.8em;
    color: white;
    text-align: left;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.paper-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.paper-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.paper-rank {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
}

.paper-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2d3748;
    line-height: 1.4;
    padding-right: 50px;
}

.paper-upvotes {
    display: inline-block;
    background: #f7fafc;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    color: #4a5568;
    margin-bottom: 15px;
}

.paper-upvotes::before {
    content: "⬆️ ";
}

.paper-summary {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.paper-status {
    font-size: 0.85em;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
}

.status-completed {
    background: #c6f6d5;
    color: #22543d;
}

.status-pending {
    background: #feebc8;
    color: #7c2d12;
}

.status-error {
    background: #fed7d7;
    color: #742a2a;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

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

.close {
    color: #aaa;
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #667eea;
}

.modal-header {
    margin-bottom: 30px;
}

.modal-title {
    font-size: 2em;
    color: #2d3748;
    margin-bottom: 15px;
    line-height: 1.3;
}

.modal-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    align-items: center;
}

.language-toggle {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.lang-btn {
    padding: 8px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.lang-btn:hover {
    background: #f7fafc;
    transform: translateY(-2px);
}

.lang-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.chinese-summary {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.9;
}

.meta-item {
    background: #f7fafc;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.summary-section {
    margin-bottom: 30px;
}

.summary-section h3 {
    color: #667eea;
    font-size: 1.3em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.summary-section p {
    line-height: 1.8;
    color: #4a5568;
    white-space: pre-wrap;
}

.markdown-content {
    line-height: 1.8;
    color: #4a5568;
}

.markdown-content p {
    margin-bottom: 1em;
}

.markdown-content code {
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.markdown-content pre {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: #2d3748;
}

.markdown-content ul, .markdown-content ol {
    margin-left: 20px;
    margin-bottom: 1em;
}

.markdown-content li {
    margin-bottom: 0.5em;
}

.markdown-content strong {
    font-weight: 600;
    color: #2d3748;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content .katex {
    font-size: 1.1em;
}

.markdown-content .katex-display {
    margin: 1.5em 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.paper-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.paper-link {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s;
}

.paper-link:hover {
    transform: scale(1.05);
}

footer {
    text-align: center;
    color: white;
    padding: 30px;
    margin-top: 40px;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .papers-container {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 30px 20px;
        margin: 10% auto;
        width: 95%;
    }

    .modal-title {
        font-size: 1.5em;
    }
}
