/* --- 我的书架专属样式 --- */

/* 头部导航按钮 */
.nav-link-btn {
    font-size: 13px;
    text-decoration: none;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 5px 12px;
    border-radius: 15px;
    transition: all 0.2s;
}

/* 网格布局：手机端默认2列 */
.shelf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
    padding-bottom: 40px;
}

/* PC端适配：宽度足够时显示 4 或 5 列 */
@media screen and (min-width: 768px) {
    .shelf-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media screen and (min-width: 1024px) {
    .shelf-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 书架卡片样式 */
.shelf-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.shelf-card:active {
    transform: scale(0.97);
}

.card-link {
    display: flex;
    flex-direction: column;
    padding: 15px;
    text-decoration: none;
    color: var(--text-color);
    /* height: 100%;  <-- 删除这一行，改用 min-height */
    min-height: 150px; /* 稍微增加一点最小高度 */
    justify-content: space-between; /* 强制让 header, body, footer 分布在顶部、中间和底部 */
}

/* 卡片顶部：标签和删除按钮 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.book-tag {
    font-size: 10px;
    background: var(--accent-color);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0.9;
}

.remove-btn {
    background: rgba(0,0,0,0.1);
    border: none;
    color: var(--text-color);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
}

/* 卡片主体：书名和章节 */
.card-body {
    flex-grow: 1;
    margin-bottom: 15px;
}

.book-name {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.chapter-name {
    font-size: 11px;
    opacity: 0.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 卡片底部：进度条 */
.card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto; /* 关键：确保进度条被推到卡片底部 */
    padding-top: 10px;
    min-height: 20px; /* 防止高度塌陷 */
}

.progress-bar {
    flex-grow: 1;
    height: 6px; /* 稍微加粗一点点 */
    background: rgba(0,0,0,0.1); /* 增加深度 */
    border-radius: 3px;
    overflow: hidden;
}

.progress-inner {
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 10px;
    opacity: 0.6;
    white-space: nowrap;
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
}

.empty-icon {
    font-size: 50px;
    margin-bottom: 15px;
    opacity: 0.2;
}

/* 主题适配补丁 */
body.theme-night .shelf-card { background: #252a2f; }
body.theme-night .progress-bar { background: rgba(255,255,255,0.1); }

/* --- 清空按钮专属样式 --- */

/* 头部右侧按钮间距 */
.header-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 危险操作按钮（清空） */
.btn-danger {
    color: #ff4d4f !important;
    border-color: #ff4d4f !important;
    background: transparent;
    cursor: pointer;
}

.btn-danger:active {
    background: rgba(255, 77, 79, 0.1);
    transform: scale(0.95);
}

/* 适配空状态的文字和按钮 */
.go-home-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 20px;
    background: var(--accent-color);
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
}

/* 夜间模式适配清空按钮 */
body.theme-night .btn-danger {
    color: #ff7875 !important;
    border-color: #ff7875 !important;
}