/* ============================================
   bookshelf.css — 3D 书架样式
   ============================================ */

/* 书架区域 */
.bookshelf-section {
    padding: var(--space-2xl, 80px) 0;
}

/* 书架容器 - 横向滚动 */
.bookshelf {
    display: flex;
    gap: 28px;
    padding: 40px 0 30px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.bookshelf::-webkit-scrollbar {
    display: none;
}

/* 单本书 */
.book-item {
    flex: 0 0 160px;
    scroll-snap-align: start;
    perspective: 800px;
    cursor: pointer;
}

.book-cover {
    position: relative;
    width: 140px;
    height: 200px;
    border-radius: 4px 12px 12px 4px;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow:
        -6px 6px 18px rgba(0, 0, 0, 0.4),
        0 0 3px rgba(0, 0, 0, 0.2);
}

.book-item:hover .book-cover {
    transform: rotateY(-25deg) translateX(10px);
}

/* 书脊 */
.book-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.1) 40%,
            transparent 100%);
    border-radius: 4px 0 0 4px;
    transform-origin: left;
}

/* 封面内容 */
.book-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    border-radius: 4px 12px 12px 4px;
    overflow: hidden;
    background: var(--book-color, #4F46E5);
}

/* 封面 emoji */
.book-emoji {
    font-size: 40px;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* 书名 */
.book-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 作者 */
.book-author {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 6px;
    text-align: center;
}

/* 鼠标悬浮时显示的信息卡片 */
.book-info {
    margin-top: 16px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease 0.1s;
}

.book-item:hover .book-info {
    opacity: 1;
    transform: translateY(0);
}

/* 评分星星 */
.book-rating {
    display: flex;
    gap: 2px;
    margin-bottom: 6px;
}

.book-rating .star {
    font-size: 12px;
    color: #F59E0B;
}

.book-rating .star.empty {
    color: rgba(255, 255, 255, 0.15);
}

/* 书评语 */
.book-quote {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    font-style: italic;
}

/* 分类标签 */
.book-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
}

/* 拖拽提示 */
.bookshelf-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.25);
    font-size: 12px;
    margin-top: 12px;
}

/* 书架底板阴影 */
.bookshelf-shelf {
    height: 8px;
    margin-top: -4px;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.04) 0%,
            transparent 100%);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .bookshelf {
        gap: 20px;
        padding: 20px 0;
    }

    .book-item {
        flex: 0 0 130px;
    }

    .book-cover {
        width: 110px;
        height: 160px;
    }

    .book-emoji {
        font-size: 30px;
    }

    .book-title {
        font-size: 12px;
    }
}