/* 书籍列表页面样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
}

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

/* 页头样式 */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    font-size: 20px;
    font-weight: bold;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: color 0.3s;
}

.nav a:hover, .nav a.active {
    color: #007bff;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 8px 15px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 200px;
    font-size: 14px;
}

.search-box button {
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
    min-width: 150px;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    transition: background 0.3s;
}

.user-dropdown a:hover {
    background: #f8f9fa;
}

/* 主要内容区域 */
.main {
    padding: 30px 0;
}

/* 页面头部 */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

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

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb span {
    margin: 0 8px;
}

/* 筛选器样式 */
.filters {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* 搜索类型选择器样式 */
#searchTypeFilter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#searchTypeFilter:hover {
    border-color: #007bff;
}

#searchTypeFilter:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 筛选组样式优化 */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color 0.3s;
}

.filter-group select:focus {
    border-color: #007bff;
}

/* 搜索输入框样式 */
.filter-group input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color 0.3s;
    width: 200px;
}

.filter-group input[type="text"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.filter-group input[type="text"]::placeholder {
    color: #999;
}

/* 搜索组样式 */
.search-group {
    flex: 1;
    min-width: 300px;
}

.search-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-input-group input[type="text"] {
    flex: 1;
    min-width: 0;
}

.search-input-group button {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 搜索按钮样式 */
.filter-group button {
    padding: 8px 16px;
    border: 1px solid #007bff;
    border-radius: 6px;
    background: #007bff;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-group button:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.filter-group button:active {
    transform: scale(0.98);
}

/* 书籍网格 */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.book-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.book-cover {
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.book-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.book-cover:not([style*="background-image"]) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.book-cover:not([style*="background-image"])::before {
    display: none;
}

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

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none; /* 默认不接收鼠标事件 */
}

.book-card:hover .book-overlay {
    opacity: 1;
    pointer-events: auto; /* 悬停时接收鼠标事件 */
}

/* 确保按钮始终可以点击，不受父元素pointer-events影响 */
.book-overlay .btn {
    pointer-events: auto !important;
    z-index: 10;
    position: relative;
    cursor: pointer !important;
}

/* 强制按钮可点击 */
.book-overlay button {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 100;
    position: relative;
}

/* 确保按钮在悬停时可见且可点击 */
.book-card:hover .book-overlay .btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 1000;
}

.book-info {
    padding: 12px;
}

.book-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.book-title a:hover {
    color: #007bff;
}

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

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.book-genre {
    font-size: 11px;
    color: #007bff;
    background: rgba(0,123,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.book-rating {
    font-size: 11px;
    color: #ffc107;
    display: flex;
    align-items: center;
    gap: 2px;
}

.book-stats {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #888;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.page-btn {
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
}

.page-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.page-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 加载和空状态 */
.loading, .empty-state, .error-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 页脚样式 */
.footer {
    background: #333;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.footer-section h3 {
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 20px;
    text-align: center;
    color: #ccc;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        gap: 20px;
    }
    
    .search-box input {
        width: 150px;
    }
    
    .filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .search-group {
        min-width: auto;
        width: 100%;
    }
    
    .search-input-group {
        width: 100%;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .book-cover {
        height: 100px;
    }
    
    .book-info {
        padding: 10px;
    }
    
    .book-title {
        font-size: 13px;
    }
    
    .book-author {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .filter-group select {
        width: 100%;
    }
    
    .search-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-input-group input[type="text"] {
        width: 100%;
    }
    
    .search-input-group button {
        width: 100%;
        justify-content: center;
    }
}

/* 标签区域样式 */
.tags-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.tags-header h3 {
    font-size: 16px;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tags-header h3 i {
    color: #007bff;
}

.tags-header button {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #007bff;
    background: transparent;
    color: #007bff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tags-header button:hover {
    background: #007bff;
    color: white;
}

.tags-header button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.tag-item:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.tag-item.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.tag-item.hot {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: white;
    border-color: #ff6b6b;
}

.tag-item.hot:hover {
    background: linear-gradient(45deg, #ff5252, #ff7676);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.tag-item.keyword {
    background: linear-gradient(45deg, #4ecdc4, #6ee7df);
    color: white;
    border-color: #4ecdc4;
}

.tag-item.keyword:hover {
    background: linear-gradient(45deg, #3db8b0, #5dd5cd);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.4);
}

.tag-item i {
    margin-right: 5px;
    font-size: 12px;
}

/* 标签加载状态 */
.tags-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
}

.tags-loading i {
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

/* 标签为空状态 */
.tags-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tags-section {
        padding: 15px;
    }
    
    .tags-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .tags-header button {
        align-self: flex-end;
    }
    
    .tags-container {
        gap: 8px;
    }
    
    .tag-item {
        font-size: 12px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .tags-section {
        padding: 10px;
    }
    
    .tags-container {
        gap: 6px;
    }
    
    .tag-item {
        font-size: 11px;
        padding: 4px 8px;
    }
} 