.history-container {
    position: relative;
    margin-bottom: 30px;
}

.history-main {
    background: #fff;
    border: 1px solid #e9ecef;
    min-height: 600px;
    transition: margin-right 0.3s ease;
}

.history-main.sidebar-open {
    margin-right: 280px;
}

/* 历史记录头部 */
.history-header {
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.history-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.history-description {
    color: #666;
    font-size: 14px;
    text-align: center;
    line-height: 1.6;
}

/* 操作栏 */
.history-actions {
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-info {
    color: #666;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    text-decoration: none;
}

.action-btn:hover {
    background: #e9ecef;
    color: #333;
}

.action-btn.danger {
    color: #dc3545;
    border-color: #dc3545;
}

.action-btn.danger:hover {
    background: #dc3545;
    color: white;
}

/* 历史记录列表 */
.history-content {
    padding: 30px;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.history-item {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    background: #fff;
}

.history-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #2c3e50;
    transform: translateY(-1px);
}

.book-main {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.book-cover {
    width: 60px;
    height: 80px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #666;
    flex-shrink: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.book-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-title a {
    color: inherit;
    text-decoration: none;
}

.book-title a:hover {
    color: #3498db;
}

.book-author {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.read-progress {
    font-size: 13px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chapter-name {
    color: #2c3e50;
    font-weight: 500;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.read-time {
    font-size: 12px;
    color: #999;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.item-btn {
    padding: 5px 10px;
    font-size: 12px;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
}

.item-btn.continue {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.item-btn.continue:hover {
    background: #34495e;
}

.item-btn.remove {
    background: #f8f9fa;
    color: #dc3545;
    border-color: #dc3545;
}

.item-btn.remove:hover {
    background: #dc3545;
    color: white;
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ccc;
}

.empty-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #999;
}

.empty-description {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-action {
    padding: 10px 20px;
    background: #2c3e50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.3s ease;
}

.empty-action:hover {
    background: #34495e;
}

/* 侧边栏样式 */
.history-sidebar {
    position: fixed;
    top: 50%;
    right: -250px;
    width: 250px;
    height: 70vh;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px 0 0 8px;
    padding: 20px;
    transform: translateY(-50%);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.history-sidebar.open {
    right: 0;
}

/* 悬浮按钮 */
.sidebar-toggle {
    position: fixed;
    top: 50%;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
    z-index: 1001;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle:hover {
    background: #34495e;
    transform: translateY(-50%) scale(1.1);
}

.sidebar-toggle.sidebar-open {
    right: 270px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background: #f0f0f0;
    color: #333;
}

.recommend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    border-radius: 4px;
}

.recommend-item:hover {
    background: #f8f9fa;
    border-color: #2c3e50;
}

.recommend-title {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 10px;
}

.recommend-author {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 60px;
}


/* 响应式设计 */
@media (max-width: 1024px) {
    .history-main.sidebar-open {
        margin-right: 0;
    }
    
    .sidebar-toggle.sidebar-open {
        right: 270px;
    }
}

@media (max-width: 768px) {
    .history-header {
        padding: 20px;
    }
    
    .history-title {
        font-size: 24px;
    }
    
    .history-actions {
        padding: 15px 20px;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .history-content {
        padding: 20px;
    }
    
    .history-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .book-main {
        gap: 12px;
    }
    
    .book-cover {
        width: 50px;
        height: 65px;
    }
    
    .history-sidebar {
        width: 280px;
        right: -280px;
    }
    
    .sidebar-toggle.sidebar-open {
        right: 300px;
    }
}

@media (max-width: 480px) {
    .history-header {
        padding: 15px;
    }
    
    .history-actions {
        padding: 10px 15px;
    }
    
    .history-content {
        padding: 15px;
    }
    
    .history-item {
        padding: 15px;
    }
    
    .book-title {
        font-size: 16px;
    }
    
    .read-progress {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .item-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .item-actions {
        justify-content: center;
    }
    
    .history-sidebar {
        width: 90vw;
        right: -90vw;
    }
    
    .sidebar-toggle {
        right: 10px;
    }
    
    .sidebar-toggle.sidebar-open {
        right: calc(90vw + 20px);
    }
}