/**
 * Elementor Novel Loop Widget Styles
 */

/* 基础布局 */
.axiaoshuo-novel-loop {
    width: 100%;
}

/* 网格布局 */
.novel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* 列表布局 */
.novel-list {
    display: flex;
    flex-direction: column;
}

.novel-list .novel-item {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
}

.novel-list .novel-cover {
    flex: 0 0 150px;
    margin-right: 20px;
}

.novel-list .novel-content {
    flex: 1;
}

/* 小说项目 */
.novel-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.novel-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* 封面区域 */
.novel-cover {
    position: relative;
    overflow: hidden;
}

.novel-grid .novel-cover {
    aspect-ratio: 3/4;
}

.novel-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.novel-item:hover .novel-thumbnail {
    transform: scale(1.05);
}

.novel-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ccc;
}

/* 状态标签 */
.novel-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    z-index: 2;
}

.novel-badge.free-reading {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    animation: pulse-free 2s infinite;
}

.novel-badge.paid {
    background: linear-gradient(45deg, #ffa726, #ff9800);
}

.novel-badge.free {
    background: linear-gradient(45deg, #4caf50, #2e7d32);
}

.novel-badge.completed {
    top: 10px;
    left: 10px;
    right: auto;
    background: linear-gradient(45deg, #9c27b0, #673ab7);
}

@keyframes pulse-free {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 内容区域 */
.novel-content {
    padding: 15px;
}

.novel-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.4;
}

.novel-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.novel-title a:hover {
    color: #0073aa;
}

/* 元信息 */
.novel-meta {
     
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

/*.novel-meta span { */
  /*  background: #f8f9fa;*/
 /*   padding: 2px 6px;*/
  /*  border-radius: 4px;*/
 /*   white-space: nowrap;*/
/*}*/

.novel-meta .novel-author {
    background: #e3f2fd;
    color: #1976d2;
}

.novel-meta .novel-chapters {
    background: #f3e5f5;
    color: #7b1fa2;
}

.novel-meta .novel-rating {
    background: #fff3e0;
    color: #f57c00;
}

.novel-meta .novel-latest {
    background: #e8f5e8;
    color: #388e3c;
    flex: 1;
    min-width: 100%;
    margin-top: 5px;
}

/* 摘要 */
.novel-excerpt {
    font-size: 13px;
    line-height: 1.5;
    color: #666;
    margin-top: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .novel-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .novel-list .novel-cover {
        flex: 0 0 120px;
        margin-right: 15px;
    }
    
    .novel-content {
        padding: 12px;
    }
    
    .novel-title {
        font-size: 14px;
    }
    
    .novel-meta {
        font-size: 11px;
        gap: 8px;
    }
    
    .novel-excerpt {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .novel-grid {
        grid-template-columns: 1fr;
    }
    
    .novel-list .novel-item {
        flex-direction: column;
    }
    
    .novel-list .novel-cover {
        flex: none;
        margin-right: 0;
        margin-bottom: 10px;
        max-width: 200px;
        align-self: center;
    }
    
    .novel-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* 轮播布局 */
.novel-carousel {
    position: relative;
}

.novel-carousel .novel-grid {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    grid-auto-flow: column;
    grid-auto-columns: 300px;
}

.novel-carousel .novel-item {
    scroll-snap-align: start;
}

/* 自定义滚动条 */
.novel-carousel .novel-grid::-webkit-scrollbar {
    height: 6px;
}

.novel-carousel .novel-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.novel-carousel .novel-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.novel-carousel .novel-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 加载状态 */
.novel-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.novel-item.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 空状态 */
.axiaoshuo-novel-loop .no-novels {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.axiaoshuo-novel-loop .no-novels::before {
    content: '📚';
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
}

/* 特殊效果 */
.novel-item.featured {
    border: 2px solid #0073aa;
    box-shadow: 0 0 20px rgba(0,115,170,0.2);
}

.novel-item.featured .novel-title a {
    color: #0073aa;
}

.novel-item.hot {
    position: relative;
    overflow: visible;
}

.novel-item.hot::before {
    content: '🔥';
    position: absolute;
    top: -10px;
    left: -10px;
    background: #ff4444;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 10;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Elementor Loop模板样式 */
.elementor-loop-container .elementor-loop-item {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.elementor-loop-container.novel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.elementor-loop-container.novel-list .elementor-loop-item {
    flex-direction: row;
    align-items: flex-start;
}

/* 动态标签样式 */
.novel-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}

.novel-status-ongoing {
    background: linear-gradient(45deg, #4caf50, #2e7d32);
}

.novel-status-completed {
    background: linear-gradient(45deg, #9c27b0, #673ab7);
}

.novel-status-paused {
    background: linear-gradient(45deg, #ff9800, #f57c00);
}

.novel-author {
    color: #1976d2;
    font-weight: 500;
}

.novel-chapter-count {
    color: #7b1fa2;
    font-weight: 500;
}

.novel-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rating-stars {
    color: #FFD700;
    font-size: 14px;
}

.rating-stars .star.full {
    color: #FFD700;
}

.rating-stars .star.half {
    color: #FFD700;
    position: relative;
}

.rating-stars .star.half::before {
    content: "★";
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: #FFD700;
}

.rating-stars .star.empty {
    color: #CCCCCC;
}

.novel-price {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
}

.novel-price.free-reading {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: #fff;
    animation: pulse-free 2s infinite;
}

.novel-price.paid {
    background: linear-gradient(45deg, #ffa726, #ff9800);
    color: #fff;
}

.novel-price.free {
    background: linear-gradient(45deg, #4caf50, #2e7d32);
    color: #fff;
}

.novel-latest-chapter {
    color: #388e3c;
    font-size: 12px;
}

.novel-latest-chapter a {
    color: inherit;
    text-decoration: none;
}

.novel-latest-chapter a:hover {
    text-decoration: underline;
}

/* Loop模板专用响应式 */
@media (max-width: 768px) {
    .elementor-loop-container.novel-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .elementor-loop-container.novel-list .elementor-loop-item {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .elementor-loop-container.novel-grid {
        grid-template-columns: 1fr;
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .novel-item {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .novel-title a {
        color: #e0e0e0;
    }
    
    .novel-title a:hover {
        color: #4fc3f7;
    }
    
    .novel-meta {
        color: #bbb;
    }
    
    .novel-excerpt {
        color: #ccc;
    }
    
    .novel-placeholder {
        background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
        color: #666;
    }
    
    .novel-author {
        color: #64b5f6;
    }
    
    .novel-chapter-count {
        color: #ba68c8;
    }
    
    .novel-latest-chapter {
        color: #81c784;
    }
} 