/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

ul {
    list-style: none;
}

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

/* Header Styles */
.header {
    background-color: #e03a47;
    color: white;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    display: block;
}

.logo a {
    display: block;
    width: 40px;
    height: 40px;
    /* 移除白色背景 */
    border-radius: 5px;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* PC端导航样式 */
.header-right {
    display: flex;
    align-items: center;
}

.header nav {
    display: flex;
    align-items: center;
}

.header nav ul {
    display: flex;
    margin: 0;
    padding: 0;
}

.header nav ul li {
    margin-left: 20px;
    position: relative;
}

.header nav ul li a {
    padding: 5px 10px;
    font-weight: 500;
    color: white;
}

.header nav ul li a:hover {
    text-decoration: underline;
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    left: 0;
    top: 100%;
    border-radius: 5px;
}

.dropdown-content a {
    color: #333 !important;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown > a::after {
    content: " ▾";
    font-size: 0.8em;
}

/* 搜索框样式 */
.search-box {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.search-box input {
    padding: 8px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    width: 200px;
}

.search-box button {
    background-color: white;
    color: #e03a47;
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 8px 12px;
    cursor: pointer;
}

/* 汉堡菜单按钮默认隐藏 */
.menu-toggle {
    display: none;
}

/* 移动端遮罩层 */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.overlay.active {
    display: block;
}

/* Novel Grid Layout */
.trending-novels,
.latest-novels,
.ranked-novels,
.popular-novels,
.recommendations {
    padding: 20px 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.novel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.novel-card {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.novel-card:hover {
    transform: translateY(-5px);
}

.novel-image {
    position: relative;
    width: 100%;
    padding-top: 133%; /* 3:4 宽高比 */
    overflow: hidden;
}

.novel-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.new-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff4757;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.author-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 10px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.author-name {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.novel-details {
    padding: 8px 10px;
    background: white;
}

.novel-details h3 {
    margin: 0;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.novel-genre {
    margin: 4px 0 0;
    font-size: 12px;
    color: #666;
}

/* Section Titles */
.trending-novels h2,
.latest-novels h2,
.ranked-novels h2,
.popular-novels h2,
.recommendations h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    padding: 0;
}

/* New Releases Banner */
.new-releases {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.new-releases-banner {
    background: linear-gradient(to right, rgb(254,158,160), rgb(251,201,191));
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: white;
}

.new-releases-banner h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.new-releases-banner p {
    font-size: 1rem;
    opacity: 0.85;
    margin: 0;
}

/* Recommendations Section */
.recommendation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.recommendation-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.recommendation-card:hover {
    transform: translateY(-5px);
}

.recommendation-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.rating {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stars {
    color: #ffc107;
}

.rating-value {
    font-weight: bold;
}

.recommendation-card h3 {
    padding: 0 10px 10px;
    text-align: center;
    font-size: 1rem;
}

/* Footer */
footer {
    background-color: #222;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

.footer-brand {
    margin-bottom: 30px;
}

.footer-brand h3 {
    color: #e03a47;
    font-size: 24px;
    margin-bottom: 10px;
}

.footer-brand p {
    color: #ccc;
    font-size: 14px;
    max-width: 600px;
    margin: 0 auto;
}

.footer-links {
    margin-bottom: 30px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

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

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

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

.social-links a {
    color: #fff;
    background-color: #333;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.3s;
}

.social-links a:hover {
    background-color: #e03a47;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-size: 14px;
}

.footer-bottom p {
    color: #666;
    margin: 0;
}

.footer-legal {
    display: flex;
    gap: 20px;
}

.footer-legal a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-legal a:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-legal {
        justify-content: center;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .novel-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .novel-detail-container {
        padding: 0 15px;
    }
    
    .novel-info {
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .novel-grid, 
    .recommendation-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .novel-info {
        flex-direction: column;
    }
    
    .novel-cover {
        flex: none;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .novel-meta {
        text-align: center;
    }
    
    .bookmark-button button {
        margin: 0 auto;
    }
    
    .header-content {
        padding: 0 15px;
    }
    
    .search-box input {
        width: 150px;
    }
}

@media (max-width: 768px) {
    .logo {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        z-index: 1001;
        order: 1;
    }

    .menu-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: white;
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    .header-content {
        position: relative;
        padding: 10px 20px;
        display: flex;
        align-items: center;
    }

    .header nav {
        display: none;
    }
    
    /* 移动端搜索框样式，确保在移动端也显示 */
    .search-box {
        display: flex;
        flex: 1;
        margin: 0 15px;
        order: 2;
    }

    .search-box input {
        width: 100%;
        border-radius: 4px 0 0 4px;
    }
    
    .search-box button {
        border-radius: 0 4px 4px 0;
    }

    .header-right {
        position: fixed;
        top: 0;
        left: -100%; /* 从左侧滑入 */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: #e03a47;
        padding: 60px 20px 20px;
        transition: left 0.3s ease; /* 改为从左侧滑入 */
        z-index: 1000;
        overflow-y: auto;
        flex-direction: column;
        order: 3;
    }

    .header-right.active {
        left: 0; /* 改为从左侧滑入 */
    }

    .header-right nav {
        display: block;
        width: 100%;
    }

    .header-right .search-box {
        display: none;
    }

    .header-right nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-right: 0;
    }

    .header-right nav ul li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .header-right nav ul li a {
        display: block;
        padding: 15px;
        text-align: left;
    }
    
    .dropdown-content {
        position: static;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.1);
        box-shadow: none;
        display: none;
        padding: 0;
    }
    
    .dropdown-content.active {
        display: block;
    }
    
    .dropdown-content a {
        padding: 12px 30px;
        text-align: left;
        color: white !important;
    }
    
    .dropdown-content a:hover {
        background-color: rgba(0, 0, 0, 0.2);
    }

    /* 汉堡菜单动画 */
    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* 修复移动端页脚样式 */
@media (max-width: 768px) {
    footer {
        padding: 30px 0 15px;
    }
    
    .footer-content {
        padding: 0 15px;
    }
    
    .footer-brand h3 {
        font-size: 20px;
    }
    
    .footer-brand p {
        font-size: 12px;
    }
    
    .footer-links ul {
        gap: 10px;
    }
    
    .footer-links a {
        font-size: 12px;
    }
    
    .social-links {
        gap: 10px;
    }
    
    .social-links a {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .footer-bottom {
        padding: 15px;
    }
    
    .footer-bottom p {
        font-size: 12px;
    }
    
    .footer-legal {
        gap: 10px;
    }
    
    .footer-legal a {
        font-size: 12px;
    }
}

/* 板块标题样式 */
section h2 {
    font-size: 24px;
    color: #333;
   
}

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

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

.category-header h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
}

.category-header p {
    color: #666;
    font-size: 1rem;
}

.filter-tabs {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.filter-tabs span {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: #f5f5f5;
    color: #333;
}

.filter-tabs span.active {
    background-color: #e03a47;
    color: white;
}

.filter-tabs span:not(.active):hover {
    background-color: #eee;
    transform: translateY(-2px);
}

.category-novels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* 使用与首页相同的novel-card样式 */
.category-novels .novel-card {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-novels .novel-card:hover {
    transform: translateY(-5px);
}

.category-novels .novel-card.hidden {
    display: none;
    opacity: 0;
}

.category-novels .novel-image {
    position: relative;
    width: 100%;
    padding-top: 133%;
    overflow: hidden;
}

.category-novels .novel-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(30%) brightness(90%);
}

.category-novels .new-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4757;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.category-novels .author-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
}

.category-novels .author-name {
    font-size: 14px;
    font-weight: 500;
}

.category-novels .novel-details {
    padding: 12px;
    background: white;
}

.category-novels .novel-details h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-novels .novel-genre {
    margin: 5px 0 0;
    font-size: 14px;
    color: #666;
}

/* Novel Detail Page Styles */
.novel-detail-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.novel-info {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.novel-cover {
    flex: 0 0 300px;
    position: relative;
}

.novel-cover img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.novel-score {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    width: 80%;
}

.novel-score .score {
    font-size: 24px;
    font-weight: bold;
    color: #e03a47;
    display: block;
    margin-bottom: 5px;
}

.novel-score .stars {
    color: #ffc107;
    margin-bottom: 5px;
}

.novel-score .bookmark-count {
    font-size: 14px;
    color: #666;
}

.novel-meta {
    flex: 1;
    padding-top: 20px;
}

.novel-meta h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #333;
}

.meta-info {
    margin-bottom: 20px;
}

.meta-info span {
    display: inline-block;
    margin-right: 20px;
    color: #666;
}

.meta-info .ongoing {
    color: #4CAF50;
    font-weight: 500;
}

.post-info {
    margin-bottom: 20px;
}

.post-info span {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.author-info {
 
    color: #f0e9e9;
    font-size: 14px;
}

.bookmark-button button {
    background: #e03a47;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.bookmark-button button:hover {
    background: #c0313d;
}

.novel-description {
    background: white;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.novel-description p {
    color: #666;
    line-height: 1.6;
}

.chapters-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chapters-section h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.chapters-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f8f8;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.chapter-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.chapter-title {
    color: #333;
    font-weight: 500;
}

.chapter-time {
    color: #999;
    font-size: 14px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f8f8f8;
    color: #666;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #e03a47;
    color: white;
}

.pagination .active {
    background: #e03a47;
    color: white;
}

.pagination .ellipsis {
    color: #666;
}

@media (max-width: 768px) {
    .novel-info {
        flex-direction: column;
    }

    .novel-cover {
        flex: none;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .novel-meta {
        text-align: center;
    }

    .bookmark-button button {
        margin: 0 auto;
    }
}

/* 针对category-novels的移动端样式 */
@media (max-width: 768px) {
    .category-novels {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 10px 0;
    }
    
    .category-novels .novel-card {
        box-shadow: none;
        margin-bottom: 0;
    }
    
    .category-novels .novel-image {
        padding-top: 133%;
    }
    
    .category-novels .novel-details {
        padding: 8px 10px;
    }
    
    .category-novels .novel-details h3 {
        font-size: 14px;
    }
    
    .category-novels .novel-genre {
        font-size: 12px;
    }
    
    .category-novels .author-info {
        padding: 15px 10px 8px;
    }
    
    .category-novels .author-name {
        font-size: 12px;
    }
    
    .category-novels .new-tag {
        top: 8px;
        right: 8px;
        padding: 2px 6px;
        font-size: 12px;
    }
    
    .category-novels .novel-image img {
        filter: none;
    }
}

@media (max-width: 480px) {
    .category-novels {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .novel-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* 浏览量统计样式 */
.view-count {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    color: #888;
    font-weight: normal;
}

.novel-genre .view-count {
    float: right;
}

 