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

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f7f1;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23f9f7f1"/><path d="M0,0 L100,100 M100,0 L0,100" stroke="%23e8e4d9" stroke-width="0.5"/></svg>');
}

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

/* 导航面包屑 */
.breadcrumb {
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8e4d9;
    font-size: 0.9rem;
    color: #777;
}

.breadcrumb a {
    color: #8b5a2b;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #3c2f2f;
    font-weight: 500;
}

/* 头部样式 */
header {
    text-align: center;
    padding: 30px 0;
    margin-bottom: 30px;
    border-bottom: 2px solid #d4b483;
    position: relative;
}

header h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 3.2rem;
    color: #3c2f2f;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 i {
    color: #8b5a2b;
    margin-right: 15px;
}

.subtitle {
    font-size: 1.3rem;
    color: #5d4a2a;
    font-style: italic;
}

/* 前言部分 */
.intro {
    display: flex;
    flex-wrap: wrap;
    background-color: #fffef9;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #8b5a2b;
}

.intro-text {
    flex: 3;
    min-width: 300px;
    padding-right: 20px;
}

.intro-text h2 {
    font-family: 'Noto Serif SC', serif;
    color: #5d4a2a;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.intro-text h2 i {
    color: #d4b483;
    margin-right: 10px;
}

.intro-text p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
}

/* 前言图片样式 */
.intro-image {
    flex: 1;
    min-width: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.intro-picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.intro-picture:hover {
    transform: scale(1.02);
}

.image-fallback {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e8e4d9;
    border-radius: 8px;
    justify-content: center;
    align-items: center;
}

.image-fallback i {
    font-size: 5rem;
    color: #8b5a2b;
    opacity: 0.5;
}

/* 书架标题 */
.bookshelf h2 {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.2rem;
    color: #3c2f2f;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.bookshelf h2:after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background-color: #d4b483;
    margin: 10px auto;
}

.bookshelf h2 i {
    color: #8b5a2b;
    margin-right: 10px;
}

/* 书籍网格布局 */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

/* === 书籍基础样式和炫酷悬停效果 === */

/* 书籍基础样式 */
.book-item {
    text-decoration: none;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    display: block;
    /* 3D变换基础 */
    transform: perspective(1000px) translateZ(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 3D浮动效果 */
.book-item:hover {
    transform: perspective(1000px) translateY(-15px) translateZ(30px);
    box-shadow: 
        0 20px 40px rgba(139, 90, 43, 0.3),
        0 0 0 1px rgba(212, 180, 131, 0.2),
        0 0 30px rgba(212, 180, 131, 0.4);
}

/* 书籍封面样式 */
.book-cover {
    height: 280px;
    position: relative;
    overflow: hidden;
    background-color: #f0e6d3;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: brightness(0.95) contrast(1.05);
}

/* 封面图片缩放效果 */
.book-item:hover .book-cover-img {
    transform: scale(1.08);
    filter: brightness(1.1) contrast(1.1);
}

/* 扫光效果 */
.book-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transform: skewX(-15deg);
    transition: left 0.8s ease;
    z-index: 1;
}

.book-item:hover .book-cover::after {
    left: 150%;
}

/* 书籍标题样式 */
.book-title {
    padding: 15px 10px;
    text-align: center;
    background-color: #fff;
    font-weight: 600;
    color: #3c2f2f;
    font-size: 1rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* 标题装饰线效果 */
.book-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #8b5a2b, #d4b483, #8b5a2b);
    background-size: 200% 100%;
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.book-item:hover .book-title::before {
    transform: translateX(0);
    animation: shine 1.5s infinite linear;
}

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

.book-item:hover .book-title {
    color: #5d4a2a;
}

/* 书籍详情页面头部 */
.book-header {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e8e4d9;
}

/* 书籍详情页面大封面 */
.book-cover-large {
    flex: 0 0 200px;
    height: 300px;
    border-radius: 8px;
    margin-right: 40px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    background-color: #f0e6d3;
}

.book-cover-large-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.cover-large-fallback {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
}

.cover-large-fallback i {
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.9);
}

.book-info {
    flex: 1;
    min-width: 300px;
}

.book-info h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.8rem;
    color: #3c2f2f;
    margin-bottom: 15px;
}

.rating {
    font-size: 1.3rem;
    color: #5d4a2a;
    margin-bottom: 25px;
}

.stars {
    color: #ffc107;
    font-size: 1.5rem;
    letter-spacing: 3px;
}

.book-meta {
    background-color: #f5f1e8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.book-meta p {
    margin-bottom: 10px;
    color: #5d4a2a;
    display: flex;
    align-items: center;
}

.book-meta p:last-child {
    margin-bottom: 0;
}

.book-meta i {
    margin-right: 10px;
    color: #8b5a2b;
    width: 20px;
}

.back-btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #8b5a2b;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.back-btn:hover {
    background-color: #6b4519;
}

.back-btn i {
    margin-right: 8px;
}

/* 书籍内容 */
.book-content {
    max-width: 800px;
    margin: 0 auto;
}

.detail-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px dashed #e8e4d9;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h2 {
    font-family: 'Noto Serif SC', serif;
    color: #5d4a2a;
    margin-bottom: 20px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
}

.detail-section h2 i {
    margin-right: 10px;
    color: #d4b483;
}

.detail-section p {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #555;
    text-align: justify;
    margin-bottom: 15px;
}

.detail-section p:last-child {
    margin-bottom: 0;
}

.detail-section ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.detail-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.detail-section a {
    color: #8b5a2b;
    text-decoration: none;
}

.detail-section a:hover {
    text-decoration: underline;
}

/* 关键词 */
.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.keyword {
    display: inline-block;
    background-color: #e8e4d9;
    color: #5d4a2a;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 关联推荐 */
.related-books {
    background-color: #f5f1e8;
    padding: 25px;
    border-radius: 8px;
}

.related-books p {
    font-weight: 600;
    color: #5d4a2a;
    margin-bottom: 15px;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 25px 0;
    margin-top: 50px;
    border-top: 1px solid #e8e4d9;
    color: #777;
    font-size: 0.95rem;
}

footer p {
    margin-bottom: 8px;
}

footer a {
    color: #8b5a2b;
    text-decoration: none;
    margin: 0 10px;
}

footer a:hover {
    text-decoration: underline;
}

/* === 音乐播放器样式 === */
.music-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background-color: rgba(60, 47, 47, 0.95);
    border-radius: 50px;
    padding: 12px 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 180, 131, 0.3);
    transition: all 0.3s ease;
}

.music-player.hidden {
    transform: translateY(120%);
    opacity: 0;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.control-btn {
    background-color: #8b5a2b;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background-color: #d4b483;
    transform: scale(1.1);
}

.song-info {
    flex: 1;
    margin: 0 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.song-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f5f1e8;
}

.song-title.playing {
    color: #d4b483;
    position: relative;
}

.song-title.playing::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #d4b483;
    border-radius: 50%;
    margin-left: 5px;
    margin-top: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

.artist {
    font-size: 12px;
    color: #b5a89a;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.volume-control {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.volume-icon {
    color: #d4b483;
    font-size: 16px;
    margin-right: 8px;
}

.volume-slider {
    width: 70px;
    height: 4px;
    background: rgba(245, 241, 232, 0.3);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #d4b483;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #d4b483;
    cursor: pointer;
    border: none;
}

/* === 响应式设计 === */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .intro {
        flex-direction: column;
    }
    
    .intro-text {
        padding-right: 0;
        margin-bottom: 20px;
    }
    
    .intro-image {
        height: 250px;
        margin-top: 20px;
    }
    
    .intro-picture {
        max-height: 100%;
        object-fit: contain;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .book-cover {
        height: 200px;
    }
    
    /* 响应式悬停效果调整 */
    .book-item:hover {
        transform: perspective(1000px) translateY(-10px) translateZ(15px);
        box-shadow: 
            0 15px 30px rgba(139, 90, 43, 0.2),
            0 0 0 1px rgba(212, 180, 131, 0.1),
            0 0 20px rgba(212, 180, 131, 0.3);
    }
    
    .book-item:hover .book-cover-img {
        transform: scale(1.05);
    }
    
    .book-header {
        flex-direction: column;
    }
    
    .book-cover-large {
        flex: 0 0 auto;
        width: 180px;
        height: 270px;
        margin-right: 0;
        margin-bottom: 30px;
        align-self: center;
    }
    
    .book-info h1 {
        font-size: 2.2rem;
        text-align: center;
    }
    
    .rating {
        text-align: center;
    }
    
    .back-btn {
        display: block;
        text-align: center;
        width: 100%;
    }
    
    .detail-meta {
        flex-direction: column;
        gap: 15px;
    }
    
    /* 音乐播放器响应式 */
    .music-player {
        width: 280px;
        bottom: 10px;
        right: 10px;
        padding: 10px 15px;
    }
    
    .song-info {
        margin: 0 10px;
    }
    
    .song-title {
        font-size: 13px;
    }
    
    .artist {
        font-size: 11px;
    }
    
    .volume-control {
        margin-right: 5px;
    }
    
    .volume-slider {
        width: 60px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .intro-image {
        height: 200px;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .book-cover {
        height: 180px;
    }
    
    /* 更小的屏幕悬停效果调整 */
    .book-item:hover {
        transform: perspective(1000px) translateY(-8px) translateZ(10px);
    }
    
    .book-item:hover .book-cover-img {
        transform: scale(1.03);
    }
    
    .book-cover-large {
        width: 150px;
        height: 225px;
    }
    
    .book-info h1 {
        font-size: 1.8rem;
    }
    
    .detail-section h2 {
        font-size: 1.5rem;
    }
    
    /* 音乐播放器响应式 */
    .music-player {
        width: 250px;
        border-radius: 40px;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .song-title {
        font-size: 12px;
    }
    
    .artist {
        font-size: 10px;
    }
}

/* 超级小屏手机 (phones, 600px and down) */
 
@media only screen and (max-width: 600px) {
 
    nav {
        margin-top:1px;
    }
    nav ul{
        flex-flow: column;
    }
    nav li:nth-child(n+2){
        border-left-style: none;
        border-top: 1px solid rgba(255,255,255,.7);
    }
}
 
/* 中等手机以及竖屏平板 (portrait tablets and large phones, 600px and up) */
 
@media only screen and (min-width: 600px) {}
 
/* 横屏平板 (landscape tablets, 768px and up) */
 
@media only screen and (min-width: 768px) {}
 
/* 中小型笔记本电脑及台式机 (laptops/desktops, 992px and up) */
 
@media only screen and (min-width: 992px) {}
 
/* 宽屏笔记本及台式机 (large laptops and desktops, 1200px and up) */
 
@media only screen and (min-width: 1200px) {
  
}