* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

.main-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.content-left {
    width: 100%;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-close:hover {
    transform: scale(1.2);
}

.modal-body {
    padding: 1.5rem;
    line-height: 1.6;
}

.modal-body ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-link {
    color: #667eea;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #667eea;
}

.modal-link:hover {
    color: #764ba2;
    background: #eef2ff;
}

.modal-footer {
    padding: 1rem;
    text-align: right;
    border-top: 1px solid #eee;
}

.modal-confirm-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 移动端推荐栏 */
.mobile-recommend-sidebar {
    display: block;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin: 1rem 0;
}

/* 桌面端推荐栏 */
.desktop-recommend-sidebar {
    display: none;
}

/* 推荐栏样式 */
.recommend-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #eee;
}

.recommend-header h3 {
    color: #667eea;
    font-size: 1.1rem;
    margin: 0;
}

.recommend-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.recommend-item {
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.recommend-item:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.recommend-item h4 {
    font-size: 0.9rem;
    margin: 0 0 0.4rem 0;
    color: inherit;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.recommend-price {
    font-size: 1rem;
    color: #ff6b6b;
    font-weight: bold;
    margin-top: 0.4rem;
}

.recommend-item:hover .recommend-price {
    color: white;
}

.recommend-intro {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.4rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommend-item:hover .recommend-intro {
    color: rgba(255, 255, 255, 0.9);
}

/* 捆绑包信息样式 */
.bundle-info {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.bundle-info h3 {
    color: #856404;
    margin: 0 0 0.8rem 0;
    font-size: 1rem;
    text-align: center;
}

.bundle-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.bundle-item {
    background: white;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    transition: all 0.3s;
    cursor: pointer;
}

.bundle-item:hover {
    background: #fff3cd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.bundle-item h4 {
    color: #856404;
    margin: 0 0 0.4rem 0;
    font-size: 0.9rem;
    line-height: 1.3;
}

.bundle-price {
    font-size: 1rem;
    color: #28a745;
    font-weight: bold;
}

.bundle-savings {
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 0.3rem;
}

.bundle-novels {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.4rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 广告位样式 */
.ad-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.8rem;
    text-align: center;
    position: relative;
    margin: 1rem 0;
}

.ad-banner.top-ad {
    border-bottom: 3px solid #ff6b6b;
}

.ad-banner.bottom-ad {
    border-top: 3px solid #ff6b6b;
    margin-top: 1.5rem;
}

.ad-link {
    color: white;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: transform 0.3s;
    font-size: 0.9rem;
}

.ad-link:hover {
    transform: translateX(5px);
}

.ad-badge {
    background: #ff6b6b;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: normal;
}

.ad-text {
    font-size: 0.9rem;
}

/* 文字广告位 */
.text-ad-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin: 1rem 0;
    background: white;
    padding: 0.8rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-ad {
    text-align: center;
    padding: 0.6rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 6px;
    transition: transform 0.3s, box-shadow 0.3s;
    font-size: 0.8rem;
}

.text-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.text-ad a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    display: block;
    width: 100%;
    height: 100%;
    font-size: 0.8rem;
}

/* 顶部介绍 */
.intro-top {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
    font-size: 0.9rem;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: relative;
}

header h1 {
    font-size: 1.3rem;
    text-align: center;
    padding: 0 2.5rem;
    line-height: 1.3;
}

.back-btn {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 0.8rem;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

main {
    padding: 1.5rem 0;
}

.novel-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.novel-info {
    background: white;
    padding: 1.2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.price-section {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 2px solid #eee;
}

.price {
    font-size: 2rem;
    color: #ff6b6b;
    font-weight: bold;
    display: block;
    margin-bottom: 0.8rem;
}

.intro-section h3,
.preview-section h3 {
    color: #444;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    border-left: 4px solid #667eea;
    padding-left: 0.5rem;
}

.intro-content {
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #eee;
    font-size: 0.9rem;
    line-height: 1.6;
}

.preview-section {
    background: white;
    padding: 1.2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.preview-content {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #eee;
    max-height: 800px;
    overflow-y: auto;
    line-height: 1.6;
    font-size: 0.9rem;
}

.preview-content p {
    margin-bottom: 0.8rem;
    text-indent: 2em;
}

.loading {
    text-align: center;
    padding: 1.5rem;
    color: #666;
    font-style: italic;
}

.error {
    background: #ffe6e6;
    color: #d63031;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #ff7675;
    font-size: 0.9rem;
}

.retry-btn {
    background: #d63031;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    margin-top: 0.8rem;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 0.8rem;
}

.retry-btn:hover {
    background: #c23616;
}

/* 平板设备 */
@media (min-width: 768px) {
    body {
        font-size: 15px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .recommend-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .text-ad-container {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .novel-content {
        flex-direction: row;
    }
    
    .novel-info {
        width: 35%;
    }
    
    .preview-section {
        width: 65%;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
}

/* 桌面设备 */
@media (min-width: 1024px) {
    .main-container {
        flex-direction: row;
        gap: 2rem;
    }
    
    .content-left {
        width: 75%;
    }
    
    .mobile-recommend-sidebar {
        display: none;
    }
    
    .desktop-recommend-sidebar {
        display: block;
        width: 25%;
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        padding: 1.5rem;
        position: sticky;
        top: 2rem;
        height: fit-content;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .desktop-recommend-sidebar .recommend-list {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
    }
    
    .recommend-list {
        grid-template-columns: repeat(4, 1fr);
    }
    
    header h1 {
        font-size: 1.8rem;
    }
}

/* 大屏设备 */
@media (min-width: 1200px) {
    .container {
        padding: 0 20px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滚动条样式 */
.preview-content::-webkit-scrollbar,
.desktop-recommend-sidebar::-webkit-scrollbar {
    width: 6px;
}

.preview-content::-webkit-scrollbar-track,
.desktop-recommend-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.preview-content::-webkit-scrollbar-thumb,
.desktop-recommend-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
}

.preview-content::-webkit-scrollbar-thumb:hover,
.desktop-recommend-sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* 触摸设备优化 */
@media (hover: none) {
    .recommend-item:hover,
    .bundle-item:hover,
    .text-ad:hover {
        transform: none;
    }
    
    .ad-link:hover {
        transform: none;
    }
}

/* 防止移动端缩放 */
input, select, textarea {
    font-size: 16px !important;
}

/* 长按优化 */
.recommend-item, .bundle-item, .text-ad {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}