/**
 * 图书详情页 CSS
 * 包含：Tab 切换、回到顶部、轮播图、个人中心菜单等样式
 */

/* ========== 字体预加载优化 ========== */
@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v109/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOej.woff2) format('woff2');
    font-display: block;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga';
}


/* ========== Tab 切换样式 ========== */
.tab-item {
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    outline: none;
    padding: 0.75rem 0.75rem;
    width: auto;
    border-radius: 0.25rem;
}

/* 隐藏横向滚动条 */
.tab-item::-webkit-scrollbar {
    display: none;
}

.tab-item:hover {
    color: #0a446b;
    background-color: rgba(10, 68, 107, 0.05);
}

.tab-item.active {
    background-color: #0a446b !important;
    color: white !important;
}

/* Tab 内容 */
.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

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


/* ========== 个人中心菜单样式 ========== */
.personal-menus {
    transition: all 0.2s ease;
    transform: scale(0.95);
    opacity: 0;
    visibility: hidden;
}

.personal-menus.active {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}

/* ========== 轮播图样式 ========== */
.carousel {
    position: relative;
    overflow: hidden;
}

.slide-viewer {
    position: relative;
}

.slide-group-inner {
    position: relative;
}

.slide {
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

.carousel-indicators {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.carousel-indicators li {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicators li.active {
    background-color: #0a446b;
    transform: scale(1.2);
}

/* ========== 目录样式 ========== */
.catalog {
    list-style: none;
    padding: 0;
    margin: 0;
}

.catalog-item {
    line-height: 1.6;
}

.catalog-children {
    list-style: none;
    padding-left: 1rem;
}

.catalog-children .catalog-item {
    font-size: 0.875rem;
    color: #617189;
}

/* ========== 资源列表样式 ========== */
.book-resource a {
    display: block;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

.book-resource a:hover {
    color: #0a446b;
}

/* ========== Abook 课程样式 ========== */
.abook-thumbnail img {
    width: 100%;
    border-radius: 0.5rem;
}

.abook-content {
    line-height: 1.8;
}

.abook-url a {
    word-break: break-all;
}

/* ========== 二维码资源样式 ========== */
.qrcode-resource {
    transition: background-color 0.2s ease;
}

.qrcode-resource:hover {
    background-color: #f3f4f6;
}

.qrcode-resource .type {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* ========== 文本截断样式 ========== */
.book-title-line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 深色模式支持 ========== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #111721;
    }
}

/* ========== 视频样式 ========== */
video {
    max-width: 100%;
    height: auto;
}

/* ========== 购买链接样式 ========== */
.buy-link-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.abook, .qrcode, .cloud, .lanchang, .dangdang, .jingdong, .amazon {
    background: url(../../../internal/common/image/hep-ico.png) no-repeat;
    background-size: 460px 460px;
}
.lanchang, .dangdang, .jingdong, .amazon{
    width: auto;
    height: 20px;
 /*   background-size: cover;
    background-repeat: no-repeat;
    background-position: center;*/
}

.lanchang {
    width: 100px;
    background-position: -56px -22px;
}

.dangdang {
    width: 54px;
    background-position: -96px -144px;
}

.jingdong {
    width: 90px;
    background-position: -96px -74px;
}

.buy-link-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 购买链接容器 - 允许自动换行 */
.buy-links-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
