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

a {
    text-decoration: none;
    color: inherit;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

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

/* 文字防溢出通用样式 */
.text-overflow {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-overflow-multi {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

/* 头部样式 */
.header {
    background: #fff;
    padding: 25px 0 0 0;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-box {
    display: flex;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.search-box input {
    border: none;
    padding: 12px 18px;
    outline: none;
    width: 320px;
    font-size: 15px;
}

.search-box button {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}

.search-box button:hover {
    background: #34495e;
}

/* 导航菜单 */
.nav-wrapper {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 0 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-menu {
    display: flex;
    justify-content: flex-start;
    gap: 0;
}

.nav-menu a {
    text-decoration: none;
    color: #ecf0f1;
    padding: 10px 20px;
    position: relative;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    overflow: hidden;
    white-space: nowrap;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: #3498db;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-menu a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu a:hover::before {
    width: 80%;
}

.nav-menu a.active {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.nav-menu a.active::before {
    width: 80%;
}

/* 通用区块样式 */
.section {
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 25px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 小说卡片样式 */
.novel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.novel-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.novel-card {
    display: flex;
    padding: 15px;
    border: 1px solid #e9ecef;
    transition: box-shadow 0.2s;
    min-height: 110px;
}

.novel-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.novel-cover {
    width: 75px;
    height: 110px;
    background: #e9ecef;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
    overflow: hidden;
}

.novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.novel-info {
    flex: 1;
    min-width: 0;
}

.novel-title {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.novel-author {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.novel-desc {
    color: #888;
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

/* 更新列表样式 */
.update-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 15px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
    font-size: 14px;
    min-height: 40px;
}

.update-item:last-child {
    border-bottom: none;
}

.update-item:hover {
    background: #f8f9fa;
}

.update-category {
    color: #3498db;
    font-size: 12px;
    background: #e8f4fd;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

.update-title {
    color: #333;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.update-title:hover {
    color: #2c3e50;
}

.update-chapter {
    color: #666;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
    flex-shrink: 0;
}

.update-author {
    color: #666;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80px;
    flex-shrink: 0;
}

.update-time {
    color: #666;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 排行榜样式 */
.ranking-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f8f9fa;
    font-size: 14px;
    min-height: 40px;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background: #f8f9fa;
}

.rank-number {
    width: 20px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    margin-right: 12px;
    flex-shrink: 0;
}

.ranking-title {
    flex: 1;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.ranking-author {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80px;
    flex-shrink: 0;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 14px;
}

.pagination a:hover {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.pagination .current {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.pagination .disabled {
    color: #999;
    cursor: not-allowed;
}

.pagination .disabled:hover {
    background: none;
    color: #999;
    border-color: #e9ecef;
}

/* 分类页面专用样式 */
.category-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.hot-ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
    font-size: 14px;
    min-height: 40px;
}

.hot-ranking-item:last-child {
    border-bottom: none;
}

.hot-ranking-item:hover {
    background: #f8f9fa;
}

.hot-title {
    color: #333;
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    margin-right: 10px;
}

.hot-title:hover {
    color: #2c3e50;
}

.hot-tag {
    color: #666;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80px;
    flex-shrink: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box input {
        width: 250px;
    }
    
    .nav-wrapper {
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-menu a {
        text-align: left;
        padding: 15px 20px;
    }
    
    .nav-menu a::before {
        left: 0;
        transform: none;
        width: 0;
        height: 3px;
    }
    
    .nav-menu a:hover::before {
        width: 100%;
    }
    
    .novel-grid,
    .novel-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .category-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .update-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .update-category,
    .update-chapter,
    .update-author,
    .update-time {
        max-width: none;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 13px;
    }
}


/* 分类 */
.novel-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1024px) {
    .novel-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .novel-grid-4 {
        grid-template-columns: 1fr;
    }
}


/* 底部样式 */
.footer {
    color: #ecf0f1;
    padding: 10px 0;
    border-top: 3px solid #34495e;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #3498db;
}

.copyright {
    color: #95a5a6;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.copyright p {
    margin-bottom: 5px;
}

.footer-notice {
    color: #7f8c8d;
    font-size: 12px;
    line-height: 1.5;
    max-width: 800px;
    margin: 0 auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .footer {
        max-width: 768px;
    }
    
    .footer-links {
        gap: 20px;
        margin-bottom: 15px;
    }
    
    .footer-links a {
        font-size: 13px;
    }
    
    .copyright {
        font-size: 12px;
    }
    
    .footer-notice {
        font-size: 11px;
        padding: 0 10px;
    }
}