/**
 * ui.css - UI 组件样式
 * Toast / Dialog / ActionSheet / Modal / Loading / Navbar / Skeleton / PullRefresh / Infinite / ImageViewer
 */

/* ==================== Toast ==================== */

.ls-toast {
    position: fixed;
    right: 16px;
    padding: 12px 18px;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100vw - 32px);
    transform: translateX(120%);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ls-toast i { font-size: 16px; flex-shrink: 0; }

.ls-toast-success { background: var(--ls-success); }
.ls-toast-error { background: var(--ls-danger); }
.ls-toast-warning { background: var(--ls-warning); }
.ls-toast-info { background: #3b82f6; }

.ls-toast.ls-toast-show {
    transform: translateX(0);
}

/* ==================== Dialog ==================== */

.ls-dialog-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.ls-dialog-mask.ls-show { opacity: 1; pointer-events: auto; }

.ls-dialog {
    width: 300px;
    background: var(--ls-bg-card);
    border-radius: var(--ls-radius-lg);
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ls-dialog-mask.ls-show .ls-dialog { transform: scale(1); opacity: 1; }

.ls-dialog-header {
    padding: 24px 24px 8px;
    font-size: var(--ls-font-lg);
    font-weight: 600;
    text-align: center;
}

.ls-dialog-body {
    padding: 8px 24px 24px;
    font-size: var(--ls-font-base);
    color: var(--ls-text-secondary);
    text-align: center;
    line-height: 1.6;
}

.ls-dialog-footer {
    display: flex;
    gap: 8px;
    padding: 0 24px 24px;
}

.ls-dialog-btn {
    flex: 1;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--ls-font-base);
    font-weight: 500;
    border: none;
    border-radius: var(--ls-radius);
    cursor: pointer;
    transition: opacity 0.2s;
}

.ls-dialog-btn:active { opacity: 0.8; }
.ls-dialog-cancel { background: var(--ls-bg-secondary); color: var(--ls-text-secondary); }
.ls-dialog-confirm { background: var(--ls-primary); color: #fff; }
.ls-dialog-confirm.ls-danger { background: var(--ls-danger); }

.ls-dialog-prompt-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: var(--ls-font-base);
    border: 1px solid var(--ls-border);
    border-radius: var(--ls-radius);
    background: var(--ls-bg);
    color: var(--ls-text);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.ls-dialog-prompt-input:focus {
    border-color: var(--ls-primary);
}

/* ==================== ActionSheet ==================== */

.ls-action-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.25s;
}

.ls-action-mask.ls-show { opacity: 1; }

.ls-action-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--ls-bg-card);
    border-radius: 16px 16px 0 0;
    padding-bottom: var(--ls-safe-bottom);
    transform: translate3d(0, 100%, 0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ls-action-mask.ls-show .ls-action-sheet { transform: translate3d(0, 0, 0); }

.ls-action-title {
    padding: 16px 16px 8px;
    text-align: center;
    font-size: var(--ls-font-sm);
    color: var(--ls-text-tertiary);
}

.ls-action-list { }

.ls-action-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    font-size: var(--ls-font-md);
    transition: background 0.15s;
}

.ls-action-item:active { background: var(--ls-bg-secondary); }
.ls-action-item.ls-danger { color: var(--ls-danger); }
.ls-action-item.ls-warning { color: var(--ls-warning); }
.ls-action-item i { font-size: 20px; color: var(--ls-text-secondary); }
.ls-action-item.ls-danger i { color: var(--ls-danger); }
.ls-action-item.ls-warning i { color: var(--ls-warning); }

.ls-action-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    margin-top: 1px;
    border-top: 1px solid var(--ls-border-light);
    font-size: var(--ls-font-md);
    color: var(--ls-text-secondary);
}

.ls-action-cancel:active { background: var(--ls-bg-secondary); }

/* ActionSheet 格子布局 */
.ls-action-grid {
    display: grid;
    gap: 4px;
    padding: 8px 16px 12px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ls-action-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 4px;
    border-radius: var(--ls-radius);
    cursor: pointer;
    transition: background 0.15s;
}

.ls-action-grid-item:active { background: var(--ls-bg-secondary); }
.ls-action-grid-item i { font-size: 24px; color: var(--ls-text-secondary); }
.ls-action-grid-item span { font-size: var(--ls-font-sm); color: var(--ls-text); }
.ls-action-grid-item.ls-danger i,
.ls-action-grid-item.ls-danger span { color: var(--ls-danger); }
.ls-action-grid-item.ls-warning i,
.ls-action-grid-item.ls-warning span { color: var(--ls-warning); }

/* ==================== Modal ==================== */

.ls-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.25s;
}

.ls-modal-mask.ls-show { opacity: 1; }

.ls-modal {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    background: var(--ls-bg-card);
    border-radius: 16px 16px 0 0;
    padding-bottom: var(--ls-safe-bottom);
    transform: translate3d(0, 100%, 0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.ls-modal-mask.ls-show .ls-modal { transform: translate3d(0, 0, 0); }

.ls-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    flex-shrink: 0;
}

.ls-modal-title {
    font-size: var(--ls-font-lg);
    font-weight: 600;
}

.ls-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 20px;
    color: var(--ls-text-tertiary);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s;
}

.ls-modal-close:active { background: var(--ls-bg-secondary); }

.ls-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px 16px;
}

/* ==================== Loading ==================== */

.ls-loading-mask {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9500;
    opacity: 0;
    transition: opacity 0.2s;
}

.ls-loading-mask.ls-show { opacity: 1; }

.ls-loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    background: var(--ls-bg-card);
    border-radius: var(--ls-radius-lg);
    color: var(--ls-text);
    font-size: var(--ls-font-sm);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.ls-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--ls-border);
    border-top-color: var(--ls-primary);
    border-radius: 50%;
    animation: lsSpin 0.8s linear infinite;
}

.ls-loading-spinner.ls-small {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

/* 通用竖条加载动画（对应 PC 端 .ls-loading-spinner） */
.ls-loading-dots {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.ls-loading-dots i {
    display: block;
    width: 3px;
    height: 18px;
    border-radius: 2px;
    background: var(--ls-primary);
    animation: ls-bar-scale 1s ease-in-out infinite;
}

.ls-loading-dots i:nth-child(1) { animation-delay: -1.0s; }
.ls-loading-dots i:nth-child(2) { animation-delay: -0.9s; }
.ls-loading-dots i:nth-child(3) { animation-delay: -0.8s; }
.ls-loading-dots i:nth-child(4) { animation-delay: -0.7s; }
.ls-loading-dots i:nth-child(5) { animation-delay: -0.6s; }

@keyframes ls-bar-scale {
    0%, 40%, 100% { transform: scaleY(0.4); opacity: 0.4; }
    20%           { transform: scaleY(1); opacity: 1; }
}

/* 内联加载动画（LS.ui.loadingHtml） */
.ls-loading-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.ls-comment-loading .ls-loading-inline { padding: 0; }

.ls-loading-inline-text {
    margin-top: 12px;
    color: var(--ls-text-tertiary);
    font-size: var(--ls-font-sm);
}

/* 按钮内加载动画（LS.ui.buttonLoading） */
.ls-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.ls-btn-loading-bars {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 14px;
}

.ls-btn-loading-bars i {
    display: block;
    width: 3px;
    height: 12px;
    border-radius: 999px;
    background: currentColor;
    animation: ls-btn-bar .8s ease-in-out infinite;
}

.ls-btn-loading-bars i:nth-child(1) { animation-delay: -.24s; }
.ls-btn-loading-bars i:nth-child(2) { animation-delay: -.12s; }
.ls-btn-loading-bars i:nth-child(3) { animation-delay: 0s; }

@keyframes ls-btn-bar {
    0%, 100% { transform: scaleY(.45); opacity: .45; }
    50%      { transform: scaleY(1); opacity: 1; }
}

.ls-btn-loading-text {
    display: inline-block;
    line-height: 1;
}

/* ==================== Navbar ==================== */

#ls-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    pointer-events: none;
}

.ls-navbar {
    display: flex;
    align-items: center;
    height: calc(var(--ls-navbar-height) + var(--ls-safe-top));
    padding-top: var(--ls-safe-top);
    padding-left: 0;
    padding-right: 0;
    background: var(--ls-bg-card);
    border-bottom: 0.5px solid var(--ls-border-light);
    pointer-events: auto;
}

.ls-navbar.ls-transparent {
    background: transparent;
    border-bottom: none;
}

.ls-navbar-left {
    display: flex;
    align-items: center;
    min-width: 44px;
}

.ls-navbar-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: var(--ls-navbar-height);
    font-size: 24px;
    color: var(--ls-text);
    cursor: pointer;
}

.ls-navbar-left-text {
    font-size: var(--ls-font-base);
    color: var(--ls-text);
    cursor: pointer;
}

.ls-navbar-center {
    flex: 1;
    text-align: center;
    font-size: var(--ls-font-lg);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-navbar-right {
    display: flex;
    align-items: center;
    min-width: 44px;
    justify-content: flex-end;
}

.ls-navbar-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: var(--ls-navbar-height);
    font-size: 22px;
    color: var(--ls-text);
    cursor: pointer;
}

.ls-navbar-right-text {
    font-size: var(--ls-font-base);
    color: var(--ls-primary);
    cursor: pointer;
    font-weight: 500;
}

/* ==================== 内页导航栏（页面内联） ==================== */
/*
 * 内页的导航栏/工具栏完全由页面模板自己提供。
 * .ls-page-navbar  - 页面内联导航栏容器（fixed 在页面内顶部）
 * .ls-page-body    - 页面内容容器
 * .ls-page-has-navbar - 加在 .ls-page-body 上，自动留出导航栏高度
 * .ls-page-toolbar - 页面底部工具栏（可选）
 * .ls-go-back      - 加在任意元素上，点击触发 LS.router.back()
 */

.ls-page-navbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    height: var(--ls-navbar-height);
    padding: 0;
    padding-top: var(--ls-safe-top);
    background: var(--ls-bg-card);
    box-sizing: content-box;
}

/* 左侧区域（返回按钮） */
.ls-page-navbar .ls-go-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: var(--ls-navbar-height);
    font-size: 24px;
    color: var(--ls-text);
    cursor: pointer;
    flex-shrink: 0;
}

.ls-page-navbar-title {
    position: absolute;
    left: 96px;
    right: 96px;
    top: var(--ls-safe-top);
    height: var(--ls-navbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--ls-font-lg);
    font-weight: 600;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

/* 右侧区域 */
.ls-page-navbar-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.ls-page-navbar-right i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: var(--ls-navbar-height);
    font-size: 22px;
    color: var(--ls-text);
    cursor: pointer;
}

/* 透明导航栏（覆盖在页面内容上方，用于个人主页等） */
.ls-page-navbar.ls-transparent {
    position: absolute;
    background: transparent;
}

/* 系统级透明导航栏（JS 连续渐变驱动）
 * absolute 定位，浮在 scroller 上方 */
.ls-page-navbar.ls-transparent-scroll {
    background: transparent;
    border-bottom: none;
    z-index: 100;
}

/* 页面内容区域 - 有导航栏时留出顶部空间 */
.ls-page-has-navbar {
    padding-top: calc(var(--ls-navbar-height) + var(--ls-safe-top));
}

/* 页面底部工具栏 */
.ls-page-toolbar {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    padding-bottom: calc(8px + var(--ls-safe-bottom));
    background: var(--ls-bg-card);
    border-top: 0.5px solid var(--ls-border-light);
}

/* 旧兼容 - 保留全局 navbar padding */
.ls-page.ls-has-navbar {
    padding-top: calc(var(--ls-navbar-height) + var(--ls-safe-top));
    padding-bottom: var(--ls-safe-bottom);
}

/* -- 新版 Navbar 类型样式 -- */

.ls-navbar-left-btn,
.ls-navbar-right-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: var(--ls-navbar-height);
    font-size: 22px;
    color: var(--ls-text);
    cursor: pointer;
}

.ls-navbar-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 44px;
    height: var(--ls-navbar-height);
    cursor: pointer;
}
.ls-navbar-icon-wrap .ls-navbar-left-btn,
.ls-navbar-icon-wrap .ls-navbar-right-btn {
    width: auto;
    height: auto;
}
.ls-navbar-icon-wrap .ls-unread-dot {
    top: 6px;
    right: 0;
}

.ls-navbar-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: var(--ls-navbar-height);
    cursor: pointer;
}

.ls-navbar-avatar i {
    font-size: 24px;
}

.ls-navbar-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* 搜索框（假输入框，点击跳转搜索页） */
.ls-navbar-center .ls-navbar-search {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    background: var(--ls-bg-secondary);
    border-radius: 16px;
    cursor: pointer;
    width: 100%;
}

.ls-navbar-center .ls-navbar-search i {
    font-size: 16px;
    color: var(--ls-text-tertiary);
    flex-shrink: 0;
}

.ls-navbar-center .ls-navbar-search span {
    font-size: var(--ls-font-sm);
    color: var(--ls-text-tertiary);
    flex: 1;
}

/* Logo 型导航栏 */
.ls-navbar-logo .ls-navbar-center {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    text-align: left;
}

.ls-navbar-logo-icon {
    font-size: 24px;
    color: var(--ls-primary);
}

.ls-navbar-logo-text {
    font-size: var(--ls-font-lg);
    font-weight: 700;
    color: var(--ls-text);
}

/* 分段标签型导航栏（兼容旧版 segment 类型） */
.ls-navbar-segment .ls-navbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 导航菜单标签（page_menu / content_menu / segment） */
.ls-navbar-center .ls-navbar-segments {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* 左侧无内容时菜单靠左 */
.ls-navbar.ls-no-left .ls-navbar-center .ls-navbar-segments {
    justify-content: flex-start;
}

.ls-navbar-seg {
    position: relative;
    padding: 4px 0;
    font-size: var(--ls-font-base);
    font-weight: 400;
    color: var(--ls-text-tertiary);
    cursor: pointer;
    white-space: nowrap;
}

.ls-navbar-seg.ls-active {
    color: var(--ls-text);
    font-size: var(--ls-font-lg);
    font-weight: 700;
}

.ls-navbar-seg.ls-active::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--ls-primary);
}

/* 城市选择器 */
.ls-navbar-city {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    height: var(--ls-navbar-height);
    font-size: var(--ls-font-sm);
    color: var(--ls-text);
    cursor: pointer;
}

.ls-navbar-city i {
    font-size: 16px;
    color: var(--ls-primary);
}

.ls-navbar-city-arrow {
    font-size: 12px;
    color: var(--ls-text-tertiary);
    margin-left: -2px;
}

/* 大字文本 */
.ls-navbar-big-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--ls-text);
    padding: 0 14px;
    white-space: nowrap;
}

/* 多图标间距（44px 按钮自带足够触控区域，无需额外间距） */

/* 中间图片 */
.ls-navbar-center-img {
    height: 28px;
    max-width: 120px;
    object-fit: contain;
}

/* 中间标题文本（新版 text 类型） */
.ls-navbar-title-text {
    font-size: var(--ls-font-lg);
    font-weight: 600;
}

/* 左右为 none 时缩小留白，保持对称 */
.ls-navbar.ls-no-left .ls-navbar-left { min-width: 14px; }
.ls-navbar.ls-no-right .ls-navbar-right { min-width: 14px; }

/* 沉浸式导航栏：透明背景，内容顶部不留空 */
.ls-navbar.ls-immersive {
    background: transparent;
    border-bottom: none;
}

/* 子页面容器 */
.ls-sub-page {
    min-height: 100%;
    animation: lsContentFadeIn 0.3s ease forwards;
}


/* 滚动隐藏 */
#ls-navbar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#ls-navbar.ls-navbar-scroll-hidden,
#ls-navbar.ls-navbar-hidden {
    transform: translateY(-100%);
}


/* ==================== PullRefresh ==================== */

.ls-pull-indicator {
    position: fixed;
    top: calc(var(--ls-navbar-height) + var(--ls-safe-top));
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 0;
    overflow: hidden;
    opacity: 0;
    z-index: 100;
    pointer-events: none;
}

.ls-pull-spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s;
}

.ls-pull-spinner svg {
    width: 18px;
    height: 18px;
    color: var(--ls-text-secondary);
    transition: transform 0.25s;
}

.ls-pull-indicator.ls-pull-ready .ls-pull-spinner svg {
    transform: rotate(180deg);
    color: var(--ls-primary);
}

.ls-pull-indicator.ls-refreshing .ls-pull-spinner {
    animation: lsSpin 0.8s linear infinite;
}

.ls-pull-indicator.ls-refreshing .ls-pull-spinner svg {
    color: var(--ls-primary);
}

/* ==================== ScrollLoad ==================== */
.ls-scroll-load-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    font-size: var(--ls-font-sm);
    color: var(--ls-text-tertiary);
}

.ls-scroll-load-indicator .ls-loading-spinner {
    border-color: var(--ls-border);
    border-top-color: var(--ls-primary);
}

.ls-scroll-load-end {
    color: var(--ls-text-placeholder);
    font-size: var(--ls-font-sm);
}

.ls-scroll-load-retry {
    color: var(--ls-primary);
    font-size: var(--ls-font-sm);
    cursor: pointer;
}

/* ==================== ImageViewer ==================== */

/* ImageViewer */
.ls-image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
    user-select: none;
    -webkit-user-select: none;
}

.ls-image-viewer.ls-show { opacity: 1; }

/* Toolbar */
.ls-iv-toolbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: calc(44px + var(--ls-safe-top));
    padding-top: var(--ls-safe-top);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px;
    padding-right: 4px;
    z-index: 3;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent);
}

.ls-iv-counter {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
}

.ls-iv-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 22px;
    cursor: pointer;
}

/* Stage */
.ls-iv-stage {
    position: absolute;
    top: calc(44px + var(--ls-safe-top));
    left: 0;
    right: 0;
    bottom: 80px;
    overflow: hidden;
    z-index: 1;
}

/* Track（三图缓冲池容器） */
.ls-iv-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* 单张 Slide */
.ls-iv-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

.ls-iv-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    will-change: transform;
    transition: opacity 0.15s;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
}

.ls-iv-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
}

.ls-iv-spinner i {
    display: block;
    animation: lsSpin 0.8s linear infinite;
}

/* Thumbnails */
.ls-iv-thumbs {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px calc(var(--ls-safe-bottom, 0px));
    z-index: 3;
    overflow-x: auto;
    overflow-y: hidden;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    scrollbar-width: none;
}

.ls-iv-thumbs::-webkit-scrollbar { display: none; }

.ls-iv-thumb {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.45;
    border: 2px solid transparent;
    transition: opacity 0.15s, border-color 0.15s;
}

.ls-iv-thumb.ls-active {
    opacity: 1;
    border-color: #fff;
}

.ls-iv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* 没有缩略图时 stage 撑满（由 JS 添加 class） */
.ls-image-viewer.ls-iv-single .ls-iv-stage {
    bottom: 0;
}

/* ==================== Popup 弹窗 ==================== */

.ls-popup-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.25s;
}

.ls-popup-mask.ls-show { opacity: 1; }

.ls-popup-panel {
    position: absolute;
    background: var(--ls-bg-card);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -- 方向：bottom（默认） -- */
.ls-popup-dir-bottom .ls-popup-panel {
    bottom: 0; left: 0; right: 0;
    max-height: calc(100% - var(--ls-safe-top, 0px) - 12px);
    border-radius: 16px 16px 0 0;
    padding-bottom: var(--ls-safe-bottom);
    transform: translate3d(0, 100%, 0);
}
.ls-popup-dir-bottom.ls-show .ls-popup-panel { transform: translate3d(0, 0, 0); }

/* -- 方向：top -- */
.ls-popup-dir-top .ls-popup-panel {
    top: 0; left: 0; right: 0;
    border-radius: 0 0 16px 16px;
    padding-top: var(--ls-safe-top);
    transform: translate3d(0, -100%, 0);
}
.ls-popup-dir-top.ls-show .ls-popup-panel { transform: translate3d(0, 0, 0); }

/* -- 方向：left -- */
.ls-popup-dir-left .ls-popup-panel {
    top: 0; left: 0; bottom: 0;
    width: 80%;
    max-width: 320px;
    height: 100% !important;
    border-radius: 0 16px 16px 0;
    transform: translate3d(-100%, 0, 0);
}
.ls-popup-dir-left.ls-show .ls-popup-panel { transform: translate3d(0, 0, 0); }

/* -- 方向：right -- */
.ls-popup-dir-right .ls-popup-panel {
    top: 0; right: 0; bottom: 0;
    width: 80%;
    max-width: 320px;
    height: 100% !important;
    border-radius: 16px 0 0 16px;
    transform: translate3d(100%, 0, 0);
}
.ls-popup-dir-right.ls-show .ls-popup-panel { transform: translate3d(0, 0, 0); }

/* -- 方向：center -- */
.ls-popup-dir-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.ls-popup-dir-center .ls-popup-panel {
    position: relative;
    width: 85%;
    max-width: 360px;
    max-height: 80vh;
    border-radius: 16px;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.ls-popup-dir-center.ls-show .ls-popup-panel { transform: scale(1); opacity: 1; }

/* -- 全屏 -- */
.ls-popup-dir-bottom .ls-popup-panel[style*="height:100%"] {
    border-radius: 0;
    padding-top: var(--ls-safe-top);
}

/* -- 头部 -- */
.ls-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    flex-shrink: 0;
}

.ls-popup-title {
    font-size: var(--ls-font-lg);
    font-weight: 600;
}

.ls-popup-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 20px;
    color: var(--ls-text-tertiary);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s;
}

.ls-popup-close:active { background: var(--ls-bg-secondary); }

/* -- 内容 -- */
.ls-popup-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px 16px;
}

/* -- 底部栏 -- */
.ls-popup-footer {
    flex-shrink: 0;
    border-top: 0.5px solid var(--ls-border-light);
    padding: 10px 16px;
    padding-bottom: calc(10px + var(--ls-safe-bottom));
}

/* ==================== 404 / Error 页面 ==================== */

.ls-error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
    text-align: center;
}

.ls-error-icon {
    margin-bottom: 20px;
}

.ls-error-icon i {
    font-size: 56px;
    color: var(--ls-text-placeholder);
}

.ls-error-text {
    font-size: var(--ls-font-md);
    color: var(--ls-text-tertiary);
}

.ls-error-desc {
    margin-top: 8px;
    font-size: var(--ls-font-sm);
    color: var(--ls-text-placeholder);
}

/* 云文件选择器样式已内联至 cloud-file.js */

/* ==================== 发布类型弹窗 ==================== */
.ls-publish-popup .ls-popup-panel { max-width: 300px; }
.ls-publish-popup.ls-popup-dir-bottom .ls-popup-panel { max-width: none; }
.ls-publish-popup .ls-popup-body { padding: 0; }

.ls-pub-panel {
    padding: 0 0 24px;
}

/* 用户区 */
.ls-pub-user {
    display: flex;
    align-items: center;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--ls-border-light);
    margin-bottom: 4px;
}

.ls-pub-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ls-pub-user-info {
    margin-left: 12px;
    overflow: hidden;
}

.ls-pub-nickname {
    font-size: 15px;
    font-weight: 600;
    color: var(--ls-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ls-pub-user-desc {
    font-size: 12px;
    color: var(--ls-text-tertiary);
    margin-top: 2px;
}

/* 分组 */
.ls-pub-group {
    padding: 0 12px;
}

.ls-pub-group-label {
    padding: 14px 8px 6px;
    font-size: 12px;
    color: var(--ls-text-placeholder);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* 列表项 */
.ls-pub-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ls-pub-item {
    display: flex;
    align-items: center;
    padding: 10px 8px;
    border-radius: var(--ls-radius-lg);
    cursor: pointer;
    transition: background-color 0.15s;
}

.ls-pub-item:active {
    background-color: var(--ls-bg-secondary);
}

.ls-pub-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.ls-pub-icon i {
    color: inherit;
}

.ls-pub-info {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.ls-pub-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ls-text-primary);
    line-height: 1.3;
}

.ls-pub-desc {
    font-size: 11px;
    color: var(--ls-text-tertiary);
    margin-top: 1px;
    line-height: 1.3;
}

.ls-pub-arrow {
    font-size: 18px;
    color: var(--ls-text-placeholder);
    flex-shrink: 0;
    margin-left: 4px;
}

/* 格子布局 */
.ls-pub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    flex-direction: unset;
}

.ls-pub-item-grid {
    flex-direction: column;
    padding: 14px 8px 10px;
    align-items: center;
}

.ls-pub-item-grid .ls-pub-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    font-size: 22px;
}

.ls-pub-item-grid .ls-pub-name {
    margin-top: 8px;
    font-size: 12px;
    text-align: center;
    font-weight: 400;
    color: var(--ls-text-secondary);
}

