﻿/* ========================================
   璇句欢椤甸潰鏍峰紡
   ======================================== */
/* 妯箙宸茬Щ闄わ紝瀛︾淇℃伅杩佺Щ鍒扮缉鐣ュ浘闈㈡澘鍐?*/
.page-header {
    display: none;
}

.course-layout {
    display: flex;
    /* 瀵艰埅鏍忔槸 fixed 瀹氫綅锛岄渶瑕?margin-top 鎶婂唴瀹规帹鍒板鑸爮涓嬫柟 */
    margin-top: calc(var(--site-nav-height, 54px) + 1px);
    /* 鍘绘帀妯箙鍚庯紝鍙渶鍑忓幓瀵艰埅鏍忛珮搴︼紙鍚玝order锛?*/
    height: calc(100vh - var(--site-nav-height, 54px) - 1px);
    height: calc(100dvh - var(--site-nav-height, 54px) - 1px);
    max-height: calc(100vh - var(--site-nav-height, 54px) - 1px);
    max-height: calc(100dvh - var(--site-nav-height, 54px) - 1px);
    overflow: hidden;
}

/* 鍚堝苟鍚庣殑鏍囬鏍忎腑闂村尯鍩燂細瀛︾淇℃伅 + 鍓╀綑娆℃暟 */
.subject-info-center {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    opacity: 0.9;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.subject-info-center .subject-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.subject-info-center .subject-desc {
    opacity: 0.85;
    font-size: 0.82rem;
}

.subject-info-center .subject-separator {
    opacity: 0.5;
    font-size: 0.65rem;
}

/* 绐勫睆锛氶殣钘忓绉戞弿杩帮紝鍙繚鐣欏绉戝悕 */
@media (max-width: 768px) {

    .subject-info-center .subject-desc,
    .subject-info-center .subject-separator {
        display: none;
    }
}

/* 鏋佺獎灞忥細闅愯棌鏁翠釜瀛︾淇℃伅锛屽彧鐣欐枃浠跺す鍚嶅拰璇句欢鏁?*/
@media (max-width: 480px) {
    .subject-info-center {
        display: none;
    }
}

/* 璇剧▼椤甸潰绂佹body婊氬姩 */
body.course-page {
    overflow: hidden;
    height: 100vh;
}

body.course-page .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

/* 宸︿晶杈规爮 */
.sidebar {
    width: 300px;
    min-width: 300px;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-header {
    padding: 0 12px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0.5px solid #333;
    border-radius: 4px;
    margin: 8px 12px 0 12px;
    background: white;
    flex-shrink: 0;
}

/* 鏀惰棌鎸夐挳锛堝湪tab鍒囨崲鏍忓唴锛?*/
.favorites-header-btn {
    margin-left: 0;
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 8px;
    background: transparent;
    border: none;
    border-bottom: none;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0;
}

.favorites-header-btn:hover {
    color: #f59e0b;
    background: rgba(255, 255, 255, 0.5);
}

.favorites-header-btn.active {
    color: #d97706;
    background: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.sidebar-header h2 {
    font-size: 1rem;
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 鎼滅储妗?*/
.search-box {
    padding: 6px 12px 8px 12px;
    background: transparent;
    flex-shrink: 0;
    border-bottom: 1px solid #e2e8f0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    position: absolute;
    left: 14px;
    color: #94a3b8;
}

.search-input {
    width: 100%;
    padding: 0.55rem 1rem 0.55rem 2.5rem;
    border: 0.5px solid #333;
    background: white;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #334155;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    background: #ffffff;
    border-color: #bfdbfe;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
    color: #94a3b8;
}

/* 鏀惰棌鍔熻兘鏍峰紡 */

/* 鏀惰棌鎸夐挳锛堝湪娴忚妯″紡鍒囨崲鍖哄煙锛?*/
.favorites-mode-btn {
    position: relative;
}

.favorites-mode-btn i {
    color: #f59e0b;
}

.favorites-mode-btn.active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
    font-weight: 600;
    background: transparent;
}

.favorites-mode-btn.active i {
    color: #f59e0b;
}

.fav-count-badge {
    position: static;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
}

.fav-count-badge:empty,
.fav-count-badge[data-count="0"] {
    display: none;
}

/* 鏀惰棌闈㈡澘锛堜笌鐩綍鍖哄煙骞崇骇锛?*/
.favorites-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: white;
    min-height: 0;
    /* 鍏佽flex瀛愬厓绱犳敹缂?*/
    max-height: calc(100vh - 280px);
    /* 闄愬埗鏈€澶ч珮搴︼紝纭繚鑳芥粴鍔?*/
}

.favorites-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    flex-shrink: 0;
}

.favorites-panel-title {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.favorites-panel-title i {
    color: white;
}

.favorites-panel-header .favorites-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
}

.favorites-panel .favorites-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem;
    min-height: 0;
    /* 鍏佽flex瀛愬厓绱犳敹缂╋紝鍚敤婊氬姩 */
    -webkit-overflow-scrolling: touch;
    /* iOS婊氬姩浼樺寲 */
}

/* 鏃х増鏀惰棌鍖哄煙鏍峰紡锛堜繚鐣欏吋瀹癸級 */
.favorites-section {
    background: white;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.favorites-header:hover {
    background: var(--bg-light);
}

.favorites-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.favorites-title i {
    color: #f59e0b;
}

.favorites-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-gray);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.favorites-toggle {
    color: var(--text-light);
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.favorites-toggle.expanded {
    transform: rotate(180deg);
}

.favorites-list {
    max-height: none;
    overflow-y: auto;
}

.favorites-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-light);
}

.favorites-empty i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.favorites-empty p {
    font-size: 0.85rem;
    margin: 0;
}

.favorites-login-tip {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.favorites-login-tip i {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    display: block;
}

.favorites-login-tip p {
    font-size: 0.8rem;
    margin: 0 0 0.75rem;
}

.favorites-login-btn {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}

.favorites-login-btn:hover {
    background: var(--primary-dark);
}

.favorite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-gray);
    transition: background 0.2s;
}

.favorite-item:hover {
    background: var(--primary-bg);
}

.favorite-item:last-child {
    border-bottom: none;
}

.favorite-item-info {
    flex: 1;
    min-width: 0;
}

.favorite-item-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-item-path {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.15rem;
}

.favorite-item-remove {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-light);
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
}

.favorite-item:hover .favorite-item-remove {
    opacity: 1;
}

.favorite-item-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* 鏀惰棌鎸夐挳鏍峰紡 */
.favorite-btn {
    transition: all 0.2s;
}

.favorite-btn.favorited {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    color: white !important;
}

.favorite-btn.favorited:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

/* 鏀惰棌鍗＄墖鏍峰紡锛堝熀浜庣缉鐣ュ浘鍗＄墖锛?*/
.thumbnail-card.favorites-card {
    position: relative;
}

.favorites-card-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    color: #f59e0b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.thumbnail-card.favorites-card:hover .favorites-card-remove {
    opacity: 1;
}

.favorites-card-remove:hover {
    background: #fef3c7;
    color: #dc2626;
    transform: scale(1.1);
}

.favorites-card-remove i {
    font-size: 0.9rem;
}

/* 鏀惰棌涓虹┖鏃剁殑鏍峰紡 */
.favorites-thumbnail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8fafc;
}

/* 褰搕humbnail-grid鍙寘鍚┖鐘舵€佹椂锛岃缃浉瀵瑰畾浣?*/
.thumbnail-grid:has(.favorites-thumbnail-empty) {
    position: relative;
    min-height: 400px;
}

/* 鍏煎涓嶆敮鎸?has鐨勬祻瑙堝櫒 */
.thumbnail-grid--favorites-empty {
    position: relative;
    min-height: 400px;
}

.favorites-thumbnail-empty i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.favorites-thumbnail-empty h3 {
    font-size: 1.25rem;
    color: #475569;
    margin: 0 0 8px;
    font-weight: 600;
}

.favorites-thumbnail-empty p {
    font-size: 0.9rem;
    color: #94a3b8;
    margin: 0;
}

.favorites-login-btn-large {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.favorites-login-btn-large:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

/* 鍝嶅簲寮忚皟鏁?*/
@media (max-width: 768px) {
    .favorites-thumbnail-empty {
        padding: 40px 20px;
        min-height: 200px;
    }

    .favorites-thumbnail-empty i {
        font-size: 3rem;
    }
}

.catalog-nav {
    padding: 0.75rem;
    padding-bottom: 120px;
    /* 搴曢儴鐣欏嚭绌洪棿缁欐诞鍔ㄧ殑"鍏抽棴鐩綍"鎸夐挳锛?0px鎸夐挳楂?20px搴曢儴瀹氫綅+鍏呰冻浣欓噺锛?*/
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

/* 骞寸骇鍒嗙粍 */
.grade-group {
    margin-bottom: 2px;
}

/* 骞寸骇鏍囬 - 鐙珛鏂瑰潡 + 宸︿晶鑹插潡 */
.grade-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 0.5px solid #333;
    border-left: 6px solid var(--primary-color, #4a6fa5);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0;
    /* 灞曞紑鍚庡浐瀹氬湪渚ц竟鏍忛《閮?*/
    position: sticky;
    top: 0;
    z-index: 10;
}

/* 涓荤洰褰曞惊鐜厤鑹?*/
.grade-group:nth-child(6n+1)>.grade-header {
    border-left-color: #4a6fa5;
}

.grade-group:nth-child(6n+2)>.grade-header {
    border-left-color: #0d9488;
}

.grade-group:nth-child(6n+3)>.grade-header {
    border-left-color: #d97706;
}

.grade-group:nth-child(6n+4)>.grade-header {
    border-left-color: #7c3aed;
}

.grade-group:nth-child(6n+5)>.grade-header {
    border-left-color: #16a34a;
}

.grade-group:nth-child(6n+6)>.grade-header {
    border-left-color: #e11d48;
}

.grade-header:hover {
    background: #f0f7ff;
}

/* 婵€娲绘椂锛氳摑鑹茶儗鏅?+ 鐧借壊鏂囧瓧 */
.grade-header.expanded {
    background: #6b8db5;
    color: white;
    border-left-width: 6px;
}

.grade-header.expanded .grade-name,
.grade-header.expanded .grade-toggle,
.grade-header.expanded .chapter-count {
    color: white;
}

.grade-icon {
    font-size: 1rem;
    margin-right: 0.5rem;
}

/* 骞寸骇鍚嶇О */
.grade-name {
    flex: 1;
    font-weight: 500;
    color: #000000;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grade-toggle {
    color: var(--text-light);
    font-size: 0.6rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.grade-header.expanded .grade-toggle {
    transform: rotate(90deg);
}

/* 绔犺妭鍒楄〃 */
.chapter-list {
    display: none;
    padding-left: 10px;
    margin-top: 0;
    margin-left: 4px;
}

.chapter-list.show {
    display: block;
    border-left: 1px dashed #333;
}

.chapter-item {
    margin-bottom: 0;
}

/* 娣卞眰宓屽鐩綍鏍峰紡浼樺寲 */
.ggb-list .chapter-item {
    margin-left: 0 !important;
}

.ggb-list .ggb-list {
    padding-left: 8px;
    margin-left: 4px;
}

.ggb-list .ggb-list.show {
    border-left: 1px dashed #333;
}

.ggb-list .ggb-list .ggb-list {
    padding-left: 6px;
}

.ggb-list .ggb-list .ggb-list .ggb-list {
    padding-left: 4px;
}

.ggb-list .ggb-list .ggb-list .ggb-list .ggb-list {
    padding-left: 4px;
}

/* 绔犺妭鏍囬 - 鐙珛鏂瑰潡 */
.chapter-header {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    color: #000000;
    cursor: pointer;
    background: white;
    border: 0.5px solid #333;
    border-radius: 4px;
    margin-top: 2px;
    transition: all 0.15s ease;
    font-size: 0.88rem;
    min-height: 26px;
    overflow: hidden;
    gap: 0.25rem;
    /* 瀛愭枃浠跺す鏍囬 sticky */
    position: sticky;
    top: 2.4rem;
    z-index: 5;
}

.chapter-header span:not(.chapter-toggle):not(.chapter-icon):not(.chapter-count) {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.chapter-icon {
    font-size: 0.7rem;
    flex-shrink: 0;
    margin-right: 0.3rem;
}

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

/* 婵€娲绘椂锛氳摑鑹茶儗鏅?+ 鐧借壊鏂囧瓧 */
.chapter-header.expanded {
    background: #6b8db5;
    color: white;
    font-weight: 500;
}

.chapter-header.expanded span,
.chapter-header.expanded .chapter-icon,
.chapter-header.expanded .chapter-toggle {
    color: white;
}

.chapter-toggle {
    margin-left: auto;
    font-size: 0.6rem;
    transition: transform 0.3s ease;
}

/* 璇句欢鏁伴噺鏍囩 - 闈犲彸鏄剧ず */
.chapter-count {
    margin-left: auto;
    font-size: 0.8em;
    color: #000;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 鏈変笁瑙掑舰鏃讹紝鏁伴噺涓嶉渶瑕?margin-left:auto */
.chapter-count + .chapter-toggle {
    margin-left: 8px;
}

.chapter-header.expanded .chapter-toggle {
    transform: rotate(90deg);
}

/* 璇句欢鍒楄〃 */
.ggb-list {
    display: none;
    padding-left: 8px;
    margin-top: 0;
    margin-left: 4px;
}

.ggb-list.show {
    display: block;
    border-left: 1px dashed #333;
}

/* 璇句欢椤?- 鐙珛鏂瑰潡 */
.ggb-item {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    background: white;
    border: 0.5px solid #333;
    border-radius: 4px;
    margin-top: 2px;
    transition: all 0.15s ease;
    font-size: 0.88rem;
}

.ggb-item:hover {
    background: #f0f7ff;
    color: var(--text-primary);
}

/* 閫変腑鐨勮浠讹細钃濊壊鑳屾櫙 */
.ggb-item.active {
    background: #6b8db5;
    color: white;
}

.ggb-item-icon {
    margin-right: 0.4rem;
}

/* 鍙充晶鍐呭鍖?- 蹇呴』闄愬埗楂樺害锛岃瀛愬厓绱犺兘姝ｇ‘甯冨眬 */
.content-area {
    flex: 1;
    padding: 0;
    background: var(--bg-white);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    position: relative;
    /* 闄愬埗鏈€澶ч珮搴?*/
}

/* 娆㈣繋闈㈡澘 */
.welcome-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 3rem;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.welcome-panel h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.welcome-panel>p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

.welcome-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

/* GGB 灞曠ず闈㈡澘 */
.ggb-panel {
    background: var(--bg-white);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    /* 鍏抽敭锛氬厑璁竑lex瀛愬厓绱犳敹缂?*/
    max-height: 100%;
}

.ggb-header {
    padding: 0 16px;
    min-height: 60px;
    background: linear-gradient(135deg, var(--subject-color, var(--primary-color)) 0%, var(--subject-dark, var(--primary-dark)) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.ggb-header-left h3 {
    font-size: 1rem;
    margin: 0;
}

.ggb-path {
    display: none;
}

.ggb-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ggb-header-right button:not(.rotate-fullscreen-btn) {
    height: 32px;
    padding: 0 0.75rem;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
}

/* 缂╂斁鎺у埗 */
.ggb-zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.75rem;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
}

.zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-scale {
    min-width: 50px;
    text-align: center;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0 0.5rem;
}

/* 鍏ㄥ睆鎸夐挳鍜屼笅杞芥寜閽?*/
.fullscreen-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* GGB 鏄剧ず鎺у埗鎸夐挳缁?*/
.ggb-display-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 2px;
}

.display-ctrl-group {
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.display-ctrl-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0.5rem 0.6rem;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.8rem;
    line-height: 1;
    white-space: nowrap;
}

.display-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.display-ctrl-btn:active {
    background: rgba(255, 255, 255, 0.35);
}

/* 涓や釜鎸夐挳涔嬮棿鐨勫垎闅旂嚎 */
.display-ctrl-group .display-ctrl-btn+.display-ctrl-btn {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* A 鍥炬爣锛堟爣绛惧ぇ灏忥級 */
.ctrl-icon {
    font-weight: 700;
    font-size: 0.8rem;
    font-family: serif;
}

.ctrl-icon-lg {
    font-size: 1.05rem;
}

/* 绾挎潯鍥炬爣 */
.ctrl-line {
    display: inline-block;
    width: 14px;
    border-radius: 1px;
    background: white;
}

.ctrl-line-thin {
    height: 1px;
}

.ctrl-line-thick {
    height: 3px;
}

/* +/- 鍥炬爣缂╁皬 */
.display-ctrl-btn i.fas {
    font-size: 0.6rem;
    opacity: 0.85;
}

/* 鎵嬫満绔樉绀烘帶鍒舵寜閽殑鍝嶅簲寮?*/
@media (max-width: 768px) {

    /* 鎵嬫満绔粯璁ら殣钘忥紝鍙湁杩涘叆鍏ㄥ睆鍚庢墠鏄剧ず锛堢敱 .fullscreen / .rotate-fullscreen 瑕嗙洊锛?*/
    .ggb-display-controls {
        display: none;
    }

    .display-ctrl-btn {
        padding: 4px 6px;
        font-size: 0.65rem;
    }

    .ctrl-icon {
        font-size: 0.65rem;
    }

    .ctrl-icon-lg {
        font-size: 0.8rem;
    }

    .ctrl-line {
        width: 10px;
    }
}


/* 鍏ㄥ睆妯″紡涓嬫樉绀烘帶鍒舵寜閽繚鎸佸彲瑙?*/
.ggb-panel.fullscreen .ggb-display-controls,
.ggb-panel.rotate-fullscreen .ggb-display-controls {
    display: flex;
}

#download-btn {
    background: rgba(34, 197, 94, 0.3);
    border-color: rgba(34, 197, 94, 0.5);
}

#download-btn:hover {
    background: rgba(34, 197, 94, 0.5);
}

/* 钃濊壊妗嗭細鐙珛鐨勫睍绀哄尯 */
.ggb-display-area {
    flex: 1;
    position: relative;
    background: var(--bg-light);
    overflow: hidden;
    overscroll-behavior: contain;
    min-height: 0;
    min-width: 0;
    /* 灏哄鐢盝S鍔ㄦ€佽绠?*/
}

/* 绾㈣壊妗嗭細鐙珛鐨凣GB灞曠ず绐楀彛 */
.ggb-display-window {
    position: absolute;
    top: 0;
    left: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    /* 浣嶇疆鍜屽昂瀵稿畬鍏ㄧ敱JS鎺у埗 */
}

.ggb-display-area.ggb-applet-loading .ggb-display-window {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* GGB瀹瑰櫒 */
.ggb-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    touch-action: none;
    overscroll-behavior: contain;
    /* 灏哄瀹屽叏鐢盝S鎺у埗 */
}

.ggb-container article,
.ggb-container canvas,
.ggb-container .applet_scaler,
.ggb-container .ggbTransform {
    touch-action: none;
    overscroll-behavior: contain;
}

html.ggb-css-fullscreen-lock,
body.ggb-css-fullscreen-lock {
    overflow: hidden !important;
    overscroll-behavior: none;
}

body.ggb-css-fullscreen-lock {
    touch-action: none;
}

/* 闅愯棌GeoGebra鑷甫鐨勫姞杞借繘搴︽潯 */
#ggb-container article>div:first-child,
.ggb-container article>div:first-child {
    display: none !important;
}

.ggb-tips {
    padding: 0.5rem 1.5rem;
    background: var(--primary-bg);
    color: var(--primary-dark);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.45;
}

.ggb-tip-spacer {
    display: inline-block;
    width: 2rem;
    flex: 0 0 2rem;
}

/* 鍏ㄥ睆妯″紡 - GGB灞曠ず绐楀彛鍏ㄥ睆 */
.ggb-panel.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    background: #1a1a2e;
}

.ggb-panel.fullscreen .ggb-header {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--subject-color, var(--primary-color)) 0%, var(--subject-dark, var(--primary-dark)) 100%);
    opacity: 0.95;
}

.ggb-panel.fullscreen .ggb-display-area {
    background: #1a1a2e;
}

.ggb-panel.fullscreen .ggb-display-window {
    border-radius: 0;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.ggb-panel.fullscreen .ggb-tips {
    display: none;
}

/* ========== 鏃嬭浆鍏ㄥ睆妯″紡 - 鎵嬫満妯睆娴忚 ========== */
.ggb-panel.rotate-fullscreen {
    position: fixed;
    /* 鏃嬭浆鍚庯細灞忓箷楂樺害鍋氬锛屽睆骞曞搴﹀仛楂?*/
    width: 100vh;
    width: 100dvh;
    height: 100vw;
    height: 100dvw;
    transform: rotate(90deg);
    transform-origin: top left;
    top: 0;
    left: 100vw;
    left: 100dvw;
    z-index: 10000;
    border-radius: 0;
    margin: 0;
    background: #1a1a2e;
}

.ggb-panel.rotate-fullscreen .ggb-header {
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, var(--subject-color, var(--primary-color)) 0%, var(--subject-dark, var(--primary-dark)) 100%);
    opacity: 0.95;
    flex-wrap: nowrap;
}

/* 妯睆妯″紡涓嬮噸缃墜鏈虹鎸夐挳琛屾牱寮忥紝闃叉鎸夐挳绔栨帓閿欎綅 */
.ggb-panel.rotate-fullscreen .ggb-header-right {
    width: auto;
    flex-wrap: nowrap;
    gap: 0.3rem;
    justify-content: flex-end;
}

.ggb-panel.rotate-fullscreen .ggb-header-right button {
    height: 28px;
    padding: 0 0.5rem;
    font-size: 0.75rem;
}

.ggb-panel.rotate-fullscreen .ggb-header-left h3 {
    font-size: 0.9rem;
}

.ggb-panel.rotate-fullscreen .ggb-path {
    display: none;
}

.ggb-panel.rotate-fullscreen .ggb-display-area {
    background: #1a1a2e;
}

.ggb-panel.rotate-fullscreen .ggb-display-window {
    border-radius: 0;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.ggb-panel.rotate-fullscreen .ggb-tips {
    display: none;
}

/* 鏃嬭浆鍏ㄥ睆鏃堕殣钘忓師鏈夌殑鍏ㄥ睆鎸夐挳鍜岃喘涔版寜閽紙浣嗕繚鐣欏埛鏂版寜閽級 */
.ggb-panel.rotate-fullscreen .fullscreen-btn,
.ggb-panel.rotate-fullscreen .buy-member-btn {
    display: none;
}

.ggb-panel.rotate-fullscreen #refresh-ggb-btn,
.ggb-panel.fullscreen #refresh-ggb-btn {
    display: flex !important;
}

/* 鏃嬭浆鍏ㄥ睆閫€鍑烘寜閽?*/
.rotate-exit-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.rotate-exit-btn:hover,
.rotate-exit-btn:active {
    background: rgba(255, 255, 255, 0.35);
}

/* 鏃嬭浆鍏ㄥ睆鎸夐挳 - 浠呮墜鏈虹鏄剧ず锛屾牱寮忎笌 .fullscreen-btn 缁熶竴 */
.rotate-fullscreen-btn {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.rotate-fullscreen-btn:hover,
.rotate-fullscreen-btn:active {
    background: rgba(255, 255, 255, 0.35);
}

/* 鎵嬫満绔墠鏄剧ず鏃嬭浆鍏ㄥ睆鎸夐挳锛屾枃瀛楅殣钘忥紙涓?.fullscreen-btn 鏂偣涓€鑷达級 */
@media (max-width: 768px) {
    .rotate-fullscreen-btn {
        display: flex;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .rotate-fullscreen-btn span {
        display: none;
    }
}

/* 鍔犺浇鐘舵€?*/
.loading {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
}

/* 閿欒娑堟伅 */
.error-message {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
}

/* 绌虹姸鎬?*/
.empty-state {
    color: var(--text-light);
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
    font-style: italic;
}

/* 娣卞眰绾х洰褰曟牱寮?*/
.chapter-item[data-level="0"]>.chapter-header {
    font-weight: 500;
    color: #000000;
}

.chapter-item[data-level="1"]>.chapter-header {
    font-size: 0.82rem;
    color: #000000;
}

.chapter-item[data-level="2"]>.chapter-header {
    font-size: 0.8rem;
    padding: 0.35rem 0.4rem;
    min-height: 26px;
    color: #000000;
}

.chapter-item[data-level="3"]>.chapter-header,
.chapter-item[data-level="4"]>.chapter-header,
.chapter-item[data-level="5"]>.chapter-header {
    font-size: 0.78rem;
    padding: 0.3rem 0.35rem;
    min-height: 24px;
    color: #000000;
}

/* 纭繚鎵€鏈夌珷鑺傚ご閮藉彲鐐瑰嚮 */
.chapter-header {
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

/* 鐐瑰嚮鍖哄煙鎵╁睍 */
.chapter-header::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -4px;
    right: -4px;
    bottom: -2px;
    z-index: -1;
}

/* 绌虹洰褰曟牱寮?- 浠嶅彲鐐瑰嚮灞曞紑 */
.chapter-header.empty {
    color: var(--text-light);
    cursor: pointer;
}

.chapter-header.empty:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* 绔犺妭鍥炬爣缂╁皬娣卞眰绾?*/
.chapter-item[data-level="3"] .chapter-icon,
.chapter-item[data-level="4"] .chapter-icon,
.chapter-item[data-level="5"] .chapter-icon {
    font-size: 0.7rem;
}

/* 鍝嶅簲寮忚浠堕〉闈?*/
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
        min-width: 280px;
    }

    /* 鍦ㄨ緝绐勭殑sidebar涓殣钘忔寜閽枃瀛楋紝鍙樉绀哄浘鏍?*/
    .view-mode-section {
        gap: 6px;
        padding: 8px 10px;
    }

    .view-mode-section .mode-label {
        font-size: 0.75rem;
    }

    .mode-btn {
        padding: 6px 8px;
    }

    .mode-btn span {
        display: none;
    }
}

/* ========================================
   鐩綍鍒囨崲鎸夐挳
   ======================================== */
.sidebar-toggle {
    --sidebar-toggle-bottom: 20px;
    display: none;
    position: fixed;
    bottom: calc(var(--sidebar-toggle-bottom) + env(safe-area-inset-bottom, 0px));
    left: 20px;
    z-index: 1080;
    padding: 0 20px;
    height: 40px;
    border-radius: 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    outline: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-toggle.is-visible {
    display: flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.sidebar-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-toggle:focus {
    outline: none;
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(59, 130, 246, 0.4);
}

.sidebar-toggle:focus:not(:focus-visible) {
    box-shadow: var(--shadow-lg);
}

.sidebar-toggle:focus-visible {
    outline: none;
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(59, 130, 246, 0.4);
}

/* 鐩綍鍐呯殑鍒囨崲鎸夐挳锛堟樉绀哄湪鐩綍澶撮儴锛?*/
.sidebar-header-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-bg);
    color: var(--primary-color);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-header-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.sidebar-header-toggle i {
    font-size: 0.9rem;
}

/* 骞虫澘绔紭鍖?- 鐩綍浠庡乏渚ф粦鍑?*/
@media (max-width: 1200px) {
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        left: 20px;
        right: auto;
    }

    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sidebar-header-toggle {
        display: flex;
    }

    .course-layout {
        position: relative;
        margin-top: var(--site-nav-height, 54px);
        /* 鍘绘帀妯箙鍚庯紝鍙渶鍑忓幓瀵艰埅鏍忛珮搴?*/
        height: calc(100vh - var(--site-nav-height, 54px));
        height: calc(100dvh - var(--site-nav-height, 54px));
        max-height: calc(100vh - var(--site-nav-height, 54px));
        max-height: calc(100dvh - var(--site-nav-height, 54px));
    }

    /* 鐩綍浠庡乏渚ф粦鍑?*/
    .sidebar {
        position: fixed;
        left: 0;
        right: auto;
        top: var(--site-nav-height, 54px);
        bottom: 0;
        /* 閲嶈锛氳鐩栧熀纭€鏍峰紡鐨?height:100%锛屽惁鍒?bottom 灞炴€т細琚拷鐣?*/
        height: auto;
        width: 300px;
        min-width: 300px;
        z-index: 900;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-xl);
    }

    .sidebar.visible {
        transform: translateX(0);
    }

    .sidebar.hidden {
        transform: translateX(-100%);
    }

    .sidebar-overlay {
        position: fixed;
        top: var(--site-nav-height, 54px);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 899;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .content-area {
        padding: 0;
        margin-left: 0;
        width: 100%;
    }

}

@media (max-width: 768px) {
    .course-layout {
        margin-top: var(--site-nav-height, 54px);
        /* 鍘绘帀妯箙鍚庯紝鍙渶鍑忓幓瀵艰埅鏍忛珮搴?*/
        height: calc(100vh - var(--site-nav-height, 54px));
        height: calc(100dvh - var(--site-nav-height, 54px));
        max-height: calc(100vh - var(--site-nav-height, 54px));
        max-height: calc(100dvh - var(--site-nav-height, 54px));
    }

    .sidebar {
        width: 85%;
        max-width: 300px;
        /* JS 浼氬姩鎬佽缃?top 鍜?height */
        top: var(--site-nav-height, 54px);
    }

    .sidebar-overlay {
        top: var(--site-nav-height, 54px);
    }

    .content-area {
        padding: 0;
        flex: 1;
        height: 100%;
    }

    .search-box {
        padding: 0.75rem;
    }

    /* 鏀惰棌鍖哄煙鎵嬫満浼樺寲 */
    .favorites-header {
        padding: 0.6rem 0.75rem;
    }

    .favorites-title {
        font-size: 0.85rem;
    }

    .favorites-list {
        max-height: 150px;
    }

    .favorite-item {
        padding: 0.5rem 0.75rem;
    }

    .favorite-item-title {
        font-size: 0.8rem;
    }

    .sidebar-toggle {
        --sidebar-toggle-bottom: 65px;
        left: max(15px, calc(env(safe-area-inset-left, 0px) + 15px));
    }

    /* GGB闈㈡澘鎵嬫満浼樺寲 */
    .ggb-panel {
        border-radius: 0;
    }

    .ggb-header {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .ggb-header-left h3 {
        font-size: 0.95rem;
    }

    .ggb-path {
        font-size: 0.7rem;
    }

    /* 鎵嬫満绔寜閽锛氬厑璁告崲琛屻€佺缉灏忛棿璺?*/
    .ggb-header-right {
        flex-wrap: wrap;
        gap: 0.3rem;
        width: 100%;
        justify-content: flex-start;
    }

    .ggb-header-right button:not(.rotate-fullscreen-btn) {
        height: 28px;
        padding: 0 0.5rem;
        font-size: 0.75rem;
    }

    .fullscreen-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .fullscreen-btn span {
        display: none;
    }

    .ggb-tips {
        padding: 0.4rem 0.75rem;
        font-size: 0.7rem;
    }

    .ggb-wrapper {
        padding: 0.25rem;
    }

    /* 娆㈣繋闈㈡澘鎵嬫満浼樺寲 */
    .welcome-panel {
        padding: 1.5rem;
    }

    .welcome-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

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

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

    .welcome-feature {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* 瓒呭皬灞忓箷浼樺寲 */
@media (max-width: 480px) {
    .course-layout {
        margin-top: var(--site-nav-height, 54px);
        /* 鍘绘帀妯箙鍚庯紝鍙渶鍑忓幓瀵艰埅鏍忛珮搴?*/
        height: calc(100vh - var(--site-nav-height, 54px));
        height: calc(100dvh - var(--site-nav-height, 54px));
        max-height: calc(100vh - var(--site-nav-height, 54px));
        max-height: calc(100dvh - var(--site-nav-height, 54px));
    }

    .sidebar {
        /* JS 浼氬姩鎬佽缃?top 鍜?height */
        top: var(--site-nav-height, 54px);
    }

    .sidebar-overlay {
        top: var(--site-nav-height, 54px);
    }

    .content-area {
        padding: 0;
    }
}

/* ========================================
   娴忚妯″紡鍒囨崲鍖哄煙 (缁熶竴鍒嗘鎺у埗鍣ㄦ牱寮?
   ======================================== */
.view-mode-section {
    display: flex;
    align-items: center;
    padding: 0;
    background: transparent;
    border-bottom: none;
    flex-shrink: 0;
    overflow: hidden;
}

.view-mode-section .mode-label {
    display: none;
}

.view-mode-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    margin: 12px 12px 8px 12px;
}

.mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0.6rem 0.5rem;
    border: none;
    border-bottom: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 8px;
    flex: 1;
    margin-bottom: 0;
}

.mode-btn:last-child {
    border-right: none;
}

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

.mode-btn:hover {
    color: #3b82f6;
    background: rgba(255, 255, 255, 0.5);
}

.mode-btn.active {
    color: var(--text-primary);
    background: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mode-btn.active i {
    color: var(--subject-color, #3b82f6);
}

/* ========================================
   缂╃暐鍥炬祻瑙堟ā寮?- 鍝嶅簲寮忓垪鏁帮細澶у睆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-transition: all 0.2s ease;
    transition: all 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-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: var(--text-light);
}

.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: var(--text-light);
    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 {
    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 {
    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 {
    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: #94a3b8;
}

/* 缂╃暐鍥惧垎椤垫帶鍒?- 鍥哄畾鍦ㄩ潰鏉垮簳閮紝涓嶉伄鎸＄缉鐣ュ浘 */
.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;
}

/* 椤电爜鎸夐挳 */
.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: var(--text-light);
    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);
}

.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 {
    outline: none;
    border-color: var(--subject-color, var(--primary-color));
    box-shadow: 0 0 0 2px rgba(var(--subject-color-rgb, 59, 130, 246), 0.1);
}

.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: all 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-header {
    position: relative;
    padding: 0 16px;
    height: 60px;
    background: linear-gradient(135deg, var(--subject-color, var(--primary-color)) 0%, var(--subject-dark, var(--primary-dark)) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.thumbnail-header h3 {
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.thumbnail-header h3 i {
    opacity: 0.8;
}

.thumbnail-count {
    background: rgba(255, 255, 255, 0.95);
    color: var(--subject-color, var(--primary-color, #3b82f6));
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.thumbnail-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    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: 56px;
        min-height: 56px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
    }

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

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

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

    .page-jump input {
        width: 45px;
        height: 30px;
    }

    .page-jump-btn {
        height: 30px;
        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: 52px;
        min-height: 52px;
        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: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .page-num {
        min-width: 26px;
        height: 28px;
        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: 40px;
        height: 28px;
        font-size: 0.8rem;
    }

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

/* ========================================
   瀛︾涓婚棰滆壊
   ======================================== */

/* ========================================
   缂╃暐鍥剧綉鏍煎搷搴斿紡鏍峰紡锛堝吋瀹硅€佹祻瑙堝櫒锛?   鍝嶅簲寮忓垪鏁帮紙涓庡乏渚ц彍鍗?200px鏂偣鍚屾锛?   >1500px: 5鍒? 1200-1500px: 4鍒? 993-1200px: 5鍒? 769-992px: 4鍒? 鈮?68px: 3鍒? 鈮?80px: 2鍒?   鍗＄墖姣斾緥 4:3锛堟í鍚戯級
   ======================================== */
/* 瓒呭ぇ灞忓箷 >1500px锛?鍒楋紙鑿滃崟鏄剧ず锛?*/
@media (min-width: 1501px) {
    .thumbnail-card {
        width: calc(20% - 8px);
        /* flexbox鍥為€€锛?鍒?*/
    }
}

@supports (display: grid) {
    @media (min-width: 1501px) {

        .thumbnail-grid,
        .thumbnail-panel .thumbnail-grid {
            grid-template-columns: repeat(5, 1fr);
            grid-auto-rows: auto;
        }

        .thumbnail-card {
            width: auto;
            height: auto;
        }
    }
}

/* 澶у睆骞?1200-1500px锛?鍒楋紙鑿滃崟鏄剧ず锛?*/
@media (min-width: 1201px) and (max-width: 1500px) {
    .thumbnail-card {
        width: calc(25% - 8px);
        /* flexbox鍥為€€锛?鍒?*/
    }
}

@supports (display: grid) {
    @media (min-width: 1201px) and (max-width: 1500px) {

        .thumbnail-grid,
        .thumbnail-panel .thumbnail-grid {
            grid-template-columns: repeat(4, 1fr);
            grid-auto-rows: auto;
        }

        .thumbnail-card {
            width: auto;
            height: auto;
        }
    }
}

/* 涓瓑灞忓箷 993-1200px锛?鍒楋紙鑿滃崟闅愯棌锛岀┖闂村ぇ锛?*/
@media (min-width: 993px) and (max-width: 1200px) {
    .thumbnail-card {
        width: calc(20% - 8px);
        /* flexbox鍥為€€锛?鍒?*/
    }
}

@supports (display: grid) {
    @media (min-width: 993px) and (max-width: 1200px) {

        .thumbnail-grid,
        .thumbnail-panel .thumbnail-grid {
            grid-template-columns: repeat(5, 1fr);
            grid-auto-rows: auto;
        }

        .thumbnail-card {
            width: auto;
            height: auto;
        }
    }
}

/* 骞虫澘璁惧 769-992px锛?鍒?*/
@media (min-width: 769px) and (max-width: 992px) {
    .thumbnail-card {
        width: calc(25% - 8px);
        /* flexbox鍥為€€锛?鍒?*/
    }
}

@supports (display: grid) {
    @media (min-width: 769px) and (max-width: 992px) {

        .thumbnail-grid,
        .thumbnail-panel .thumbnail-grid {
            grid-template-columns: repeat(4, 1fr);
            grid-auto-rows: auto;
        }

        .thumbnail-card {
            width: auto;
            height: auto;
        }
    }
}

/* 灏忓钩鏉?澶ф墜鏈猴細3鍒?*/
@media (max-width: 768px) {

    .thumbnail-grid,
    .thumbnail-panel .thumbnail-grid {
        gap: 6px;
        padding: 6px;
    }

    .thumbnail-card {
        width: calc(33.333% - 6px);
        /* flexbox鍥為€€锛?鍒?*/
    }
}

@supports (display: grid) {
    @media (max-width: 768px) {

        .thumbnail-grid,
        .thumbnail-panel .thumbnail-grid {
            grid-template-columns: repeat(3, 1fr);
            grid-auto-rows: auto;
        }

        .thumbnail-card {
            width: auto;
            height: auto;
        }
    }
}

/* 鎵嬫満璁惧锛?鍒楁洿绱у噾 */
@media (max-width: 480px) {

    .thumbnail-grid,
    .thumbnail-panel .thumbnail-grid {
        gap: 5px;
        padding: 5px;
    }

    .thumbnail-card {
        width: calc(50% - 5px);
        /* flexbox鍥為€€锛?鍒?*/
    }
}

@supports (display: grid) {
    @media (max-width: 480px) {

        .thumbnail-grid,
        .thumbnail-panel .thumbnail-grid {
            grid-template-columns: repeat(2, 1fr);
            grid-auto-rows: auto;
        }

        .thumbnail-card {
            width: auto;
            height: auto;
        }
    }
}

/* ========== 鍙鍖栬祫婧愭搷浣滄楠ゆ寚寮?========== */
.resources-guide-entry {
    min-height: 34px;
    margin: 0;
    padding: 7px 13px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.resources-guide-entry:hover {
    border-color: rgba(255, 255, 255, 0.72);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.24);
}

.resources-guide-target {
    outline: 2px solid #f59e0b;
    outline-offset: 3px;
}

.resource-guide-focus {
    position: fixed;
    z-index: 10020;
    pointer-events: none;
    border: 2px solid #fbbf24;
    border-radius: 8px;
    box-shadow:
        0 0 0 9999px rgba(15, 23, 42, 0.66),
        0 0 0 6px rgba(251, 191, 36, 0.18),
        0 16px 42px rgba(15, 23, 42, 0.26);
    transition: left 0.22s ease, top 0.22s ease, width 0.22s ease, height 0.22s ease;
}

.resource-guide-popover {
    position: fixed;
    z-index: 10030;
    padding: 16px;
    color: #172033;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.32);
    line-height: 1.6;
}

.resource-guide-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.resource-guide-close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #111827;
}

.resource-guide-kicker {
    padding-right: 28px;
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
}

.resource-guide-progress {
    height: 5px;
    margin: 8px 0 12px;
    overflow: hidden;
    background: #e5e7eb;
    border-radius: 999px;
}

.resource-guide-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #f59e0b);
    border-radius: inherit;
    transition: width 0.2s ease;
}

.resource-guide-popover h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 17px;
    line-height: 1.35;
    letter-spacing: 0;
}

.resource-guide-popover p {
    margin: 0;
    color: #475569;
    font-size: 14px;
}

.resource-guide-status {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 12px;
    padding: 9px 10px;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.08);
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
}

.resource-guide-status i {
    margin-top: 2px;
    color: #d97706;
}

.resource-guide-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

.resource-guide-btn {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.resource-guide-btn:hover:not(:disabled) {
    border-color: #2563eb;
    color: #1d4ed8;
}

.resource-guide-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.resource-guide-btn.primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.resource-guide-btn.primary:hover {
    border-color: #1d4ed8;
    background: #1d4ed8;
    color: #ffffff;
}

.resource-guide-btn.ghost {
    border-color: transparent;
    color: #64748b;
}

.resource-guide-btn.ghost:hover {
    background: #f8fafc;
    color: #334155;
}

.resource-guide-btn.locate {
    border-color: rgba(245, 158, 11, 0.5);
    color: #b45309;
}

.resource-guide-btn.locate:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    color: #92400e;
}

@media (max-width: 640px) {
    .thumbnail-header-actions {
        gap: 6px;
    }

    .resources-guide-entry {
        min-width: 34px;
        padding: 7px 9px;
    }

    .resources-guide-entry span {
        display: none;
    }

    .resource-guide-focus {
        border-radius: 6px;
    }

    .resource-guide-popover {
        padding: 14px;
    }

    .resource-guide-actions {
        justify-content: stretch;
    }

    .resource-guide-btn {
        flex: 1 1 auto;
    }
}
