/*
 * Textbooks.css - 日语教材模块样式
 * 按照效果图实现：每种语言一行，左侧语言图标+名称，右侧书籍横向排列
 */

/* 模块外部容器 */
.textbooks-wrapper {
    width: 100%;
    height: calc(100vh - 80px);
    background: #ffffff;
    overflow: hidden;
}

/* Loading 状态 */
.textbooks-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 16px;
    color: #64748b;
    font-size: 14px;
}

.textbooks-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #c41e3a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 主内容区 - 可滚动 */
.textbooks-main {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 0;
}

/* 每种语言的行 */
.textbooks-lang-row {
    display: flex;
    align-items: flex-start;
    padding: 24px 24px 24px 6px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.textbooks-lang-row:last-child {
    border-bottom: none;
}

/* 左侧语言信息区 */
.lang-info-section {
    width: 100px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-right: 14px;
}

/* 语言图标框 - 完全按照 textbook-3.css */
.lang-icon-box {
    width: 48px;
    height: 48px;
    background-color: #f5f5f7;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e5e7;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* 方块内的加粗缩写文字 */
.lang-abbr-text {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    letter-spacing: -0.5px;
}

/* 语言名称 */
.lang-label {
    font-size: 13px;
    font-weight: 500;
    color: #86868b;
    text-align: center;
    line-height: 1.3;
}

/* 右侧书籍区域 */
.lang-books-section {
    flex: 1;
    display: flex;
    gap: 42px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lang-books-section::-webkit-scrollbar {
    display: none;
}

/* 书籍项 */
.book-item {
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    width: 160px;
}

.book-item:hover {
    transform: translateY(-4px);
}

.book-item:hover .book-hover-overlay {
    opacity: 1;
}

/* 书籍封面 - 竖向矩形，取消圆角 */
.book-cover-wrapper {
    position: relative;
    width: 120px;
    height: 174px; /* 120px × 1.45 = 174px */
    border-radius: 0;
    overflow: hidden;
    background: #f5f5f7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.book-item:hover .book-cover-wrapper {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.book-cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 悬停遮罩 */
.book-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.play-btn {
    width: 40px;
    height: 40px;
    color: #ffffff;
}

/* 教材名称 - 封面下方 */
.book-title-text {
    margin-top: 12px;
    width: 160px; /* 比封面宽 40px */
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    line-height: 1.4;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 空状态 */
.textbooks-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 16px;
    color: #9ca3af;
    padding: 40px 0;
}

.empty-icon {
    font-size: 64px;
}

.textbooks-empty p {
    font-size: 16px;
    margin: 0;
}
