/*
Theme Name: TinnyTiger
Theme URI: https://tinnytiger.com.au
Author: TinnyTiger Team
Author URI: https://tinnytiger.com.au
Description: 猫咪视频社区主题，支持 AI 生成视频标记
Version: 1.4.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tinnytiger
Tags: video, video-sharing, short-video, social-network, community, dark-mode, responsive, content-creator, video-platform, user-generated-content, ai-video, membership
Requires at least: 6.0
Requires PHP: 7.4
*/

/* ============================================
   TINNYTIGER - 猫咪视频社区主题
   短视频分享平台设计
   ============================================ */

:root {
    --bg-primary: #000000;
    --bg-secondary: #121212;
    --bg-card: #000000;
    --text-primary: #ffffff;
    --text-secondary: #a8a8a8;
    --border-color: #262626;
    --accent: #0095f6;
    --accent-hover: #1877f2;
    --like-red: #ed4956;
    --ai-badge-start: #667eea;
    --ai-badge-end: #764ba2;
    --story-ring-start: #f093fb;
    --story-ring-mid: #f5576c;
    --story-ring-end: #ffd93d;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000000 !important;
    background-color: var(--bg-primary) !important;
    color: #ffffff;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 80px;
    margin: 0;
}

/* 确保整个页面背景为黑色 */
html, 
#page,
.site,
.tt-main-wrapper {
    background-color: #000000 !important;
    background-color: var(--bg-primary) !important;
    min-height: 100vh;
}

/* 防止Elementor或其他插件覆盖背景 */
.elementor-section,
.elementor-section-wrap,
.elementor-container {
    background-color: transparent !important;
}

/* 强制黑色背景 - 最高优先级 */
html, body, #page, .site, #page.site, .tt-main-wrapper, .tt-home-page {
    background-color: #000000 !important;
    background: #000000 !important;
}

/* 隐藏任何可能的白边 */
body {
    background: #000000 !important;
    margin: 0;
    padding: 0;
}

/* ============================================
   顶部栏
   ============================================ */
.tt-top-bar {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.tt-logo {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--story-ring-start) 0%, var(--story-ring-mid) 50%, var(--story-ring-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.tt-top-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.tt-icon-btn {
    width: 28px;
    height: 28px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s;
    background: none;
    border: none;
    padding: 0;
}

.tt-icon-btn:hover {
    opacity: 1;
}

.tt-icon-btn svg {
    width: 100%;
    height: 100%;
    stroke: var(--text-primary);
    fill: none;
    stroke-width: 2;
}

/* 用户菜单 */
.tt-user-menu {
    position: relative;
}

.tt-user-avatar-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 0;
    border: 2px solid transparent;
    background: linear-gradient(45deg, var(--story-ring-start), var(--story-ring-mid)) border-box;
    cursor: pointer;
    transition: transform 0.2s;
}

.tt-user-avatar-btn:hover {
    transform: scale(1.05);
}

.tt-user-avatar-small {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-primary);
}

.tt-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 240px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
}

.tt-user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tt-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.tt-dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.tt-dropdown-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tt-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-dropdown-email {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.tt-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

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

.tt-dropdown-item svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    flex-shrink: 0;
}

.tt-dropdown-logout {
    color: var(--like-red);
}

.tt-dropdown-logout svg {
    stroke: var(--like-red);
}

/* ============================================
   主内容区
   ============================================ */
.tt-main-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

/* 大屏设备：限制最大宽度并居中 */
@media (max-width: 768px) {
    .tt-main-wrapper {
        max-width: 100%;
    }
}

/* 平板和手机保持窄屏 */
.tt-feed-container {
    max-width: 470px;
    margin: 0 auto;
}

/* 电脑端视频网格展开 */
@media (min-width: 769px) {
    .tt-feed-container {
        max-width: 100%;
        padding: 0 40px;
    }
    
    .tt-video-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .tt-video-card {
        max-width: 100%;
    }
}

.tt-feed-container {
    padding-bottom: 20px;
}

/* Tab 导航 */
.tt-feed-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    position: sticky;
    top: 60px;
    z-index: 100;
}

.tt-feed-tabs .tt-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tt-feed-tabs .tt-tab:hover {
    color: var(--text-primary);
}

.tt-feed-tabs .tt-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

/* Tab 内容 */
.tt-tab-content {
    display: none;
    padding: 16px;
}

.tt-tab-content.active {
    display: block;
}

/* 视频 Feed 容器 */
.tt-video-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 视频卡片 */
.tt-video-card {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

/* 卡片头部 */
.tt-card-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.tt-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    background: linear-gradient(45deg, var(--story-ring-start), var(--story-ring-mid)) border-box;
}

.tt-user-info {
    flex: 1;
}

.tt-username {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
}

.tt-username:hover {
    text-decoration: underline;
}

.tt-location {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 视频区域 */
.tt-video-wrapper {
    position: relative;
    width: 100%;
    background: var(--bg-secondary);
}

.tt-video-wrapper video,
.tt-video-wrapper .wp-video {
    width: 100% !important;
    display: block;
    aspect-ratio: 9/16;
    object-fit: cover;
}

/* AI生成标签 */
.tt-ai-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--ai-badge-start) 0%, var(--ai-badge-end) 100%);
    color: white;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    z-index: 10;
}

/* 互动区 */
.tt-action-bar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
}

.tt-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.tt-action-btn svg {
    width: 26px;
    height: 26px;
    stroke: var(--text-primary);
    fill: none;
    stroke-width: 2;
}

.tt-action-btn.liked svg {
    fill: var(--like-red);
    stroke: var(--like-red);
}

/* 内容区 */
.tt-card-content {
    padding: 0 16px 16px;
}

.tt-likes-count {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.tt-caption {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.tt-timestamp {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* ============================================
   底部固定导航
   ============================================ */
.tt-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: flex !important;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 20px;
    z-index: 9999 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.tt-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    text-decoration: none;
    color: var(--text-primary);
}

.tt-nav-item svg {
    width: 26px;
    height: 26px;
    stroke: var(--text-primary);
    fill: none;
    stroke-width: 1.8;
}

.tt-nav-item.active svg {
    fill: var(--text-primary);
}

.tt-nav-item.tt-upload {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #ffd93d 100%);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-top: -20px;
    box-shadow: 
        0 4px 15px rgba(240, 147, 251, 0.4),
        0 0 30px rgba(245, 87, 108, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    border: 3px solid var(--bg-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tt-nav-item.tt-upload::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s;
}

.tt-nav-item.tt-upload:hover::before {
    left: 100%;
}

.tt-nav-item.tt-upload:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 
        0 6px 25px rgba(240, 147, 251, 0.5),
        0 0 40px rgba(245, 87, 108, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.tt-nav-item.tt-upload:active {
    transform: scale(0.95);
}

.tt-cat-logo {
    width: 36px;
    height: 36px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.tt-nav-item.tt-upload:hover .tt-cat-logo {
    transform: rotate(5deg) scale(1.05);
}

.tt-cat-logo svg {
    width: 100%;
    height: 100%;
}

.tt-nav-label {
    font-size: 10px;
    color: var(--text-secondary);
}

/* ============================================
   上传模态框
   ============================================ */
.tt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.tt-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tt-upload-modal {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    z-index: 2000;
    transition: bottom 0.3s ease;
    max-width: 470px;
    margin: 0 auto;
}

.tt-upload-modal.active {
    bottom: 0;
}

.tt-upload-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tt-upload-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.2s;
}

.tt-upload-option:hover {
    background: var(--border-color);
}

.tt-upload-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.tt-upload-option.ai .tt-upload-option-icon {
    background: linear-gradient(135deg, var(--ai-badge-start) 0%, var(--ai-badge-end) 100%);
}

.tt-upload-option.video .tt-upload-option-icon {
    background: linear-gradient(135deg, var(--story-ring-start) 0%, var(--story-ring-mid) 100%);
}

.tt-upload-option-title {
    font-size: 16px;
    font-weight: 600;
}

.tt-upload-option-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.tt-modal-close {
    display: block;
    width: 100%;
    padding: 16px;
    margin-top: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    text-align: center;
}

body.modal-open {
    overflow: hidden;
}

/* ============================================
   桌面端适配
   ============================================ */
@media (min-width: 1024px) {
    body {
        background: var(--bg-secondary);
    }
    
    #page.site {
        width: 100%;
        max-width: 630px;
        margin: 0 auto;
        position: relative;
    }

    .tt-main-wrapper {
        width: 100%;
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
        min-height: 100vh;
        background: var(--bg-primary);
    }

    .tt-top-bar {
        position: sticky;
        top: 0;
        width: 100%;
    }

    .tt-bottom-nav {
        position: fixed;
        bottom: 0;
        width: 100%;
        max-width: 630px;
        left: 50%;
        transform: translateX(-50%);
    }

    /* 视频边界与导航对齐 */
    .tt-video-wrapper {
        max-width: 630px;
        margin: 0 auto;
    }

    .tt-video-wrapper video {
        max-height: 80vh;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    body {
        background: var(--bg-secondary);
    }
    
    #page.site {
        width: 100%;
        max-width: 470px;
        margin: 0 auto;
    }

    .tt-main-wrapper {
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
        min-height: 100vh;
        background: var(--bg-primary);
    }

    .tt-bottom-nav {
        max-width: 470px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* 视频边界与导航对齐 */
    .tt-video-wrapper {
        max-width: 470px;
        margin: 0 auto;
    }
}

@media (min-width: 1440px) {
    #page.site {
        max-width: 720px;
    }

    .tt-bottom-nav {
        max-width: 720px;
    }
    
    /* 视频边界与导航对齐 */
    .tt-video-wrapper {
        max-width: 720px;
    }
}

/* ============================================
   WordPress Admin Bar 兼容性修复
   ============================================ */

/* 确保 admin bar 链接可点击 */
#wpadminbar {
    z-index: 99999 !important;
}

#wpadminbar * {
    pointer-events: auto !important;
}

#wpadminbar .ab-item {
    pointer-events: auto !important;
    cursor: pointer !important;
}

#wpadminbar .ab-submenu .ab-item {
    pointer-events: auto !important;
}

/* 确保 admin bar 下拉菜单显示 */
#wpadminbar .menupop .ab-sub-wrapper {
    z-index: 99999 !important;
}

/* 防止主题元素遮挡 admin bar */
#wpadminbar,
#wpadminbar .quicklinks,
#wpadminbar .ab-top-menu,
#wpadminbar .ab-submenu {
    position: relative;
    z-index: 99999;
}

/* ============================================
   语言切换器样式
   ============================================ */

.tt-language-switcher {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px !important;
}

.tt-language-switcher > svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.tt-language-options {
    display: flex;
    gap: 12px;
    padding-left: 26px;
    width: 100%;
}

.tt-lang-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #2a2a2a !important;
    border-radius: 50%;
    font-size: 20px;
    text-decoration: none;
    transition: all 0.2s;
    border: 2px solid #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.tt-lang-option:hover {
    background: #3a3a3a !important;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(0, 149, 246, 0.3);
}

.tt-lang-option.active {
    background: #2a2a2a !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 0 3px #0095f6, 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ============================================
   UX 优化 - 骨架屏、空状态、加载动画
   ============================================ */

/* 骨架屏网格 */
.tt-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
    animation: skeleton-fade-in 0.3s ease;
}

@media (min-width: 768px) {
    .tt-skeleton-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@keyframes skeleton-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 骨架屏卡片 */
.tt-skeleton-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #333;
}

.tt-skeleton-thumbnail {
    aspect-ratio: 9/16;
    background: linear-gradient(
        90deg,
        #2a2a2a 25%,
        #3a3a3a 50%,
        #2a2a2a 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.tt-skeleton-info {
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tt-skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(
        90deg,
        #2a2a2a 25%,
        #3a3a3a 50%,
        #2a2a2a 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    flex-shrink: 0;
}

.tt-skeleton-text {
    flex: 1;
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        #2a2a2a 25%,
        #3a3a3a 50%,
        #2a2a2a 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 视频网格 */
.tt-video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
    animation: grid-fade-in 0.4s ease;
}

@keyframes grid-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) {
    .tt-video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 空状态 */
.tt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    animation: empty-fade-in 0.5s ease;
}

@keyframes empty-fade-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.tt-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.tt-empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.tt-empty-state p {
    font-size: 15px;
    color: #a8a8a8;
    margin-bottom: 24px;
    max-width: 280px;
}

.tt-btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0095f6;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tt-btn-upload:hover {
    background: #1877f2;
    transform: translateY(-2px);
}

.tt-btn-upload svg {
    stroke: currentColor;
}

/* ============================================
   UX 优化 - 视频播放器增强
   ============================================ */

/* 视频播放按钮 */
.tt-video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

/* 爱心动画（双击点赞） */
.tt-heart-animation {
    position: absolute;
    font-size: 80px;
    pointer-events: none;
    z-index: 100;
    animation: heart-burst 1s ease forwards;
    transform: translate(-50%, -50%);
}

@keyframes heart-burst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) translateY(-50px);
        opacity: 0;
    }
}

/* 视频加载状态 */
.tt-video-wrapper video {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tt-video-wrapper video.tt-video-loaded {
    opacity: 1;
}

/* 图片懒加载动画 */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].tt-img-loaded {
    opacity: 1;
}

/* 卡片加载状态 */
.tt-video-card {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.tt-video-card.tt-card-loaded {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   UX 增强 - 额外功能样式
   ============================================ */

/* 相对时间样式 */
.tt-time-ago {
    font-size: 11px;
    color: var(--tt-text-secondary);
    margin-left: 8px;
}

/* 触摸滑动切换视频 */
.tt-video-swipe-container {
    touch-action: pan-y;
    user-select: none;
}

.tt-video-swipe-container.swiping {
    transition: transform 0.3s ease;
}

/* 分享卡片模态框 */
.tt-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tt-share-modal.active {
    opacity: 1;
    visibility: visible;
}

.tt-share-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.tt-share-modal.active .tt-share-card {
    transform: scale(1);
}

.tt-share-card h3 {
    color: #262626;
    margin-bottom: 16px;
    font-size: 18px;
}

.tt-share-preview {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.tt-share-preview img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 12px;
}

.tt-share-preview p {
    color: #262626;
    font-size: 14px;
    margin: 0;
}

.tt-share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.tt-share-btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tt-share-btn.primary {
    background: #0095f6;
    color: #fff;
}

.tt-share-btn.secondary {
    background: #f5f5f5;
    color: #262626;
}

.tt-share-btn:hover {
    transform: translateY(-2px);
}

/* PWA 离线提示 */
.tt-offline-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #262626;
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
}

.tt-offline-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 触摸滑动提示 */
.tt-swipe-hint {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tt-swipe-hint.show {
    opacity: 1;
}
