/* 书架页面样式 - 集成到主页Tab中 */

/* 书架列表容器 - 使用与其他页面一致的样式 */
.bookshelf-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* 书架项使用book-card样式，保持UI一致 */
.bookshelf-item {
    /* 继承book-card样式 */
}

/* 阅读进度条 */
.reading-progress {
    margin-top: 8px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 4px;
}

.progress-bar-container {
    height: 4px;
    background: var(--md-surface-container-high);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* 阅读统计 */
.reading-stats {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

/* 操作按钮 */
.bookshelf-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.bookshelf-actions .btn {
    flex: 1;
}

/* 移动端适配 */
@media (max-width: 1024px) {
    .bookshelf-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .bookshelf-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .bookshelf-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

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

.bookshelf-header {
    text-align: center;
    margin-bottom: 30px;
}

.bookshelf-header h2 {
    font-size: 32px;
    font-weight: 600;
    color: var(--md-sys-color-on-background);
    margin: 0 0 8px 0;
}

.bookshelf-subtitle {
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
}

.bookshelf-filters {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    gap: 12px;
}

.bookshelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.bookshelf-item {
    background: var(--md-sys-color-surface);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
}

.bookshelf-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.book-cover-container {
    position: relative;
    width: 100%;
    padding-top: 140%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.book-cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reading-progress-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 12px;
    color: white;
}

.progress-text {
    font-size: 12px;
    margin-bottom: 4px;
}

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

.progress-bar {
    height: 100%;
    background: #4CAF50;
    border-radius: 2px;
    transition: width 0.3s;
}

.bookshelf-item-info {
    padding: 16px;
}

.bookshelf-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bookshelf-item-author {
    font-size: 13px;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0 0 12px 0;
}

.bookshelf-item-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
}

.stat-item-inline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-item-inline svg {
    width: 14px;
    height: 14px;
}

.bookshelf-item-actions {
    padding: 12px 16px;
    border-top: 1px solid var(--md-sys-color-surface-variant);
    display: flex;
    gap: 8px;
}

.btn-continue {
    flex: 1;
    padding: 8px 16px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-continue:hover {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.btn-remove {
    padding: 8px 12px;
    background: transparent;
    color: var(--md-sys-color-error);
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: var(--md-sys-color-error-container);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 14px;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0 0 24px 0;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid var(--md-sys-color-surface-variant);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

    .bookshelf-header h2 {
        font-size: 24px;
    }

    .bookshelf-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .bookshelf-item-info {
        padding: 12px;
    }

    .bookshelf-item-title {
        font-size: 14px;
    }

    .bookshelf-item-author {
        font-size: 12px;
    }

    .bookshelf-item-stats {
        font-size: 11px;
        gap: 12px;
    }
}
