:host {
    --primary-color: var(--ion-color-primary);
    --background-color: #f5f5f5;
}

ion-header {
    ion-toolbar {
        --background: transparent;

        ion-title {
            font-size: 18px;
            font-weight: 600;
        }
    }
}

.books-container {
    padding: 16px;

    .book-card {
        background: white;
        border-radius: 12px;
        overflow: hidden;
        margin-bottom: 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        display: flex;
        transition: transform 0.3s ease;

        &:active {
            transform: scale(0.98);
        }

        .book-image {
            position: relative;
            width: 120px;
            height: 160px;

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

            .progress-overlay {
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                background: rgba(0, 0, 0, 0.7);
                padding: 8px;

                .progress-bar {
                    height: 4px;
                    background: rgba(255, 255, 255, 0.3);
                    border-radius: 2px;
                    overflow: hidden;
                    margin-bottom: 4px;

                    .progress-fill {
                        height: 100%;
                        background: var(--primary-color);
                        border-radius: 2px;
                    }
                }

                .progress-text {
                    color: white;
                    font-size: 12px;
                }
            }
        }

        .book-info {
            flex: 1;
            padding: 16px;
            display: flex;
            flex-direction: column;

            h2 {
                margin: 0 0 8px;
                font-size: 18px;
                font-weight: 600;
                color: #333;
            }

            .author {
                font-size: 14px;
                color: #666;
                margin: 0 0 8px;
            }

            .description {
                font-size: 14px;
                color: #666;
                line-height: 1.4;
                margin: 0;
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
                overflow: hidden;
                flex: 1;
            }

            .book-meta {
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin-top: 12px;

                .last-read {
                    display: flex;
                    align-items: center;
                    gap: 4px;
                    font-size: 12px;
                    color: #999;

                    ion-icon {
                        font-size: 16px;
                    }
                }

                ion-button {
                    --color: var(--primary-color);
                    font-size: 14px;

                    ion-icon {
                        margin-right: 4px;
                    }
                }
            }
        }
    }
}

// 添加动画效果
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-card {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;

    @for $i from 1 through 10 {
        &:nth-child(#{$i}) {
            animation-delay: #{$i * 0.1}s;
        }
    }
}