/* 全局样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
        }

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

        a {
            text-decoration: none;
            color: #2c3e50;
            transition: color 0.3s;
        }

        a:hover {
            color: #3498db;
        }

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

        /* 头部样式 */
        header {
            background-color: #fff;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 0;
            position: relative;
            transition: all 0.3s ease;
            min-height: 70px; /* 固定高度，避免变化 */
        }

        .logo {
            font-size: 28px;
            font-weight: bold;
            color: #2c3e50;
            transition: opacity 0.3s ease;
        }

        .logo span {
            color: #3498db;
        }

        .search-box {
            display: flex;
            width: 50%;
        }

        .search-box input {
            flex: 1;
            padding: 10px 15px;
            border: 1px solid #ddd;
            border-radius: 4px 0 0 4px;
            font-size: 16px;
        }

        .search-box button {
            padding: 10px 20px;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 0 4px 4px 0;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .search-box button:hover {
            background-color: #2980b9;
        }

        .user-actions {
            display: flex;
            align-items: center;
            gap: 15px;
            transition: opacity 0.3s ease;
        }

        .user-actions a {
            font-size: 14px;
        }

        .login-btn {
            padding: 8px 16px;
            background-color: #3498db;
            color: white;
            border-radius: 4px;
            transition: background-color 0.3s;
        }

        .login-btn:hover {
            background-color: #2980b9;
            color: white;
        }

        nav {
            background-color: #2c3e50;
        }

        .nav-menu {
            display: flex;
            list-style: none;
        }

        .nav-menu li {
            position: relative;
        }

        .nav-menu a {
            display: block;
            padding: 15px 20px;
            color: white;
            font-size: 16px;
        }

        .nav-menu a:hover {
            background-color: #34495e;
        }

        /* 主要内容区域 */
        .main-content {
            display: flex;
            margin: 20px 0;
            gap: 20px;
        }

        .content {
            flex: 3;
        }

        .sidebar {
            flex: 1;
        }

        /* 轮播图样式 */
        .banner {
            margin-bottom: 30px;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .banner img {
            width: 100%;
            height: auto;
            display: block;
        }

        /* 板块样式 */
        .section {
            background-color: white;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 30px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
        }

        .section-title {
            font-size: 22px;
            color: #2c3e50;
            font-weight: bold;
        }

        .more-link {
            font-size: 14px;
            color: #3498db;
        }

        /* 小说列表样式 - 优化封面尺寸适配 */
        .novel-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 20px;
        }
        
        .novel-item {
            background-color: #fff;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
            cursor: pointer;
            display: flex;
            flex-direction: column;
        }
        
        .novel-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
        }
        
        /* 优化封面容器，适配278×352比例 */
        .novel-cover-container {
            width: 100%;
            position: relative;
            overflow: hidden;
            background-color: #f8f9fa; /* 加载时的背景色 */
        }
        
        .novel-cover {
            width: 100%;
            height: auto;
            aspect-ratio: 278 / 352; /* 保持原始比例 */
            object-fit: cover;
            display: block;
            transition: transform 0.3s ease;
        }
        
        .novel-item:hover .novel-cover {
            transform: scale(1.05);
        }
        
        .novel-info {
            padding: 15px;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            min-height: 110px; /* 确保信息区域有足够高度 */
        }
        
        .novel-title {
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 8px;
            color: #2c3e50;
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .novel-author {
            font-size: 14px;
            color: #7f8c8d;
            margin-bottom: 10px;
        }
        
        .novel-stats {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: #95a5a6;
        }
        
        .novel-rating {
            color: #f39c12;
            font-weight: bold;
        }

        /* 排行榜样式 */
        .rank-list {
            list-style: none;
        }

        .rank-item {
            display: flex;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px dashed #eee;
        }

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

        .rank-num {
            width: 24px;
            height: 24px;
            background-color: #f1f1f1;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 15px;
            font-size: 14px;
            font-weight: bold;
        }

        .rank-num.top3 {
            background-color: #3498db;
            color: white;
        }

        .rank-info {
            flex: 1;
        }

        .rank-title {
            font-size: 16px;
            margin-bottom: 5px;
        }

        .rank-author {
            font-size: 14px;
            color: #7f8c8d;
        }

        /* 分类导航样式 */
        .category-links {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .category-link {
            display: inline-block;
            padding: 8px 15px;
            background-color: #f1f1f1;
            border-radius: 4px;
            font-size: 14px;
            transition: all 0.3s;
        }

        .category-link:hover {
            background-color: #3498db;
            color: white;
        }

        /* 底部样式优化 */
        footer {
            background-color: #2c3e50;
            color: #ecf0f1;
            padding: 40px 0 20px;
            margin-top: 40px;
        }

        .footer-content {
            display: flex;
            justify-content: space-between;
            margin-bottom: 30px;
            flex-wrap: wrap;
        }

        .footer-section {
            flex: 1;
            min-width: 250px;
            padding: 0 15px;
            margin-bottom: 20px;
        }

        .footer-section h3 {
            font-size: 18px;
            margin-bottom: 20px;
            color: #3498db;
            position: relative;
            padding-bottom: 10px;
        }

        .footer-section h3::after {
            content: '';
            position: absolute;
            left: 0;
            bottom: 0;
            width: 40px;
            height: 2px;
            background-color: #3498db;
        }

        .footer-desc {
            font-size: 14px;
            line-height: 1.6;
            margin-bottom: 20px;
            color: #bdc3c7;
        }

        .contact-info p {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
            font-size: 14px;
        }

        .contact-info .icon {
            margin-right: 10px;
            font-size: 16px;
        }

        .footer-links {
            list-style: none;
        }

        .footer-links li {
            margin-bottom: 10px;
        }

        .footer-links a {
            color: #bdc3c7;
            transition: all 0.3s;
            font-size: 14px;
            display: block;
            padding: 5px 0;
        }

        .footer-links a:hover {
            color: #3498db;
            padding-left: 5px;
        }

        /* 社交媒体链接样式 */
        .social-links {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }

        .social-link {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            background-color: #34495e;
            border-radius: 50%;
            color: white;
            transition: all 0.3s;
            position: relative;
        }

        .social-link:hover {
            background-color: #3498db;
            transform: translateY(-3px);
        }

        .social-link span {
            font-size: 12px;
        }

        /* 订阅表单样式 */
        .newsletter p {
            font-size: 14px;
            margin-bottom: 10px;
            color: #bdc3c7;
        }

        .subscribe-form {
            display: flex;
            margin-top: 10px;
        }

        .subscribe-form input {
            flex: 1;
            padding: 10px;
            border: 1px solid #34495e;
            border-radius: 4px 0 0 4px;
            background-color: #34495e;
            color: white;
            font-size: 14px;
        }

        .subscribe-form input::placeholder {
            color: #95a5a6;
        }

        .subscribe-form button {
            padding: 10px 15px;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 0 4px 4px 0;
            cursor: pointer;
            transition: background-color 0.3s;
            font-size: 14px;
        }

        .subscribe-form button:hover {
            background-color: #2980b9;
        }

        /* 友情链接样式 */
        .friend-links {
            border-top: 1px solid #34495e;
            padding-top: 20px;
            margin-bottom: 20px;
        }

        .friend-links h4 {
            font-size: 16px;
            margin-bottom: 15px;
            color: #bdc3c7;
        }

        .friend-links-container {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .friend-links-container a {
            color: #95a5a6;
            font-size: 13px;
            transition: color 0.3s;
        }

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

        /* 版权信息样式 */
        .copyright {
            text-align: center;
            padding-top: 20px;
            border-top: 1px solid #34495e;
            font-size: 12px;
            color: #95a5a6;
        }

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

        .copyright a {
            color: #95a5a6;
            transition: color 0.3s;
        }

        .copyright a:hover {
            color: #3498db;
        }

        /* 返回顶部按钮样式 */
        #back-to-top {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 50px;
            height: 50px;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            transition: all 0.3s;
            opacity: 0;
            visibility: hidden;
            z-index: 999;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
        }

        #back-to-top.show {
            opacity: 1;
            visibility: visible;
        }

        #back-to-top:hover {
            background-color: #2980b9;
            transform: translateY(-3px);
        }

        /* 移动端优化样式 */
        .mobile-menu-toggle {
            display: none;
            background: none;
            border: none;
            font-size: 24px;
            color: #2c3e50;
            cursor: pointer;
            padding: 5px;
            border-radius: 4px;
            transition: background-color 0.3s;
            z-index: 1002;
        }

        .mobile-menu-toggle:hover {
            background-color: #f1f1f1;
        }

        .mobile-menu-toggle.active {
            background-color: #3498db;
            color: white;
        }

        /* 新的移动端搜索按钮样式 */
        .mobile-search-toggle {
            display: none;
            background: none;
            border: none;
            color: #2c3e50;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            background-color: #f1f1f1;
            transition: all 0.3s;
            z-index: 1002;
            width: 44px;
            height: 44px;
            align-items: center;
            justify-content: center;
        }

        .mobile-search-toggle:hover {
            background-color: #e0e0e0;
            transform: scale(1.1);
        }

        .mobile-search-toggle.active {
            background-color: #3498db;
            color: white;
        }

        .mobile-search-toggle svg {
            width: 20px;
            height: 20px;
            fill: currentColor;
        }

        /* 移动端搜索容器 */
        .mobile-search-container {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: white;
            z-index: 1001;
            align-items: center;
            padding: 0 15px;
        }

        .mobile-search-container.active {
            display: flex;
            animation: slideIn 0.3s ease;
        }

        .mobile-search-box {
            width: 100%;
            display: flex;
            background: white;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid #ddd;
            height: 50px; /* 固定搜索框高度 */
        }

        .mobile-search-box input {
            flex: 1;
            padding: 12px 15px;
            border: none;
            font-size: 16px;
            outline: none;
            background: transparent;
        }

        .mobile-search-box button {
            padding: 0 15px;
            background-color: #3498db;
            color: white;
            border: none;
            cursor: pointer;
            transition: background-color 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .mobile-search-box button:hover {
            background-color: #2980b9;
        }

        .mobile-search-box button svg {
            width: 18px;
            height: 18px;
            fill: currentColor;
        }

        .mobile-search-close {
            background: none;
            border: none;
            color: #2c3e50;
            font-size: 24px;
            cursor: pointer;
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background-color 0.3s;
            margin-left: 10px;
        }

        .mobile-search-close:hover {
            background-color: #f1f1f1;
        }

        /* 移动端登录按钮样式 */
        .mobile-login-btn {
            display: none;
            padding: 8px 16px;
            background-color: #3498db;
            color: white;
            border-radius: 4px;
            font-size: 14px;
            transition: background-color 0.3s;
        }

        .mobile-login-btn:hover {
            background-color: #2980b9;
        }

        /* 动画效果 */
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 响应式设计 - 优化移动端体验 */
        @media (max-width: 992px) {
            .main-content {
                flex-direction: column;
            }

            .novel-list {
                grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            }

            .footer-content {
                flex-direction: column;
            }

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

        @media (max-width: 768px) {
            .header-top {
                flex-wrap: wrap;
                padding: 10px 0;
                min-height: 60px; /* 移动端固定高度 */
            }

            .logo {
                font-size: 24px;
                margin-bottom: 0;
            }

            .search-box {
                display: none;
            }

            .mobile-search-toggle {
                display: flex;
            }

            .user-actions {
                display: flex;
                align-items: center;
                gap: 10px;
            }

            .user-actions a {
                font-size: 12px;
            }

            .login-btn {
                display: none;
            }

            .mobile-login-btn {
                display: block;
            }

            .mobile-menu-toggle {
                display: block;
            }

            .nav-menu {
                display: none;
                flex-direction: column;
                width: 100%;
                position: absolute;
                top: 100%;
                left: 0;
                background-color: #2c3e50;
                z-index: 1001;
                max-height: 70vh;
                overflow-y: auto;
                box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            }

            .nav-menu.active {
                display: flex;
            }

            .nav-menu li {
                width: 100%;
                border-bottom: 1px solid #34495e;
            }

            .nav-menu a {
                padding: 12px 20px;
            }

            .novel-list {
                grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
                gap: 15px;
            }

            .novel-title {
                font-size: 15px;
            }

            .novel-author {
                font-size: 13px;
            }

            .section {
                padding: 15px;
            }

            .section-title {
                font-size: 18px;
            }

            .banner {
                margin-bottom: 20px;
            }

            .main-content {
                margin: 15px 0;
                gap: 15px;
            }

            /* 移动端优化：增加触摸友好的按钮大小 */
            .category-link, .mobile-login-btn, .mobile-search-toggle {
                min-height: 44px;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            /* 移动端优化：增加触摸友好的小说卡片 */
            .novel-item {
                min-height: 280px;
            }

            /* 搜索激活时隐藏其他元素 */
            .header-top.search-active .mobile-menu-toggle,
            .header-top.search-active .logo,
            .header-top.search-active .user-actions {
                display: none;
            }
            
            .header-top.search-active .mobile-search-container {
                display: flex;
            }
        }

        @media (max-width: 480px) {
            .nav-menu li {
                flex: 1 0 100%;
            }

            .section-title {
                font-size: 16px;
            }

            #back-to-top {
                bottom: 20px;
                right: 20px;
                width: 44px;
                height: 44px;
                font-size: 18px;
            }

            .logo {
                font-size: 20px;
            }

            .user-actions {
                gap: 8px;
            }

            .mobile-login-btn {
                padding: 8px 14px;
                font-size: 13px;
            }

            .mobile-menu-toggle, .mobile-search-toggle {
                padding: 8px;
            }

            .section {
                padding: 12px;
                margin-bottom: 20px;
            }

            .main-content {
                margin: 12px 0;
                gap: 12px;
            }

            /* 移动端优化：侧边栏在移动端隐藏部分内容 */
            .sidebar .section:nth-child(n+3) {
                display: none;
            }
        }

        /* 移动端优化：添加滑动效果 */
        .nav-menu {
            transition: max-height 0.3s ease;
        }

        /* 移动端优化：添加小说卡片点击反馈 */
        .novel-item:active {
            transform: scale(0.98);
            transition: transform 0.1s;
        }

        /* 移动端优化：改善分类导航在移动端的显示 */
        @media (max-width: 768px) {
            .category-links {
                gap: 8px;
            }
            
            .category-link {
                padding: 10px 12px;
                font-size: 13px;
                flex: 1 0 calc(33.333% - 8px);
                text-align: center;
            }
        }

        /* 移动端优化：改善排行榜在移动端的显示 */
        @media (max-width: 768px) {
            .rank-item {
                padding: 10px 0;
            }
            
            .rank-title {
                font-size: 14px;
            }
            
            .rank-author {
                font-size: 12px;
            }
        }
        
        
        
        
        
        
        
        
        
        
        /* 响应式设计 - 优化封面在不同屏幕的显示 */
@media (max-width: 992px) {
    .novel-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 18px;
    }
    
    .novel-info {
        padding: 12px;
        min-height: 100px;
    }
    
    .novel-title {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .novel-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .novel-info {
        padding: 10px;
        min-height: 95px;
    }
    
    .novel-title {
        font-size: 14px;
    }
    
    .novel-author {
        font-size: 13px;
    }
    
    .novel-stats {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .novel-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .novel-info {
        padding: 8px;
        min-height: 90px;
    }
    
    .novel-title {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .novel-author {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .novel-stats {
        font-size: 10px;
    }
}

/* 特别针对封面比例优化的小屏幕适配 */
@media (max-width: 360px) {
    .novel-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .novel-cover {
        /* 在小屏幕上保持比例但稍微压缩高度 */
        aspect-ratio: 278 / 320;
    }
}

/* 为不支持aspect-ratio的浏览器提供备用方案 */
@supports not (aspect-ratio: 278 / 352) {
    .novel-cover {
        height: 240px; /* 备用高度 */
    }
    
    @media (max-width: 768px) {
        .novel-cover {
            height: 200px;
        }
    }
    
    @media (max-width: 480px) {
        .novel-cover {
            height: 180px;
        }
    }
}

/* 优化加载效果 */
.novel-cover {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.novel-cover.loaded {
    animation: none;
    background: none;
}

/* 优化侧边栏排行榜中的封面显示 */
.rank-item {
    display: flex;
    align-items: flex-start; /* 改为顶部对齐，更好地适应封面 */
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
}

.rank-cover {
    width: 50px;
    height: 63px; /* 保持278:352比例的小尺寸 */
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
}

.rank-info {
    flex: 1;
    min-width: 0; /* 防止内容溢出 */
}

.rank-title {
    font-size: 16px;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rank-author {
    font-size: 14px;
    color: #7f8c8d;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 移动端排行榜优化 */
@media (max-width: 768px) {
    .rank-cover {
        width: 45px;
        height: 57px;
        margin-right: 10px;
    }
    
    .rank-title {
        font-size: 14px;
    }
    
    .rank-author {
        font-size: 12px;
    }
}