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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8f9fa;
    color: #2d3748;
    line-height: 1.6;
}

.header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.filters input, .filters select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    flex: 1 1 150px;
    transition: border-color 0.2s;
}

.filters input:focus, .filters select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
}

.btn-secondary {
    background: #edf2f7;
    color: #2d3748;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-icon {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.btn-icon img {
    width: 24px;
    height: 24px;
    display: block;
}

.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
}

.entry {
    background: white;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.entry h3 {
    font-size: 1.125rem;
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.entry h3 a {
    color: #2b6cb0;
    text-decoration: none;
}

.entry h3 a:hover {
    text-decoration: underline;
}

.icons {
    font-size: 0.75rem;
    color: #718096;
    background: #f7fafc;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.author {
    font-size: 0.875rem;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.author a {
    color: #4299e1;
    text-decoration: none;
    font-weight: 500;
}

.author a:hover {
    text-decoration: underline;
}

.description {
    font-size: 0.875rem;
    color: #4a5568;
    margin: 0.5rem 0;
}

.story-preview {
    cursor: pointer;
    padding: 0.75rem;
    background: #e8e8e8;
    border-radius: 0.375rem;
    margin: 0.75rem 0;
    font-size: 0.875rem;
    color: #2d3748;
    max-height: 8em;
    overflow: hidden;
    text-align: justify;
    position: relative;
    transition: background 0.2s;
    line-height: 1.6;
}

.story-preview p {
    margin: 0 0 0.5em 0;
}

.story-preview p:last-child {
    margin-bottom: 0;
}

.story-preview:hover {
    background: #d8d8d8;
}

.story-preview.no-preview {
    color: #a0aec0;
    font-style: italic;
    cursor: default;
}

.story-preview.no-preview:hover {
    background: #e8e8e8;
}

.date {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 0.5rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.no-results p {
    font-size: 1.125rem;
}

.no-results-hint {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    color: #a0aec0;
}

.preview-container {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.preview-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.5rem;
}

.preview-content {
    flex: 1;
    overflow: hidden;
    border-radius: 0.375rem;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preview-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    overflow: auto;
}

.preview-placeholder {
    color: #a0aec0;
    text-align: center;
    padding: 2rem;
}

.preview-placeholder svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.hint {
    font-size: 0.75rem;
}

/* Pagination Styles */
.pagination {
    background: white;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-top: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.pagination-info {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 0.75rem;
    text-align: center;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.pagination-numbers a,
.pagination-numbers .current,
.pagination-ellipsis {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination-numbers a {
    color: #4299e1;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

.pagination-numbers a:hover {
    background: #edf2f7;
    border-color: #bee3f8;
}

.pagination-numbers .current {
    background: #4299e1;
    color: white;
    border: 1px solid #4299e1;
    font-weight: 600;
}

.pagination-ellipsis {
    color: #a0aec0;
    padding: 0.375rem 0.25rem;
}

.pagination-arrow {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    text-decoration: none;
    color: #4299e1;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.pagination-arrow:hover {
    background: #edf2f7;
    border-color: #bee3f8;
}

.pagination-goto {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-goto label {
    font-size: 0.875rem;
    color: #4a5568;
}

.goto-input {
    width: 60px;
    padding: 0.375rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    text-align: center;
}

.goto-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 1rem;
    }
    
    .sidebar {
        width: 100%;
        height: 300px;
        position: relative;
        top: 0;
    }
    
    .filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }
    
    .filters input,
    .filters select {
        flex: 1 1 auto;
        min-width: 120px;
        width: auto;
    }
    
    .filters .btn,
    .filters .btn-secondary {
        flex: 0 0 auto;
    }
    
    .filters .btn-icon {
        flex: 0 0 auto;
    }

    .pagination-controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .pagination-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-goto {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .pagination-goto form {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}