/* {模板路径}/static/css/style.css */

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

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

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

a:hover {
    color: #c27c54;
}

ul, ol {
    list-style: none;
}

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

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

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

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: #4a3728;
}

h2 {
    font-size: 28px;
    margin-bottom: 30px;
    position: relative;
    text-align: center;
}

h2:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: #c27c54;
    margin: 15px auto 0;
}

section {
    padding: 60px 0;
}

/* 图标样式 */
[class^="icon-"] {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 5px;
    vertical-align: middle;
}

/* 头部导航样式 */
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;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo a {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: #4a3728;
}

.logo-icon {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

nav ul {
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    font-size: 16px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

nav ul li a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #c27c54;
    transition: width 0.3s ease;
}

nav ul li a:hover:after {
    width: 100%;
}

/* 轮播背景样式 */
.banner {
    position: relative;
    height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.banner-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease;
}

.slide.active {
    opacity: 1;
}

.slide:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.banner-content {
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.banner-content h1 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #fff;
}

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

.search-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    height: 46px;
    padding: 0 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
}

.search-box button {
    height: 46px;
    padding: 0 20px;
    background-color: #c27c54;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

/* 今日推荐样式 */
.recommend {
    background-color: #fff;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 30px;
}

.card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.card-img {
    height: 200px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img img {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.card-content .author {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.card-content .desc {
    color: #777;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 分类浏览样式 */
.categories {
    background-color: #f9f5f0;
}

.category-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.category-item {
    text-align: center;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

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

.category-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 15px;
}

.category-item h3 {
    font-size: 16px;
    margin-bottom: 15px;
}

/* 热门阅读样式 */
.hot-reading {
    background-color: #fff;
}

.hot-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hot-item {
    display: flex;
    background-color: #f9f5f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.hot-img {
    width: 180px;
    position: relative;
}

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

.hot-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #c27c54;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

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

.hot-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.hot-content .author {
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.hot-content .desc {
    color: #777;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.stats {
    display: flex;
    gap: 15px;
}

.stats span {
    color: #888;
    font-size: 14px;
    display: flex;
    align-items: center;
}

/* 精选文章样式 */
.articles {
    background-color: #f9f5f0;
}

.article-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.article-item {
    display: flex;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.article-img {
    width: 300px;
}

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

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

.article-content h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

.article-desc {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 新书上架样式 */
.new-books {
    background-color: #fff;
}

.book-slider {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.book-item {
    text-align: center;
    padding: 15px;
    background-color: #f9f5f0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

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

.book-cover {
    position: relative;
    margin-bottom: 15px;
}

.book-cover img {
    width: 120px;
    height: 180px;
    object-fit: cover;
    margin: 0 auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.book-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #c27c54;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.book-item h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

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

.book-item .publish-date {
    color: #888;
    margin-bottom: 15px;
    font-size: 12px;
}

/* APP下载模块样式 */
.app-download {
    background-color: #4a3728;
    color: #fff;
    padding: 80px 0;
}

.app-content {
    display: flex;
    align-items: center;
}

.app-info {
    flex: 1;
    padding-right: 30px;
}

.app-info h2 {
    color: #fff;
    text-align: left;
    margin-bottom: 20px;
}

.app-info h2:after {
    margin: 15px 0 0;
}

.app-info p {
    font-size: 18px;
    margin-bottom: 25px;
}

.app-features {
    margin-bottom: 30px;
}

.app-features li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.app-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.app-btn {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #fff;
    color: #4a3728;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.app-btn:hover {
    background-color: #f0f0f0;
    color: #4a3728;
    transform: translateY(-2px);
}

.app-btn i {
    font-size: 20px;
    margin-right: 8px;
}

.qr-code {
    text-align: center;
}

.qr-code img {
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
    background-color: #fff;
    padding: 10px;
    border-radius: 4px;
}

.qr-code p {
    font-size: 14px;
    margin-bottom: 0;
}

.app-image {
    flex: 1;
    text-align: center;
}

.app-image img {
    max-width: 300px;
    margin: 0 auto;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: #ccc;
    padding: 60px 0 30px;
}

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

.footer-about h3,
.footer-links h3,
.footer-contact h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-about h3:after,
.footer-links h3:after,
.footer-contact h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: #c27c54;
}

.footer-about p {
    line-height: 1.8;
}

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

.footer-links ul li a {
    color: #ccc;
    transition: color 0.3s ease;
}

.footer-links ul li a:hover {
    color: #c27c54;
}

.footer-contact ul li {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.footer-contact ul li i {
    margin-top: 4px;
}

.social-media {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #444;
    transition: background-color 0.3s ease;
}

.social-icon:hover {
    background-color: #c27c54;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

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

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

.friend-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.friend-links ul li a {
    color: #ccc;
    font-size: 14px;
}

.friend-links ul li a:hover {
    color: #c27c54;
}

/* 响应式样式 */
@media (max-width: 992px) {
    .app-content {
        flex-direction: column;
    }
    
    .app-info {
        padding-right: 0;
        margin-bottom: 40px;
    }
    
    .hot-item,
    .article-item {
        flex-direction: column;
    }
    
    .hot-img,
    .article-img {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 15px;
    }
    
    nav ul li {
        margin: 5px 10px;
    }
    
    .banner {
        height: 400px;
    }
    
    .banner-content h1 {
        font-size: 28px;
    }
    
    .footer-bottom {
        flex-direction: column;
    }
    
    .copyright {
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .banner {
        height: 350px;
    }
    
    .banner-content h1 {
        font-size: 24px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box input {
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .search-box button {
        border-radius: 4px;
        width: 100%;
    }
    
    .app-buttons {
        flex-direction: column;
    }
}
