/* 海棠书屋 - 样式表 */
/* 基于网站标题自动生成的配色方案 */

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f5f0;
}

a {
    text-decoration: none;
    color: #8e4162;
    transition: color 0.3s ease;
}

a:hover {
    color: #b25a7e;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

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

.section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 32px;
    color: #8e4162;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.section-header h2:after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background-color: #8e4162;
    margin: 10px auto 0;
}

.section-header p {
    font-size: 16px;
    color: #666;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #8e4162;
    color: #fff;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #b25a7e;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo a {
    display: block;
}

.main-nav ul {
    display: flex;
}

.main-nav li {
    margin: 0 15px;
}

.main-nav a {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    position: relative;
}

.main-nav a:after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #8e4162;
    transition: width 0.3s ease;
}

.main-nav a:hover {
    color: #8e4162;
}

.main-nav a:hover:after {
    width: 100%;
}

.search-box {
    display: flex;
    align-items: center;
}

.search-box input {
    width: 200px;
    height: 40px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: #8e4162;
    width: 220px;
}

.search-box button {
    background: none;
    border: none;
    margin-left: -40px;
    cursor: pointer;
    color: #8e4162;
}

.search-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%238e4162"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
}

/* 首页轮播 */
.banner {
    position: relative;
    overflow: hidden;
    padding: 0;
}

.slider {
    width: 100%;
}

.slide {
    position: relative;
}

.slide img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    max-width: 800px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

.slide-content h1 {
    font-size: 42px;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.slide-content p {
    font-size: 18px;
    margin-bottom: 30px;
}

/* 分类阅读 */
.categories {
    background-color: #fff;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.category-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

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

.category-item h3 {
    padding: 15px 20px 10px;
    font-size: 20px;
    color: #8e4162;
}

.category-item p {
    padding: 0 20px 20px;
    color: #666;
}

/* 精品推荐 */
.featured {
    background-color: #f9f5f0;
}

.book-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.book-card {
    display: flex;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.book-cover {
    flex: 0 0 180px;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info {
    flex: 1;
    padding: 20px;
}

.book-info h3 {
    font-size: 20px;
    color: #8e4162;
    margin-bottom: 10px;
}

.book-info .author {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.book-info .desc {
    font-size: 14px;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.6;
}

.tags {
    display: flex;
    flex-wrap: wrap;
}

.tags span {
    display: inline-block;
    padding: 4px 10px;
    background-color: #f0e4eb;
    color: #8e4162;
    border-radius: 20px;
    font-size: 12px;
    margin-right: 10px;
    margin-bottom: 5px;
}

/* 最新上架 */
.latest {
    background-color: #fff;
}

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

.book-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    text-align: center;
}

.book-item:hover {
    transform: translateY(-5px);
}

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

.book-item h3 {
    padding: 15px 10px 5px;
    font-size: 16px;
    color: #8e4162;
}

.book-item p {
    padding: 0 10px 15px;
    font-size: 14px;
    color: #666;
}

/* 排行榜 */
.ranking {
    background-color: #f9f5f0;
}

.ranking-tabs {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.tab-header {
    display: flex;
    background-color: #f0e4eb;
}

.tab-header span {
    flex: 1;
    padding: 15px 0;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-header span.active {
    background-color: #8e4162;
    color: #fff;
}

.tab-content {
    padding: 20px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.ranking-list li {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

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

.rank {
    flex: 0 0 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background-color: #f0e4eb;
    color: #8e4162;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50%;
    margin-right: 15px;
}

.ranking-list li:nth-child(1) .rank {
    background-color: #ffd700;
    color: #fff;
}

.ranking-list li:nth-child(2) .rank {
    background-color: #c0c0c0;
    color: #fff;
}

.ranking-list li:nth-child(3) .rank {
    background-color: #cd7f32;
    color: #fff;
}

.ranking-list img {
    width: 60px;
    height: 80px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 4px;
}

.ranking-list .book-info {
    flex: 1;
}

.ranking-list .book-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.ranking-list .book-info p {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stats {
    display: flex;
    font-size: 12px;
    color: #999;
}

.stats span {
    margin-right: 15px;
}

/* 书评文章 */
.articles {
    background-color: #fff;
}

.article-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.article-item {
    display: flex;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.article-item:hover {
    transform: translateY(-5px);
}

.article-item img {
    width: 280px;
    height: 180px;
    object-fit: cover;
}

.article-content {
    flex: 1;
    padding: 20px;
}

.article-content h3 {
    font-size: 20px;
    color: #8e4162;
    margin-bottom: 10px;
}

.article-content .meta {
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
}

.article-content .excerpt {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f0e4eb;
    color: #8e4162;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.read-more:hover {
    background-color: #8e4162;
    color: #fff;
}

/* 阅读特色 */
.features {
    background-color: #f9f5f0;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f0e4eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
}

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

.feature-content h3 {
    font-size: 18px;
    color: #8e4162;
    margin-bottom: 10px;
}

.feature-content p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* 关于我们 */
.about {
    background-color: #fff;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-image {
    flex: 0 0 400px;
}

.about-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.about-text .stats {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
}

.stat-item .number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #8e4162;
    margin-bottom: 5px;
}

.stat-item .label {
    font-size: 14px;
    color: #666;
}

/* 页脚 */
.footer {
    background-color: #333;
    color: #fff;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 20px;
    position: relative;
}

.footer-column h3:after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: #8e4162;
}

.footer-column p {
    font-size: 14px;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
}

.social-link {
    display: inline-block;
    margin-right: 15px;
    color: #ccc;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: #8e4162;
}

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

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

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.footer-bottom p {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.footer-bottom a {
    color: #ccc;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .book-list {
        grid-template-columns: 1fr;
    }
    
    .feature-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .category-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .book-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .about-image {
        flex: 0 0 auto;
        width: 100%;
        margin-bottom: 30px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }
    
    .logo {
        margin-bottom: 15px;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-nav li {
        margin: 5px 10px;
    }
    
    .search-box {
        margin-top: 15px;
    }
    
    .slide-content h1 {
        font-size: 32px;
    }
    
    .slide-content p {
        font-size: 16px;
    }
    
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feature-list {
        grid-template-columns: 1fr;
    }
    
    .article-item {
        flex-direction: column;
    }
    
    .article-item img {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .category-list {
        grid-template-columns: 1fr;
    }
    
    .book-card {
        flex-direction: column;
    }
    
    .book-cover {
        flex: 0 0 auto;
    }
    
    .book-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}