/* === 短视频刷流页面 === */

.shorts-view {
    margin: 0;
    padding: 0;
    background: #000;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.shorts-view.visible {
    opacity: 1;
}

/* 加载旋转动画 */
.shorts-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: rgba(255, 56, 92, 0.9);
    border-radius: 50%;
    animation: shorts-spin 0.6s linear infinite;
}

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

.shorts-cover.loading::after {
    background: rgba(0, 0, 0, 0.4);
    animation: none;
}

.shorts-cover.loading::before {
    display: none;
}

.shorts-view .shorts-container {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0;
}

.shorts-container::-webkit-scrollbar {
    display: none;
}

.shorts-loading {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

/* === 单个短视频卡片 === */
.shorts-item {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

/* 视频播放区域 */
.shorts-player-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.shorts-player-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 封面占位（点击后替换为iframe） */
.shorts-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    background: #111;
    transition: opacity 0.2s ease;
}

.shorts-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.shorts-cover::after {
    content: '';
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 56, 92, 0.9);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.shorts-cover::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 18px 0 18px 28px;
    border-color: transparent transparent transparent #fff;
    top: 50%;
    left: 50%;
    transform: translate(-45%, -50%);
    z-index: 1;
    pointer-events: none;
}

/* === 视频信息覆盖层（已隐藏） === */
.shorts-info {
    display: none;
}

.shorts-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shorts-meta {
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.shorts-meta .shorts-up {
    color: var(--rausch, #FF385C);
    font-weight: 500;
}

/* === 右侧操作栏 === */
.shorts-actions {
    position: absolute;
    right: 10px;
    bottom: 75px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 20;
}

.shorts-action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
    pointer-events: auto;
}

.shorts-action-btn:active {
    transform: scale(0.88);
}

.shorts-action-btn.favorited {
    background: rgba(255, 56, 92, 0.8);
}

.shorts-action-btn .action-label {
    font-size: 11px;
    margin-top: 2px;
}

.shorts-action-btn svg {
    pointer-events: none;
}

/* === 顶部返回栏 === */
.shorts-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 50;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
    pointer-events: none;
}

.shorts-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
}

.shorts-topbar-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-left: 8px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* === 主题适配 === */

/* 液态玻璃 */


body[data-theme="liquid"] .shorts-view {
    background: #000;
}

body[data-theme="liquid"][data-color-scheme="dark"] .shorts-view {
    background: #000;
}

body[data-theme="liquid"] .shorts-topbar {
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, transparent 100%);
}

body[data-theme="liquid"] .shorts-back-btn,
body[data-theme="liquid"] .shorts-action-btn {
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15),
                0 2px 8px rgba(0, 0, 0, 0.2);
}

body[data-theme="liquid"][data-color-scheme="dark"] .shorts-back-btn,
body[data-theme="liquid"][data-color-scheme="dark"] .shorts-action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-theme="liquid"] .shorts-action-btn:active {
    background: rgba(255, 255, 255, 0.15);
}

body[data-theme="liquid"] .shorts-action-btn.favorited {
    background: rgba(255, 56, 92, 0.7);
    border-color: rgba(255, 56, 92, 0.3);
}

body[data-theme="liquid"] .shorts-info {
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
}

body[data-theme="liquid"] .shorts-loading-text {
    color: rgba(255, 255, 255, 0.4);
}

/* === 浅色模式通用（auto/light/classic 在浅色下生效，排除 liquid） === */

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-view {
    background: #fff;
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-item {
    background: #fff;
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-cover {
    background: #f5f5f5;
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-topbar {
    background: linear-gradient(to bottom, rgba(255,255,255,0.7) 0%, transparent 100%);
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-back-btn {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-topbar-title {
    color: #333;
    text-shadow: none;
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-title {
    color: #222;
    text-shadow: none;
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-meta {
    color: rgba(0, 0, 0, 0.5);
    text-shadow: none;
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-info {
    background: linear-gradient(to top, rgba(255,255,255,0.6) 0%, transparent 100%);
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-action-btn {
    background: rgba(0, 0, 0, 0.06);
    color: #333;
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-loading {
    color: rgba(0, 0, 0, 0.4);
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-loading-spinner {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: rgba(255, 56, 92, 0.9);
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-pause-overlay.paused {
    background: rgba(255, 255, 255, 0.4);
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-cover.paused {
    background: rgba(255, 255, 255, 0.5);
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-cover::after {
    background: rgba(255, 56, 92, 0.85);
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .shorts-cover::before {
    border-color: transparent transparent transparent #fff;
}

body[data-color-scheme="light"]:not([data-theme="liquid"]) .toast {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
}

/* === 经典回忆 专属覆盖 === */

body[data-theme="classic"][data-color-scheme="light"] .shorts-view {
    background: linear-gradient(180deg, #E8D5B0 0%, #DCC8A0 50%, #D0BC90 100%);
}

body[data-theme="classic"][data-color-scheme="light"] .shorts-item {
    background: linear-gradient(180deg, #E8D5B0 0%, #DCC8A0 50%, #D0BC90 100%);
}

body[data-theme="classic"][data-color-scheme="light"] .shorts-cover {
    background: #D0BC90;
}

body[data-theme="classic"][data-color-scheme="light"] .shorts-topbar {
    background: linear-gradient(to bottom, rgba(139, 105, 20, 0.15) 0%, transparent 100%);
}

body[data-theme="classic"][data-color-scheme="light"] .shorts-back-btn {
    background: rgba(139, 105, 20, 0.15);
    color: #5A3F0A;
}

body[data-theme="classic"][data-color-scheme="light"] .shorts-topbar-title {
    color: #5A3F0A;
}

body[data-theme="classic"][data-color-scheme="light"] .shorts-title {
    color: #3A2806;
}

body[data-theme="classic"][data-color-scheme="light"] .shorts-meta {
    color: rgba(90, 63, 10, 0.6);
}

body[data-theme="classic"][data-color-scheme="light"] .shorts-info {
    background: linear-gradient(to top, rgba(232, 213, 176, 0.6) 0%, transparent 100%);
}

body[data-theme="classic"][data-color-scheme="light"] .shorts-action-btn {
    background: rgba(139, 105, 20, 0.12);
    color: #5A3F0A;
}

/* 经典回忆 暗色模式 */

body[data-theme="classic"][data-color-scheme="dark"] .shorts-view {
    background: linear-gradient(180deg, #2A1F0E 0%, #221800 50%, #1A1208 100%);
}

body[data-theme="classic"][data-color-scheme="dark"] .shorts-item {
    background: linear-gradient(180deg, #2A1F0E 0%, #221800 50%, #1A1208 100%);
}

body[data-theme="classic"][data-color-scheme="dark"] .shorts-cover {
    background: #1A1208;
}

body[data-theme="classic"][data-color-scheme="dark"] .shorts-back-btn {
    background: rgba(200, 150, 50, 0.1);
    color: #C0A060;
}

body[data-theme="classic"][data-color-scheme="dark"] .shorts-topbar-title {
    color: #C0A060;
}

body[data-theme="classic"][data-color-scheme="dark"] .shorts-title {
    color: #E8D5B0;
}

body[data-theme="classic"][data-color-scheme="dark"] .shorts-meta {
    color: rgba(192, 160, 96, 0.6);
}

body[data-theme="classic"][data-color-scheme="dark"] .shorts-action-btn {
    background: rgba(200, 150, 50, 0.08);
    color: #C0A060;
}

/* 黑夜模式（auto/dark 在暗色下使用默认黑色，无需额外规则） */



/* === 加载遮罩 === */
.shorts-overlay-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: inherit;
}

/* Insert before Toast section */
/* === Toast === */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
}


/* === 暂停遮罩 === */
.shorts-pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: transparent;
    cursor: pointer;
}

/* 暂停时遮罩变暗 */
.shorts-pause-overlay.paused {
    background: rgba(0, 0, 0, 0.4);
}

/* 封面叠层：暂停时显示在iframe上方 */
.shorts-cover {
    transition: opacity 0.2s ease;
}

.shorts-cover.paused {
    opacity: 1;
    z-index: 9;
    background: rgba(0, 0, 0, 0.5);
}

/* 暂停时显示播放三角形，带淡入动画 */
.shorts-cover.paused::after {
    background: rgba(255, 56, 92, 0.85);
    animation: shorts-pulse 1.5s ease-in-out infinite;
}

.shorts-cover.paused::before {
    border-width: 18px 0 18px 28px;
    border-color: transparent transparent transparent #fff;
    width: 0;
    height: 0;
    transform: translate(-45%, -50%);
    animation: shorts-pulse 1.5s ease-in-out infinite;
}

@keyframes shorts-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* === 双击爱心动画 === */
.shorts-heart-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 30;
    pointer-events: none;
    animation: shorts-heart-pop 0.8s ease-out forwards;
}

@keyframes shorts-heart-pop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    15% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    30% { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}


/* === 大屏适配：左侧导航栏留空 + 限制视频宽度 === */
@media (min-width: 768px) {
    .shorts-view {
        left: 80px;
    }

    .shorts-item {
        align-items: center;
        justify-content: center;
    }

    .shorts-player-wrap {
        max-width: 420px;
        margin: 0 auto;
    }

    .shorts-cover {
        max-width: 420px;
        margin: 0 auto;
    }

    .shorts-cover img {
        max-width: 420px;
        margin: 0 auto;
    }

    .shorts-info {
        max-width: 420px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 100%;
    }

    .shorts-actions {
        right: calc(50% - 210px + 10px);
    }

    .shorts-topbar {
        left: 80px;
    }
}
