/* 书籍相关页面样式 */

/* 书籍卡片特殊样式 */
.book-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
}

.book-card:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.book-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.5rem 0.5rem 1.5rem;
}

.book-card .card-body h3 {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.book-card .card-body p {
    font-size: 0.8rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

/* 大屏幕下的优化 */
@media (min-width: 1024px) {
    .book-card .card-body h3 {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .book-card .card-body p {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }
}

.book-card .card-footer {
    margin-top: auto;
    padding: 0.5rem 1.5rem 1.5rem 1.5rem;
}

/* 卡片内容悬浮效果 */
.book-card:hover .card-body h3 {
    color: #3b82f6;
}

.book-card:hover .book-meta .badge {
    transform: translateY(-1px);
}

.book-card:hover .book-stats {
    opacity: 0.8;
}

.book-cover {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
    background: #ffffff;
    display: block;
}

.book-cover img[src=""] {
    display: none;
}

.book-cover img:not([src]) {
    display: none;
}

.book-cover-img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-cover-img.loaded {
    opacity: 1;
}

.book-card:hover .book-cover img {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.no-cover {
    height: 240px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0ea5e9;
    font-size: 3rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.no-cover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 50%;
    z-index: 0;
}

.no-cover i {
    position: relative;
    z-index: 1;
}

.book-card:hover .no-cover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0284c7;
    transform: scale(1.02);
}

/* 书籍元信息 */
.book-meta {
    margin-bottom: 0.75rem;
}

.book-meta .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
    margin-right: 0.4rem;
    margin-bottom: 0.2rem;
    display: inline-block;
}

.book-stats {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.book-stats.grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

/* 大屏幕下的优化 */
@media (min-width: 1024px) {
    .book-meta {
        margin-bottom: 0.5rem;
    }
    
    .book-meta .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.35rem;
        margin-right: 0.3rem;
        margin-bottom: 0.15rem;
    }
    
    .book-stats {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .book-stats.grid {
        gap: 0.3rem;
    }
}

/* 书籍详情页面特殊样式 */
.book-cover-large {
    position: relative;
    height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.book-cover-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
    background: #ffffff;
    display: block;
}

.book-cover-large img[src=""] {
    display: none;
}

.book-cover-large img:not([src]) {
    display: none;
}

.book-cover-large .book-cover-img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-cover-large .book-cover-img.loaded {
    opacity: 1;
}

.no-cover-large {
    height: 400px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0ea5e9;
    font-size: 4rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.no-cover-large::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 50%;
    z-index: 0;
}

.no-cover-large i {
    position: relative;
    z-index: 1;
}

/* 响应式书籍详情页面 */
@media (max-width: 1024px) {
    .book-cover-large {
        height: 300px;
    }
    
    .no-cover-large {
        height: 300px;
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .book-cover {
        height: 180px;
    }
    
    .no-cover {
        height: 180px;
        font-size: 2rem;
    }
    
    .book-cover-large {
        height: 250px;
    }
    
    .no-cover-large {
        height: 250px;
        font-size: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .book-cover {
        height: 220px;
    }
    
    .no-cover {
        height: 220px;
        font-size: 2.5rem;
    }
    
    .book-card .card-body {
        padding: 0.75rem 1rem 0.25rem 1rem;
    }
    
    .book-card .card-footer {
        padding: 0.25rem 1rem 1rem 1rem;
    }
}

@media (max-width: 576px) {
    .book-cover {
        height: 160px;
    }
    
    .no-cover {
        height: 160px;
        font-size: 1.5rem;
    }
}

/* 标签页样式 - 提高优先级 */
.tab-container {
    width: 100%;
    position: relative;
    z-index: 1;
}

.tab-buttons {
    display: flex !important;
    gap: 0.75rem !important;
    border-bottom: 2px solid #e5e7eb !important;
    margin-bottom: 2rem !important;
    padding: 0 0.5rem !important;
    background: #ffffff !important;
    border-radius: 12px 12px 0 0 !important;
    padding-top: 0.5rem !important;
}

.tab-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.625rem !important;
    padding: 1rem 2rem !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    color: #6b7280 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    top: 2px !important;
    border-radius: 12px 12px 0 0 !important;
    margin-bottom: -2px !important;
    white-space: nowrap !important;
    outline: none !important;
    text-decoration: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.tab-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.tab-btn:focus-visible {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

.tab-btn::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 50%, #8b5cf6 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px 3px 0 0;
    z-index: 1;
}

.tab-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: 12px 12px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    pointer-events: none;
}

.tab-btn:hover:not(.active) {
    color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.05) !important;
    transform: translateY(-2px) !important;
}

.tab-btn:hover::before {
    transform: translateX(-50%) scaleX(0.7) !important;
}

.tab-btn:hover::after {
    opacity: 1 !important;
}

.tab-btn.active {
    color: #2563eb !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.12) 100%) !important;
    border-bottom-color: transparent !important;
    transform: translateY(0) !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15) !important;
}

.tab-btn.active::before {
    transform: translateX(-50%) scaleX(1) !important;
    width: 80% !important;
}

.tab-btn.active::after {
    opacity: 1 !important;
}

.tab-btn i {
    font-size: 1.125rem !important;
    transition: transform 0.3s ease !important;
}

.tab-btn:hover i,
.tab-btn.active i {
    transform: scale(1.1) !important;
}

.tab-count {
    font-size: 0.8125rem !important;
    color: #9ca3af !important;
    font-weight: 500 !important;
    background: rgba(156, 163, 175, 0.15) !important;
    padding: 0.125rem 0.5rem !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    margin-left: 0.25rem !important;
    display: inline-block !important;
}

.tab-btn.active .tab-count {
    color: #2563eb !important;
    background: rgba(37, 99, 235, 0.2) !important;
    font-weight: 600 !important;
}

.tab-content {
    display: none !important;
    animation: fadeIn 0.3s ease;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, max-height 0.3s ease;
}

.tab-content.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    max-height: none !important;
    overflow: visible !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 分页样式 - 提高优先级 */
.pagination-container {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
    background: linear-gradient(to bottom, transparent, rgba(249, 250, 251, 0.5));
    border-radius: 0 0 12px 12px;
}

.pagination {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    flex-wrap: wrap !important;
    padding: 1rem !important;
}

.page-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 3rem !important;
    height: 3rem !important;
    padding: 0.625rem 1rem !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 12px !important;
    color: #374151 !important;
    text-decoration: none !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    position: relative !important;
    overflow: hidden !important;
}

.page-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 50%, #3b82f6 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 10px;
}

.page-link:hover:not(.disabled) {
    border-color: #60a5fa !important;
    color: #ffffff !important;
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(147, 197, 253, 0.4) !important;
}

.page-link:hover:not(.disabled)::before {
    opacity: 1 !important;
}

.page-link:hover:not(.disabled) i {
    position: relative !important;
    z-index: 1 !important;
    color: #ffffff !important;
}

.page-link:active:not(.disabled) {
    transform: translateY(-1px) scale(1.02) !important;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3) !important;
}

.page-link.disabled {
    background: #f9fafb !important;
    border-color: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
    box-shadow: none !important;
}

.page-link i {
    font-size: 1.125rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    z-index: 1 !important;
}

.page-link:hover:not(.disabled) i {
    transform: scale(1.2) !important;
}

.page-link:first-child:hover:not(.disabled) i,
.page-link:nth-child(2):hover:not(.disabled) i {
    animation: slideLeft 0.5s ease !important;
}

.page-link:last-child:hover:not(.disabled) i,
.page-link:nth-last-child(2):hover:not(.disabled) i {
    animation: slideRight 0.5s ease !important;
}

@keyframes slideLeft {
    0%, 100% {
        transform: translateX(0) scale(1.2);
    }
    50% {
        transform: translateX(-3px) scale(1.2);
    }
}

@keyframes slideRight {
    0%, 100% {
        transform: translateX(0) scale(1.2);
    }
    50% {
        transform: translateX(3px) scale(1.2);
    }
}

.page-info {
    padding: 0.75rem 1.5rem !important;
    color: #1f2937 !important;
    font-size: 0.9375rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.15) 0%, rgba(96, 165, 250, 0.12) 100%) !important;
    border-radius: 12px !important;
    border: 2px solid rgba(147, 197, 253, 0.3) !important;
    box-shadow: 0 2px 8px rgba(147, 197, 253, 0.2) !important;
    position: relative !important;
    overflow: hidden !important;
    display: inline-flex !important;
    align-items: center !important;
}

.page-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 购买信息样式 */
.purchase-info-section {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.purchase-info-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #93c5fd 0%, #60a5fa 50%, #3b82f6 100%);
}

.purchase-info-section h3 {
    margin-bottom: 1.5rem;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.purchase-info-section h3::before {
    content: '💡';
    font-size: 1.5rem;
}

.purchase-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.purchase-info-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-radius: 12px;
    color: #374151;
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.purchase-info-list li:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-color: #10b981;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.purchase-info-list li i {
    color: #10b981;
    font-size: 1.125rem;
    min-width: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    flex-shrink: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tab-buttons {
        gap: 0.5rem;
        padding: 0.25rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .tab-buttons::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .tab-btn::before {
        width: 50%;
    }
    
    .tab-btn.active::before {
        width: 70%;
    }
    
    .tab-count {
        font-size: 0.6875rem;
        padding: 0.125rem 0.375rem;
    }
    
    .pagination {
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .page-link {
        min-width: 2.5rem;
        height: 2.5rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .page-link i {
        font-size: 1rem;
    }
    
    .page-link:hover:not(.disabled) i {
        transform: scale(1.15);
    }
    
    .page-info {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    .bulk-purchase-section {
        padding: 1.5rem;
    }
    
    .bulk-purchase-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .bulk-purchase-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .bulk-purchase-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
    
    .bulk-purchase-text h3 {
        font-size: 1.25rem;
    }
    
    .bulk-purchase-text p {
        font-size: 0.9375rem;
    }
    
    .bulk-purchase-btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.5rem;
    }
    
    .purchase-info-section {
        padding: 1.5rem;
    }
    
    .purchase-info-section h3 {
        font-size: 1.125rem;
    }
    
    .purchase-info-list li {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
}