/* Custom Styles for NovelWeave */
* {
    font-family: 'Inter', sans-serif;
}

/* Dark mode utilities */
.dark {
    color-scheme: dark;
}

/* Novel Card Styles */
.novel-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.novel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/*
    这是文章详情的图片宽高比
 */
.aspect-\[2\/3\] {
    aspect-ratio: 1!important;
}

/*
    这是列表的图片宽高比
 */
.novel-card img {
    width: 100%;
    aspect-ratio: 2/3 !important;
    object-fit: cover;
}

.novel-card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 1rem;
    color: white;
}

.novel-card .title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.novel-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.novel-card .tag {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    background: rgba(236, 72, 153, 0.8);
    border-radius: 0.25rem;
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

.dark .loading-skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 1000px 100%;
}

/* Search Results */
#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.dark #search-results {
    background: #374151;
    border-color: #4b5563;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

.dark .search-result-item {
    border-bottom-color: #4b5563;
}

.search-result-item:hover {
    background-color: #f9fafb;
}

.dark .search-result-item:hover {
    background-color: #4b5563;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Category Cards */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 150px;
}

/* Smooth Transitions */
.transition-colors {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #374151;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.dark ::-webkit-scrollbar-thumb {
    background: #6b7280;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Chapter List Styles */
.chapter-list {
    display: grid;
    gap: 0.5rem;
}

.chapter-item {
    padding: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.dark .chapter-item {
    background: #374151;
    border-color: #4b5563;
}

.chapter-item:hover {
    background: #f9fafb;
    border-color: #ec4899;
}

.dark .chapter-item:hover {
    background: #4b5563;
    border-color: #ec4899;
}

/* Reading Page Styles */
.chapter-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 1.125rem;
    color: #1f2937;
}

.dark .chapter-content {
    color: #e5e7eb;
}

.chapter-content p {
    margin-bottom: 1.5rem;
    text-indent: 2em;
}

/* Table of Contents Sidebar */
.toc-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 100;
    overflow-y: auto;
}

.dark .toc-sidebar {
    background: #1f2937;
}

.toc-sidebar.open {
    right: 0;
}

.toc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
}

.toc-overlay.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toc-sidebar {
        width: 100%;
        right: -100%;
    }

    .chapter-content {
        font-size: 1rem;
    }
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
}

.btn-secondary {
    background: white;
    color: #ec4899;
    border: 2px solid #ec4899;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #fdf2f8;
}

.dark .btn-secondary {
    background: #374151;
    color: #ec4899;
}


/* Ad Slot Styles */
.ad-slot {
    width: 100%;
    background-color: #f3f4f6;
    border: 1px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.875rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.dark .ad-slot {
    background-color: #374151;
    border-color: #4b5563;
    color: #9ca3af;
}

.ad-slot::after {
    content: 'Advertisement';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 500;
    letter-spacing: 0.05em;
}

.ad-slot-header {
    height: 90px;
    max-width: 728px;
    margin: 1rem auto;
}

.ad-slot-sidebar {
    height: 250px;
    width: 300px;
    margin: 1rem auto;
}

.ad-slot-content {
    height: 250px;
    margin: 2rem 0;
    background-color: #f9fafb;
}

.dark .ad-slot-content {
    background-color: #1f2937;
}