/* ========================================
   缂╃暐鍥炬祻瑙堟ā寮?- 鍝嶅簲寮忓垪鏁帮細澶у睆5鍒椼€佸钩鏉?鍒椼€佸皬骞虫澘3鍒椼€佹墜鏈?鍒?   ======================================== */
/* 缂╃暐鍥剧綉鏍煎鍣?*/
.thumbnail-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    /* 鍥為€€锛氫娇鐢╢lexbox甯冨眬 */
    gap: 12px;
    padding: 12px;
    overflow-y: auto;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    -ms-flex-line-pack: start;
    align-content: flex-start;
}

/* 鐜颁唬娴忚鍣ㄤ娇鐢╣rid */
@supports (display: grid) {
    .thumbnail-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        /* 琛岄珮鐢盝S鍔ㄦ€佽绠楋紝榛樿auto */
        grid-auto-rows: auto;
        gap: 8px;
        padding: 8px;
        overflow-y: auto;
        flex: 1;
        align-content: start;
    }
}

/* 鍗曚釜缂╃暐鍥惧崱鐗?- 4:3 妯悜姣斾緥 */
.thumbnail-card {
    position: relative;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    -webkit-transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    /* flexbox鍥為€€锛氬浐瀹氬搴﹀拰楂樺害 */
    width: calc(20% - 8px);
    height: 180px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    /* 鐜颁唬娴忚鍣細4:3 妯悜姣斾緥锛岄€傚悎灞曠ず鏁板鍥惧舰 */
    aspect-ratio: 4 / 3;
    /* 闃叉鍐呭鎾戝紑瀵艰嚧閲嶅彔 */
    min-height: 0;
}

/* Grid 甯冨眬涓嬬殑鍗＄墖 */
@supports (display: grid) {
    .thumbnail-card {
        width: auto;
        height: auto;
    }
}

/* 涓嶆敮鎸?aspect-ratio 鐨勬祻瑙堝櫒闄嶇骇 */
@supports not (aspect-ratio: 4 / 3) {
    .thumbnail-card {
        height: 150px;
        /* 4:3 姣斾緥闄嶇骇楂樺害 */
    }
}

.thumbnail-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.thumbnail-card:focus-visible,
.thumbnail-card:focus-within {
    outline: 3px solid rgba(37, 99, 235, 0.5);
    outline-offset: 2px;
    border-color: #2563eb;
    box-shadow: var(--shadow-lg);
}

.thumbnail-card-open {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.thumbnail-card-open:focus-visible {
    outline: none;
}

/* 缂╃暐鍥鹃瑙堝尯鍩?- 濉厖鍓╀綑绌洪棿锛岄槻姝㈡孩鍑?*/
.thumbnail-preview {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    max-height: 100%;
    background: white;
    overflow: hidden;
}

/* 缂╃暐鍥惧浘鐗囨牱寮忥紙浠嶨GB鏂囦欢鎻愬彇鐨勯潤鎬佸浘鐗囷級 */
.thumbnail-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 瀹藉害閾烘弧锛岃秴鍑洪儴鍒嗚鍓?*/
    object-position: center top;
    /* 姘村钩灞呬腑锛岄《閮ㄥ榻?*/
    opacity: 0;
    transition: opacity 0.3s ease;
    background: white;
}

/* 闈欐€佸崰浣嶇鏍峰紡锛堝鐢紝鍥剧墖鍔犺浇澶辫触鏃舵樉绀猴級 */
.thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: white;
    color: #475569;
}

.thumbnail-placeholder i {
    font-size: 2.5rem;
    color: var(--primary-light);
}

.thumbnail-placeholder .file-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    opacity: 0.6;
}

.thumbnail-preview .loading-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #475569;
    font-size: 0.85rem;
}

.thumbnail-preview .loading-placeholder i {
    font-size: 2rem;
    color: var(--primary-light);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

/* 缂╃暐鍥句俊鎭尯鍩?- 濮嬬粓鏄剧ず鍦ㄥ簳閮?*/
.thumbnail-info {
    padding: 8px 10px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-white);
    flex-shrink: 0;
    height: 56px;
    min-height: 56px;
    max-height: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.thumbnail-info h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    /* 鍏佽涓よ鏄剧ず */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    line-height: 1.3;
}

/* 闅愯棌璺緞淇℃伅锛岃鏍囬鏈夋洿澶氱┖闂?*/
.thumbnail-info p {
    display: none;
}

/* 鐐瑰嚮鏌ョ湅閬僵 */
.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    opacity: 0;
}

.thumbnail-card:hover .thumbnail-overlay,
.thumbnail-card:focus-visible .thumbnail-overlay,
.thumbnail-card:focus-within .thumbnail-overlay {
    background: rgba(59, 130, 246, 0.15);
    opacity: 1;
}

.thumbnail-overlay span {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    transform: translateY(10px);
    transition: var(--transition);
}

.thumbnail-card:hover .thumbnail-overlay span,
.thumbnail-card:focus-visible .thumbnail-overlay span,
.thumbnail-card:focus-within .thumbnail-overlay span {
    transform: translateY(0);
}

/* ========== 瀹氬埗GGB鍗＄墖鏍峰紡 ========== */
.thumbnail-card-custom {
    cursor: pointer;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    /* 涓庢櫘閫氬崱鐗囦竴鑷寸殑瀹炵嚎杈规 */
}

.thumbnail-card-custom:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.thumbnail-custom-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent !important;
    padding: 8px;
    overflow: hidden;
}

.thumbnail-custom-preview .custom-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.thumbnail-card-custom:hover .custom-icon,
.thumbnail-card-custom:focus-visible .custom-icon,
.thumbnail-card-custom:focus-within .custom-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.thumbnail-custom-preview .custom-icon i {
    font-size: 1.25rem;
    color: white;
}

.thumbnail-custom-preview .custom-text {
    text-align: center;
    line-height: 1.35;
}

.thumbnail-custom-preview .custom-line1 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 0;
}

.thumbnail-custom-preview .custom-line2 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 1px;
}

.thumbnail-custom-preview .custom-line3 {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

.thumbnail-custom-overlay {
    background: rgba(59, 130, 246, 0.08) !important;
}

.thumbnail-card-custom:hover .thumbnail-custom-overlay {
    background: rgba(59, 130, 246, 0.15) !important;
}

.thumbnail-card-custom .thumbnail-info h4 {
    color: #3b82f6;
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
}

.thumbnail-card-custom .thumbnail-info p {
    color: #475569;
}

/* 缂╃暐鍥惧垎椤垫帶鍒?- 鍥哄畾鍦ㄩ潰鏉垮簳閮紝涓嶉伄鎸＄缉鐣ュ浘 */
.thumbnail-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--border-color);
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    flex-shrink: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

/* 椤电爜瀹瑰櫒 */
.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* 椤电爜鎸夐挳 */
.page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    font-weight: 500;
}

.page-num:hover:not(:disabled) {
    border-color: var(--subject-color, var(--primary-color));
    color: var(--subject-color, var(--primary-color));
    background: var(--primary-bg);
}

.page-num.active {
    background: var(--subject-color, var(--primary-color));
    border-color: var(--subject-color, var(--primary-color));
    color: white;
    cursor: default;
}

/* 鐪佺暐鍙?*/
.page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    color: #475569;
    font-size: 0.9rem;
    user-select: none;
}

/* 椤电爜璺宠浆妗?*/
.page-jump {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.page-jump input {
    width: 50px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: white;
    transition: var(--transition);
}

.page-jump input:focus {
    border-color: var(--subject-color, var(--primary-color));
    box-shadow: none;
}

.page-num:focus-visible,
.page-jump input:focus-visible,
.page-jump-btn:focus-visible,
.pagination-btn:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.5);
    outline-offset: 2px;
}

.page-jump input::-webkit-outer-spin-button,
.page-jump input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.page-jump input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.page-jump-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 12px;
    background: var(--subject-color, var(--primary-color));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.page-jump-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* 銆愬凡娓呯悊銆?folder-item 鏃ф牱寮忓凡琚笅鏂?L3842 鐨勬柊鐗堣鐩栵紝鍒犻櫎姝ゅ閲嶅瀹氫箟 */

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid var(--subject-color, var(--primary-color));
    background: white;
    color: var(--subject-color, var(--primary-color));
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: bold;
    flex-shrink: 0;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--subject-color, var(--primary-color));
    color: white;
    transform: scale(1.05);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: var(--border-color);
    color: var(--text-muted);
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-primary);
    padding: 0 8px;
    font-weight: 500;
    white-space: nowrap;
}

.pagination-info strong {
    color: var(--subject-color, var(--primary-color));
    font-weight: 700;
}

/* 缂╃暐鍥炬ā寮忎笅鐨勭洰褰曟牱寮?*/
.catalog-nav.thumbnail-mode .ggb-item {
    display: none !important;
}

.catalog-nav.thumbnail-mode .ggb-list {
    padding-left: 0.25rem;
}

/* 鏂囦欢澶圭偣鍑绘牱寮?- 鏈€搴曞眰鐩綍锛氫笌涓婄骇 chapter-header 椋庢牸涓€鑷达紝灏哄鐣ュ皬 */
.folder-item {
    cursor: pointer;
}

.folder-item .chapter-header.folder-clickable {
    background: white;
    border: 0.5px solid #333;
    border-radius: 4px;
    margin-top: 2px;
    padding: 0.35rem 0.6rem;
    box-shadow: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    font-size: 0.82rem;
    min-height: 24px;
}

.folder-item .chapter-header.folder-clickable:hover {
    background: #f0f7ff;
    color: var(--text-primary);
}

.folder-item .chapter-header.folder-clickable:hover .chapter-icon {
    color: var(--primary-color);
}

.folder-item.active .chapter-header.folder-clickable {
    background: #6b8db5;
    color: white;
    border-color: #6b8db5;
}

/* 缂╃暐鍥鹃潰鏉匡紙鏄剧ず鍦╟ontent-area涓級- 蹇呴』鎾戞弧鍙敤绌洪棿锛屼笉婧㈠嚭 */
.thumbnail-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    max-height: 100%;
    /* 闄愬埗鏈€澶ч珮搴︼紝闃叉婧㈠嚭 */
    height: 100%;
    /* 鎾戞弧鐖跺鍣?*/
    background: var(--bg-white);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.thumbnail-panel.active {
    display: flex;
}

/* 缂╃暐鍥剧綉鏍?- 鍝嶅簲寮忓垪鏁帮紝鍥哄畾琛岄珮 */
.thumbnail-panel .thumbnail-grid {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    background: var(--bg-white);
    /* flexbox鍥為€€ */
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    -ms-flex-line-pack: start;
    align-content: flex-start;
}

/* 鐜颁唬娴忚鍣ㄤ娇鐢╣rid */
@supports (display: grid) {
    .thumbnail-panel .thumbnail-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        /* 琛岄珮鐢盝S鍔ㄦ€佽绠楋紝榛樿auto */
        grid-auto-rows: auto;
        gap: 8px;
        padding: 8px;
        align-content: start;
    }
}

/* 褰撳彧鏈夋杩庨潰鏉挎椂锛屽眳涓樉绀?- 浣跨敤鍏煎鑰佹祻瑙堝櫒鐨勭被鍚嶆柟妗?*/
.thumbnail-panel .thumbnail-grid.thumbnail-grid--welcome {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    height: 100%;
    overflow: hidden;
    /* 娆㈣繋闈㈡澘涓嶉渶瑕佹粴鍔ㄦ潯 */
}

/* 鍒嗛〉鍖哄煙 - 鍥哄畾鍦ㄩ潰鏉垮簳閮紝纭繚涓嶉伄鎸″唴瀹?*/
.thumbnail-panel .thumbnail-pagination {
    flex-shrink: 0;
    z-index: 100;
    border-top: 1px solid var(--border-color);
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    /* 妗岄潰绔細鍦ㄩ潰鏉垮唴閮ㄦ樉绀猴紝涓嶄娇鐢╢ixed瀹氫綅 */
    position: relative;
}

/* 绉诲姩绔垎椤碉細fixed瀹氫綅锛屽簳閮ㄦ樉绀?*/
@media (max-width: 768px) {
    .thumbnail-panel .thumbnail-pagination {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
    }
}

.thumbnail-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 100px;
    padding: 0 8px;
    box-sizing: border-box;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 绌虹姸鎬佹彁绀?- 灞呬腑鏄剧ず */
.thumbnail-empty {
    grid-column: 1 / -1;
    /* 鍗犳嵁鎵€鏈夊垪 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    height: 100%;
    color: var(--text-secondary);
    padding: 40px;
    text-align: center;
    background: var(--bg-white);
}

.thumbnail-empty i {
    font-size: 5rem;
    color: var(--primary-light);
    margin-bottom: 24px;
    opacity: 0.6;
}

.thumbnail-empty p {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 300px;
}

/* 缂╃暐鍥炬杩庨潰鏉?- 甯﹀绉戝浘鏍囷紝瀹屽叏灞呬腑 */
.thumbnail-welcome {
    grid-column: 1 / -1;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 100%;
    padding: 40px;
    text-align: center;
    background: var(--bg-white);
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* 褰撳彧鏄剧ず娆㈣繋闈㈡澘鏃讹紝grid瀹瑰櫒鍙樻垚flex灞呬腑 */
.thumbnail-grid.thumbnail-grid--welcome-only {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    height: 100%;
}

.thumbnail-welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.thumbnail-welcome h2 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.thumbnail-welcome>p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.thumbnail-welcome-features {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.thumbnail-welcome-features span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.thumbnail-welcome-features span i {
    color: var(--subject-color, var(--primary-color));
}

.thumbnail-invite,
.welcome-invite {
    margin-top: 1.5rem;
    text-align: center;
}

@media (max-width: 768px) {
    .thumbnail-welcome {
        padding: 20px;
        min-height: 300px;
    }

    .thumbnail-welcome h2 {
        font-size: 1.2rem;
    }

    .thumbnail-welcome-features {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* 杩斿洖缂╃暐鍥炬寜閽紙缁ф壙 .fullscreen-btn 鏍峰紡锛屽彧鎺у埗鏄剧ず/闅愯棌锛?*/
.back-to-thumbnail-btn {
    display: none;
}

.back-to-thumbnail-btn.show {
    display: inline-flex;
}

/* 鍝嶅簲寮忕缉鐣ュ浘 - 妗岄潰绔?*/
@media (min-width: 769px) {

    /* 妗岄潰绔垎椤靛缁堝湪闈㈡澘鍐咃紝涓嶄娇鐢╢ixed瀹氫綅 */
    .thumbnail-pagination {
        position: relative;
        padding: 10px 16px;
    }

    .thumbnail-panel .thumbnail-grid {
        padding-bottom: 12px;
        /* 涓嶉渶瑕侀澶栧簳閮ㄩ棿璺?*/
    }
}

/* 鍝嶅簲寮忕缉鐣ュ浘 - 灏忓钩鏉?鎵嬫満绔?*/
@media (max-width: 768px) {
    .thumbnail-grid {
        /* 灏忓钩鏉匡細3鍒?*/
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: auto;
        gap: 6px;
        padding: 6px;
    }

    .thumbnail-panel .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: auto;
        gap: 6px;
        padding: 6px;
        /* 缁欏簳閮ㄥ垎椤垫爮鐣欏嚭瓒冲绌洪棿锛岄伩鍏嶈瑁佸垏 */
        padding-bottom: 80px;
        overflow-y: auto;
    }

    .thumbnail-info {
        height: 44px;
        min-height: 44px;
        max-height: 44px;
        padding: 5px 6px;
    }

    .thumbnail-info h4 {
        font-size: 0.88rem;
    }

    .mode-btn {
        padding: 5px 10px;
        height: 28px;
        font-size: 0.75rem;
    }

    .mode-btn i {
        font-size: 0.85rem;
    }

    .mode-btn span {
        display: none;
    }

    .thumbnail-pagination {
        padding: 8px 12px 8px 70px;
        /* 宸︿晶鐣欏嚭绌洪棿閬垮紑鐩綍鎸夐挳 */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        z-index: 1050;
        height: auto;
        min-height: calc(62px + env(safe-area-inset-bottom, 0px));
        max-height: none;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
    }

    .pagination-btn {
        width: 44px;
        height: 44px;
        font-size: 0.85rem;
    }

    .page-num {
        min-width: 44px;
        height: 44px;
        font-size: 0.85rem;
    }

    /* 骞虫澘绔烦杞鏍峰紡 */
    .page-jump {
        margin-left: 8px;
        padding-left: 8px;
        font-size: 0.8rem;
    }

    .page-jump input {
        width: 48px;
        height: 44px;
    }

    .page-jump-btn {
        min-width: 44px;
        height: 44px;
        padding: 0 10px;
        font-size: 0.75rem;
    }
}

/* 鍝嶅簲寮忕缉鐣ュ浘 - 鎵嬫満绔?*/
@media (max-width: 480px) {
    .thumbnail-grid {
        /* 鎵嬫満锛?鍒?*/
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
        gap: 5px;
        padding: 5px;
    }

    .thumbnail-panel .thumbnail-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
        gap: 5px;
        padding: 5px;
        /* 缁欏簳閮ㄥ垎椤垫爮鍜屾祻瑙堝櫒搴曢儴宸ュ叿鏍忕暀鍑鸿冻澶熺┖闂?*/
        padding-bottom: 100px;
        overflow-y: auto;
    }

    .thumbnail-info {
        height: 40px;
        min-height: 40px;
        max-height: 40px;
        padding: 4px 5px;
    }

    .thumbnail-info h4 {
        font-size: 0.82rem;
    }



    .thumbnail-pagination {
        padding: 8px 10px 8px 60px;
        /* 宸︿晶鐣欏嚭绌洪棿閬垮紑鐩綍鎸夐挳 */
        height: auto;
        min-height: calc(62px + env(safe-area-inset-bottom, 0px));
        max-height: none;
        gap: 4px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        z-index: 1050;
        /* 楂樹簬鐩綍鎸夐挳 */
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        /* 鑰冭檻鎵嬫満娴忚鍣ㄥ簳閮ㄥ伐鍏锋爮鐨勫畨鍏ㄥ尯鍩?*/
        padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
    }

    .pagination-btn {
        width: 44px;
        height: 44px;
        font-size: 0.8rem;
    }

    .page-num {
        min-width: 44px;
        height: 44px;
        padding: 0 4px;
        font-size: 0.8rem;
    }

    .page-ellipsis {
        width: 18px;
        font-size: 0.85rem;
    }

    .pagination-pages {
        gap: 3px;
    }

    /* 鎵嬫満绔烦杞鏍峰紡 - 绠€鍖栨樉绀?*/
    .page-jump {
        margin-left: 6px;
        padding-left: 6px;
        gap: 4px;
    }

    .page-jump span {
        display: none;
        /* 闅愯棌鏂囧瓧 */
    }

    .page-jump input {
        width: 48px;
        height: 44px;
        font-size: 0.8rem;
    }

    .page-jump-btn {
        min-width: 44px;
        height: 44px;
        padding: 0 8px;
        font-size: 0.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .thumbnail-card,
    .thumbnail-image,
    .thumbnail-overlay,
    .thumbnail-overlay span,
    .thumbnail-custom-preview .custom-icon,
    .page-num,
    .page-jump input,
    .page-jump-btn,
    .pagination-btn,
    .folder-item .chapter-header.folder-clickable {
        transition: none;
    }

    .thumbnail-preview .loading-placeholder i {
        animation: none;
    }

    .thumbnail-card:hover,
    .thumbnail-card-custom:hover .custom-icon,
    .page-jump-btn:hover,
    .pagination-btn:hover:not(:disabled) {
        transform: none;
    }
}
