/**
 * [INPUT]: 无外部依赖
 * [OUTPUT]: 全局样式，布局/组件/响应式
 * [POS]: 前端核心样式，被 index.html 引用
 * [PROTOCOL]: 变更时更新此头部，然后检查 /CLAUDE.md
 *
 * 内容: Reset, 布局容器, 导航, 播放器, 侧边栏, 模态框, 响应式断点
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* 禁止 iOS Safari 双指缩放 */
    touch-action: pan-x pan-y;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    overflow: hidden;
    /* 禁止双击缩放，允许滚动和单击 */
    touch-action: manipulation;
}

.container {
    display: flex;
    height: 100vh;
}

/* Left Sidebar */
.sidebar {
    width: 200px;
    background: #fff;
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

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

.logo {
    font-size: 16px;
    font-weight: 600;
}

.blog-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.blog-link:hover {
    color: #000;
}

.search-box {
    position: relative;
    padding: 0 20px;
    margin-bottom: 30px;
}

.search-box input {
    width: 100%;
    padding: 8px 30px 8px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.search-box input:focus {
    border-color: #999;
}

.search-icon {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

.nav-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #999;
    padding: 0 20px 10px;
}

.nav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.nav-item:hover {
    background: #f9f9f9;
}

.nav-item .count {
    color: #999;
    font-size: 13px;
}

.sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-top: 1px solid #e5e5e5;
    font-size: 13px;
    color: #666;
}

.footer-icon {
    cursor: pointer;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 40px;
    position: relative;
}

/* Video Container */
.video-container {
    position: relative;
    height: 80vh;
    width: auto;
    aspect-ratio: 3/4;
    max-width: 90%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    transform-origin: center center;
}

.video-container.shrink {
    transform: scale(0.9);
    opacity: 0.3;
}

/* Mobile Category Selector */
.mobile-category-selector {
    display: none; /* Hidden by default, shown only on mobile */
}

/* Video Info */
.video-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    font-size: 14px;
    color: #999;
}

.info-value {
    color: #999;
}

.info-separator {
    color: #ccc;
}

.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    color: #999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.like-btn:hover {
    transform: scale(1.1);
}

.like-btn.liked {
    color: #ff4757;
}

.like-btn.liked svg {
    fill: #ff4757;
}

/* Video slide animations */
.video-container.slide-out-up {
    animation: slideOutUp 0.23s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.video-container.slide-out-down {
    animation: slideOutDown 0.23s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.video-container.slide-in-from-bottom {
    animation: slideInFromBottom 0.23s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.video-container.slide-in-from-top {
    animation: slideInFromTop 0.23s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideOutUp {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(-120%) scale(0.8);
        opacity: 0;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(120%) scale(0.8);
        opacity: 0;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(120%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-120%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.video-container video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
    z-index: 1;
}

/* Video Poster (AI 模特图，视频加载前显示) */
.video-container .video-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: #1a1a1a;
    transition: opacity 0.4s ease;
    overflow: hidden;
}

.video-container .video-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-container .video-poster.poster-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Video Loading Indicator */
.video-container .video-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: none;
}

.video-container.loading .video-loading-indicator {
    display: block;
}

.video-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Image Viewer */
.image-viewer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    max-width: 100%;
    max-height: 80vh;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.image-viewer.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.image-viewer.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    transform: none;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
}

.image-viewer.fullscreen img {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 0;
}

.image-viewer img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    transition: transform 0.3s ease;
}

/* Image Viewer Loading State */
.image-viewer-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 5;
}

.image-viewer-loader .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #fff;
}

.image-viewer-loader .loader-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.image-viewer.loading img {
    opacity: 0;
}

.image-viewer.loading .image-viewer-loader {
    display: flex;
    cursor: pointer;
    padding: 40px 60px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
}

.image-viewer.loading .image-viewer-loader:hover {
    background: rgba(0, 0, 0, 0.5);
}

.image-viewer.loading .image-viewer-loader .loader-text::after {
    content: ' (点击返回)';
    font-size: 12px;
    opacity: 0.8;
}

/* Loading时隐藏旋转按钮、计数器和水印标签 */
.image-viewer.loading .rotate-viewer,
.image-viewer.loading .image-counter {
    display: none;
}

.image-viewer.loading .image-wrapper::after {
    display: none;
}

.image-viewer:not(.loading) .image-viewer-loader {
    display: none;
}

/* Image slide animations */
.image-viewer img.slide-out-left {
    animation: imageSlideOutLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.image-viewer img.slide-out-right {
    animation: imageSlideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.image-viewer img.slide-in-from-right {
    animation: imageSlideInFromRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.image-viewer img.slide-in-from-left {
    animation: imageSlideInFromLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes imageSlideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes imageSlideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes imageSlideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes imageSlideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.rotate-viewer {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rotate-viewer:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.rotate-viewer:active {
    transform: scale(0.95);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 32px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.05);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.image-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #666;
    background: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.phone-mockup {
    perspective: 1000px;
}

.phone-frame {
    width: 375px;
    height: 812px;
    background: #000;
    border-radius: 40px;
    padding: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 30px;
    background: #000;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #1c1c1e;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 8px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.status-icons {
    display: flex;
    gap: 4px;
}

.app-content {
    padding: 20px;
}

.app-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
}

.back-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.app-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.reminder-card {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.reminder-card h3 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 5px;
}

.reminder-time {
    color: #999;
    font-size: 13px;
}

.datetime-picker {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.datetime-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #007AFF;
    font-size: 14px;
    margin-bottom: 15px;
}

.close-btn {
    background: none;
    border: none;
    color: #007AFF;
    font-size: 16px;
    cursor: pointer;
}

.time-slots {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.time-slot {
    flex: 1;
    padding: 8px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.time-options {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.time-opt {
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.confirm-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007AFF;
    border: none;
    color: #fff;
    font-size: 20px;
    margin: 15px auto 0;
    display: block;
    cursor: pointer;
}

/* Keyboard */
.keyboard {
    background: #2c2c2e;
    border-radius: 12px 12px 0 0;
    padding: 10px 5px;
}

.keyboard-row {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    justify-content: center;
}

.key {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    padding: 10px;
    min-width: 28px;
    cursor: pointer;
    transition: background 0.1s;
}

.key:active {
    background: rgba(255,255,255,0.4);
}

.key.shift,
.key.backspace {
    min-width: 40px;
}

.key.wide {
    min-width: 60px;
}

.key.space {
    flex: 1;
}

.key.return {
    min-width: 70px;
}

.keyboard-bottom {
    display: flex;
    justify-content: space-around;
    margin-top: 8px;
}

/* Right Sidebar */
.right-sidebar {
    width: 320px;
    background: #fff;
    border-left: 1px solid #e5e5e5;
    padding: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.profile-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.clip-info {
    margin-bottom: 30px;
}

.clip-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.action-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.action-btn:hover {
    background: #e5e5e5;
}

.clip-details {
    margin-bottom: 20px;
}

.clip-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.clip-subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.tags {
    margin-bottom: 20px;
}

.tags h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 10px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
}

.save-btn {
    width: 100%;
    padding: 12px;
    background: #007AFF;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.save-btn:hover {
    background: #0051D5;
}

.thumbnails {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.thumbnail {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    border: 2px solid transparent;
}

.thumbnail:hover {
    opacity: 1;
}

.thumbnail.active {
    opacity: 1;
    border-color: #007AFF;
}

.thumbnail img {
    width: 100%;
    display: block;
}

/* Model Preview Section */
.model-preview-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.preview-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 20px;
    padding: 0;
    flex-shrink: 0;
}

.model-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    flex: 1;
    max-height: calc(100vh - 80px);
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.model-thumbnails::-webkit-scrollbar {
    display: none;
}

.model-thumbnail {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    flex-shrink: 0;
    filter: grayscale(0.2);
}

.model-thumbnail:hover {
    opacity: 0.6;
    transform: scale(1.02);
    filter: grayscale(0);
}

.model-thumbnail.active {
    opacity: 1;
    transform: scale(1.08);
    filter: grayscale(0);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.model-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.model-thumbnail.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 1200px) {
    .right-sidebar {
        width: 250px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 180px;
    }

    .phone-frame {
        transform: scale(0.85);
    }
}

@media (max-width: 768px) {
    /* ═══════════════════════════════════════════════════════════════
       移动端全局滚动禁止 - 仅允许上下滑动切换视频
       ═══════════════════════════════════════════════════════════════ */
    html, body {
        overflow: hidden;
        overscroll-behavior: none;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    /* 全局隐藏移动端滚动条 */
    * {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    *::-webkit-scrollbar {
        display: none;
    }

    .container {
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }

    .sidebar,
    .right-sidebar {
        display: none;
    }

    .main-content {
        padding: 0;
        width: 100%;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        overflow: hidden;
    }

    .phone-frame {
        transform: scale(0.9);
    }

    .image-viewer {
        max-width: 90% !important;
        max-height: 80vh !important;
    }

    .image-viewer img {
        max-height: 80vh !important;
        max-width: 90vw !important;
    }

    .nav-btn {
        display: none !important;
    }

    /* Mobile Category Selector - Fixed at top */
    .mobile-category-selector {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 12px 20px;
        background: #fff;
        border-bottom: 1px solid #f0f0f0;
        height: 50px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        z-index: 100;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .mobile-category-selector::-webkit-scrollbar {
        display: none;
    }

    /* Mobile Upload Button */
    .mobile-upload-btn {
        display: flex; /* Show on mobile */
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        background: transparent;
        color: #333;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
        flex-shrink: 0;
        margin-right: 6px;
        font-size: 20px;
    }

    .mobile-upload-btn:active {
        opacity: 0.5;
        transform: scale(0.9);
    }

    .mobile-category-item {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 14px;
        color: #999;
        white-space: nowrap;
        cursor: pointer;
        transition: color 0.2s;
        flex-shrink: 0;
    }

    .mobile-category-item:active {
        opacity: 0.6;
    }

    .mobile-category-item.active {
        color: #333;
    }

    .mobile-count {
        font-size: 13px;
        color: #ccc;
    }

    .mobile-category-item.active .mobile-count {
        color: #999;
    }

    #mobileCategoryList {
        display: flex;
        gap: 10px;
    }

    /* Mobile category header (parent categories) */
    .mobile-category-header {
        position: relative;
    }

    /* Mobile subcategory dropdown */
    .mobile-subcategory-dropdown {
        position: fixed;
        top: 50px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.15);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease, opacity 0.25s ease;
        opacity: 0;
        z-index: 99;
        min-width: 120px;
        border: 1px solid #e5e5e5;
    }

    .mobile-subcategory-dropdown.active {
        max-height: 300px;
        opacity: 1;
        overflow-y: auto;
    }

    .mobile-subcategory-dropdown::-webkit-scrollbar {
        width: 4px;
    }

    .mobile-subcategory-dropdown::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 2px;
    }

    /* Mobile subcategory items */
    .mobile-subcategory-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
        font-size: 13px;
        color: #666;
        border-bottom: 1px solid #f5f5f5;
        cursor: pointer;
        transition: background 0.2s;
        white-space: nowrap;
    }

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

    .mobile-subcategory-item:active {
        background: #f9f9f9;
    }

    .mobile-subcategory-item.active {
        color: #333;
        background: #f5f5f5;
        font-weight: 500;
    }

    .mobile-subcategory-item .mobile-count {
        margin-left: 12px;
    }

    /* Video container - adjust for fixed header and bottom info bar */
    .video-container {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        margin: 0 auto;
        padding: 0;
        background: transparent;
        height: calc(100dvh - 60px - 70px);
        /* 100dvh - 顶部分类栏60px - 底部video-info+安全区域约70px */
    }

    /* Video info - fixed at bottom to prevent being obscured */
    .video-info {
        position: fixed;
        bottom: calc(15px + env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        max-width: calc(100% - 40px);
        margin: 0;
        padding: 8px 16px;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 20px;
        z-index: 100;
    }

    .video-info .info-value,
    .video-info .info-separator {
        color: rgba(255, 255, 255, 0.9);
    }

    .video-info .like-btn,
    .video-info .send-btn,
    .video-info .share-btn,
    .video-info .comment-btn {
        color: rgba(255, 255, 255, 0.8);
    }

    .video-info .like-btn.liked {
        color: #ff4757;
    }

    /* Additional safe area support for the entire page */
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Send Button - Similar to Like Button */
.send-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    color: #999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    transform: scale(1.1);
    color: #007AFF;
}

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

.share-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    color: #999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-btn:hover {
    transform: scale(1.1);
    color: #28a745;
}

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

/* Share Toast Notification */
.share-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.share-toast svg {
    width: 18px;
    height: 18px;
    color: #28a745;
}

/* Share Modal */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.share-modal.active {
    display: flex;
}

.share-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.share-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.share-modal-close:hover {
    color: #333;
}

.share-modal-body {
    padding: 20px;
}

.share-product-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.share-product-info #shareProductId {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.share-product-info .share-product-factory {
    font-size: 13px;
    color: #666;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
}

.share-link-container {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.share-link-container input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    background: #fafafa;
    outline: none;
    transition: all 0.2s ease;
}

.share-link-container input:focus {
    border-color: #28a745;
    background: white;
}

.share-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.share-copy-btn:hover {
    background: #218838;
}

.share-copy-btn:active {
    transform: scale(0.98);
}

.share-copy-btn.copied {
    background: #17a2b8;
}

.share-copy-btn.copied svg {
    display: none;
}

.share-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: #e8f4fc;
    border-radius: 8px;
    font-size: 13px;
    color: #0c5460;
}

.share-tip svg {
    flex-shrink: 0;
    margin-top: 1px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Email Modal */
.email-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.email-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.email-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.email-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.email-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.email-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.email-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.email-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.email-info {
    margin-bottom: 20px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}

.email-info p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
}

.email-info p:last-child {
    margin-bottom: 0;
}

.email-info strong {
    color: #333;
}

#emailProductInfo {
    color: #007AFF;
    font-weight: 500;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.email-form label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: -8px;
}

.email-form input,
.email-form textarea {
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.email-form input:focus,
.email-form textarea:focus {
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.email-form textarea {
    resize: vertical;
    min-height: 80px;
}

.email-modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 0;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.email-cancel-btn,
.email-send-btn {
    flex: 1;
    padding: 12px 24px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.email-cancel-btn {
    background: #fff;
    color: #666;
}

.email-cancel-btn:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #999;
}

.email-send-btn {
    background: #000;
    color: #fff;
    border-color: #000;
}

.email-send-btn:hover {
    background: #333;
    border-color: #333;
}

.email-send-btn:active {
    transform: scale(0.98);
}

.email-send-btn:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e5e5;
    margin: 0 0 20px 0;
    padding: 0;
    flex-shrink: 0;
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: #333;
    background: #f9f9f9;
}

.tab-btn.active {
    color: #000;
    border-bottom-color: #333;
    background: white;
}

.tab-content {
    display: none;
}

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

/* Manage Samples Styles */
.manage-container {
    padding: 0;
}

.manage-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.manage-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    color: #333;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.manage-btn:hover {
    background: #f5f5f5;
    border-color: #999;
    transform: translateY(-1px);
}

.manage-btn:active {
    transform: translateY(0);
}

.manage-btn svg {
    color: #333;
}

.sample-list-container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.sample-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sample-table thead {
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sample-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #000;
    border-bottom: 2px solid #e5e5e5;
}

.sample-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

.sample-table tbody tr:hover {
    background: #f9f9f9;
}

.sample-row-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 5px 10px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    background: #fff;
}

.action-btn-rename {
    color: #333;
    border-color: #e5e5e5;
}

.action-btn-rename:hover {
    background: #f5f5f5;
    border-color: #999;
}

.action-btn-delete {
    color: #666;
    border-color: #e5e5e5;
}

.action-btn-delete:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

.action-btn-download {
    color: #17a2b8;
    border-color: #17a2b8;
    padding: 5px 8px;
}

.action-btn-download:hover {
    background: #17a2b8;
    color: white;
}

.action-btn-download svg {
    display: block;
}

.download-all-btn {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.download-all-btn:hover {
    background: #138496;
    border-color: #138496;
    color: white;
}

.download-all-btn svg {
    color: white;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Editable cell */
.editable-cell {
    position: relative;
    cursor: pointer;
}

.editable-cell:hover {
    background: #e9ecef;
}

.editable-cell input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #0066cc;
    border-radius: 3px;
    font-size: 13px;
    outline: none;
}

.sample-product-id {
    font-weight: 600;
    color: #333;
}

.sample-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
    display: block;
}

.sample-thumbnail-cell {
    padding: 8px !important;
}

/* Sample Note Cell Styles */
.sample-note-cell {
    position: relative;
    cursor: pointer;
    padding: 8px !important;
    min-width: 180px;
    max-width: 250px;
    transition: background 0.2s ease;
}

.sample-note-cell:hover {
    background: rgba(243, 156, 18, 0.08);
}

.sample-note-text {
    display: inline-block;
    max-width: calc(100% - 28px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
    font-size: 13px;
    line-height: 1.4;
    padding: 4px 8px;
    background: rgba(243, 156, 18, 0.1);
    border-left: 2px solid #f39c12;
    border-radius: 0 3px 3px 0;
}

.sample-note-empty {
    color: #999;
    font-size: 12px;
}

.action-btn-note {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #999;
    opacity: 0;
    transition: all 0.2s ease;
    border-radius: 3px;
}

.sample-note-cell:hover .action-btn-note {
    opacity: 1;
}

.action-btn-note:hover {
    color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

/* Trash/Recycle Bin Styles */
.trash-container {
    padding: 0;
}

.trash-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: #fff3cd;
    border-radius: 6px;
    border: 1px solid #ffc107;
}

.trash-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #856404;
    font-size: 13px;
}

.trash-info svg {
    flex-shrink: 0;
}

.trash-list-container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.danger-btn {
    background: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

.danger-btn:hover {
    background: #c82333 !important;
    border-color: #bd2130 !important;
}

.action-btn-restore {
    color: #28a745;
    border-color: #28a745;
}

.action-btn-restore:hover {
    background: #28a745;
    color: white;
}

.action-btn-permanent-delete {
    color: #dc3545;
    border-color: #dc3545;
}

.action-btn-permanent-delete:hover {
    background: #dc3545;
    color: white;
}

.days-warning {
    color: #dc3545;
    font-weight: bold;
}

.days-normal {
    color: #28a745;
    font-weight: 500;
}

.days-caution {
    color: #fd7e14;
    font-weight: 500;
}

.trash-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.trash-empty-state svg {
    margin-bottom: 15px;
    opacity: 0.5;
}

.trash-empty-state p {
    margin: 0;
    font-size: 14px;
}

.email-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.email-loading p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Inline Animation Hints */
.hint-scroll-icon,
.hint-swipe-icon,
.hint-tap-video,
.hint-image-nav {
    position: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 999;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hint-scroll-icon.visible,
.hint-swipe-icon.visible,
.hint-tap-video.visible,
.hint-image-nav.visible {
    opacity: 1;
}

/* Desktop scroll hint */
.hint-scroll-icon {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hint-scroll-icon svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.hint-scroll-wheel {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

/* Mobile swipe hint */
.hint-swipe-icon {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hint-swipe-icon svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.hint-swipe-finger {
    animation: swipeBounce 2s ease-in-out infinite;
}

@keyframes swipeBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Tap video hint */
.hint-tap-video {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hint-tap-circle {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: tapPulse 2s ease-out infinite;
}

.hint-tap-circle:nth-child(2) {
    animation-delay: 0.6s;
}

.hint-tap-circle:nth-child(3) {
    animation-delay: 1.2s;
}

@keyframes tapPulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Image navigation hints */
.hint-image-nav {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    flex-direction: row;
    gap: 24px;
}

.hint-arrow {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.hint-arrow-left {
    animation: arrowBounceLeft 1.5s ease-in-out infinite;
}

.hint-arrow-right {
    animation: arrowBounceRight 1.5s ease-in-out infinite;
}

@keyframes arrowBounceLeft {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-8px);
    }
}

@keyframes arrowBounceRight {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(8px);
    }
}

/* Hint label */
.hint-label {
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Hide scroll hint on mobile, show swipe hint */
@media (max-width: 768px) {
    .hint-scroll-icon {
        display: none;
    }

    .hint-label {
        font-size: 12px;
    }
}

/* Hide swipe hint on desktop */
@media (min-width: 769px) {
    .hint-swipe-icon {
        display: none;
    }

    /* Hide mobile upload button on desktop */
    .mobile-upload-btn {
        display: none;
    }

    /* Hide mobile gallery button on desktop */
    .mobile-gallery-btn {
        display: none;
    }
}

/* Mobile Gallery Floating Button */
.mobile-gallery-btn {
    display: none;
}

@media (max-width: 768px) {
    .mobile-gallery-btn {
        display: flex;
        position: fixed;
        top: 60px;
        right: 15px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.95);
        color: #333;
        border: none;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
        z-index: 99;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .mobile-gallery-btn:hover {
        background: #333;
        color: white;
        transform: scale(1.05);
    }

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

    .mobile-gallery-btn.active {
        background: #333;
        color: white;
    }
}

/* ============================================
   搜索功能样式
   ============================================ */

/* 搜索结果信息条 */
.search-result-info {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 10px 18px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: slideInDown 0.3s ease-out;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.search-result-info.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-info span {
    flex: 1;
}

.search-result-info strong {
    font-weight: 700;
    font-size: 16px;
}

.clear-search-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.clear-search-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
    color: #333;
}

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

/* 关键词高亮 */
mark {
    background-color: #ffeb3b;
    color: #000;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 600;
}

/* 搜索图标可点击提示 */
.search-icon svg {
    transition: all 0.2s;
}

.search-icon:hover svg {
    transform: scale(1.1);
    opacity: 0.7;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .search-result-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px;
    }

    .clear-search-btn {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   水印样式 - Dynamic Watermark Overlay
   ============================================ */

/* 通用水印容器 */
[data-watermark] {
    position: relative;
}

/* 水印文字层 */
[data-watermark]::after {
    content: attr(data-watermark);
    position: absolute;
    top: 10px;
    left: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* 轻微阴影 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);

    pointer-events: none;
    z-index: 10;
    line-height: 1;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 3px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* 视频容器水印 */
.video-container[data-watermark]::after {
    font-size: 13px;
    padding: 3px 7px;
}

/* 图片包装器水印 */
.image-wrapper {
    position: relative;
    display: inline-block;
}

.image-wrapper img {
    display: block;
}

.image-wrapper[data-watermark]::after {
    font-size: 14px;
    padding: 4px 8px;
}

/* 缩略图水印 */
.model-thumbnail[data-watermark]::after {
    font-size: 9px;
    padding: 2px 4px;
    top: 6px;
    left: 6px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    [data-watermark]::after {
        font-size: 11px;
        padding: 2px 5px;
        top: 8px;
        left: 8px;
    }
}

/* Autoplay Indicator */
.autoplay-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #333;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.autoplay-indicator.active {
    opacity: 1;
}

/* Blinking green dot before text */
.autoplay-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: blink-dot 1.5s ease-in-out infinite;
}

@keyframes blink-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

@media (max-width: 768px) {
    .autoplay-indicator {
        top: 60px;  /* 避免与顶部分类选择器（高度50px）重叠 */
        font-size: 12px;
        padding: 6px 16px;
    }

    /* 移动端模态框优化 */
    .email-modal-content {
        width: 95%;
        max-height: 85vh;
        border-radius: 12px 12px 0 0;
        margin-bottom: 0;
    }

    .email-modal-header {
        padding: 16px 20px;
        flex-shrink: 0;
    }

    .email-modal-header h3 {
        font-size: 16px;
    }

    .email-modal-body {
        padding: 16px 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .email-modal-footer {
        padding: 16px 20px 16px;
        border-top: 1px solid #f0f0f0;
        background: #fff;
        flex-shrink: 0;
    }

    /* 上传表单优化 */
    .category-selection-row {
        flex-direction: column;
        gap: 12px;
    }

    .upload-drop-zone {
        padding: 30px 15px;
    }

    .upload-text {
        font-size: 14px;
    }

    .upload-hint {
        font-size: 12px;
    }

    /* 文件预览网格优化 */
    #filePreviewGrid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 10px !important;
    }

    .file-preview-card {
        padding: 8px;
    }

    .file-preview-image {
        height: 120px;
    }

    /* 样品管理优化 */
    .manage-toolbar {
        flex-direction: column;
        gap: 8px;
    }

    .manage-btn {
        width: 100%;
        justify-content: center;
    }

    .sample-list-container {
        max-height: 50vh;
        border-radius: 6px;
    }

    .sample-table {
        font-size: 12px;
        min-width: 600px;
    }

    .sample-table th {
        padding: 10px 6px;
        font-size: 12px;
        white-space: nowrap;
    }

    .sample-table td {
        padding: 8px 6px;
    }

    .sample-thumbnail {
        width: 50px;
        height: 50px;
    }

    .sample-row-actions {
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }

    .action-btn {
        width: 100%;
        padding: 6px 8px;
        font-size: 11px;
    }

    /* Tab 按钮优化 */
    .tab-btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    /* 确保按钮始终可见 */
    .email-cancel-btn,
    .email-send-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 44px;
    }
}

/* ========================================
   Image Rotation Viewer Modal Styles
   ======================================== */

.image-rotation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10200;
    justify-content: center;
    align-items: center;
}

.image-rotation-modal.active {
    display: flex;
}

.image-rotation-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Header */
.image-rotation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.rotation-product-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rotation-product-id {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.rotation-image-count {
    font-size: 13px;
    color: #666;
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 12px;
}

.image-rotation-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.image-rotation-close:hover {
    color: #333;
}

/* Body */
.image-rotation-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Main Image Container */
.rotation-main-image-container {
    position: relative;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 400px;
}

.rotation-main-image {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rotation-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.rotation-indicator.modified {
    background: #e67e22;
}

.rotation-image-type {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(52, 152, 219, 0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
}

/* Navigation Buttons */
.rotation-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
}

.rotation-nav-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.rotation-prev-btn {
    left: 12px;
}

.rotation-next-btn {
    right: 12px;
}

/* Image Loading */
.rotation-image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.rotation-image-loading.active {
    display: block;
}

/* Rotation Controls */
.rotation-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.rotation-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.rotation-btn:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.rotation-btn:active {
    transform: scale(0.98);
}

.rotation-btn svg {
    flex-shrink: 0;
}

.rotation-reset-btn {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.rotation-reset-btn:hover {
    background: #ffe69c;
}

/* Thumbnails */
.rotation-thumbnails-container {
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
}

.rotation-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.rotation-thumbnail-item {
    position: relative;
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.rotation-thumbnail-item:hover {
    border-color: #999;
}

.rotation-thumbnail-item.active {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.rotation-thumbnail-item.modified::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    background: #e67e22;
    border-radius: 50%;
    border: 2px solid #fff;
}

.rotation-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rotation-thumbnail-type {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 9px;
    text-align: center;
    padding: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer */
.image-rotation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    gap: 16px;
}

.rotation-save-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.rotation-save-info.has-changes {
    color: #e67e22;
}

.rotation-footer-buttons {
    display: flex;
    gap: 10px;
}

.rotation-cancel-btn,
.rotation-save-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.rotation-cancel-btn {
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
}

.rotation-cancel-btn:hover {
    background: #f5f5f5;
}

.rotation-save-btn {
    background: #3498db;
    border: none;
    color: #fff;
}

.rotation-save-btn:hover:not(:disabled) {
    background: #2980b9;
}

.rotation-save-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading Overlay */
.rotation-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

.rotation-loading-overlay.active {
    display: flex;
}

.rotation-loading-overlay p {
    font-size: 14px;
    color: #666;
}

/* Sample Thumbnail Click Style */
.sample-thumbnail.clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.sample-thumbnail.clickable:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .image-rotation-content {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }

    .image-rotation-header {
        padding: 12px 16px;
    }

    .rotation-product-id {
        font-size: 16px;
    }

    .image-rotation-body {
        padding: 12px;
    }

    .rotation-main-image-container {
        min-height: 200px;
        max-height: 300px;
    }

    .rotation-main-image {
        max-height: 300px;
    }

    .rotation-controls {
        gap: 8px;
    }

    .rotation-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .rotation-btn span {
        display: none;
    }

    .rotation-thumbnail-item {
        width: 56px;
        height: 56px;
    }

    .image-rotation-footer {
        flex-direction: column;
        padding: 12px 16px;
    }

    .rotation-save-info {
        text-align: center;
    }

    .rotation-footer-buttons {
        width: 100%;
    }

    .rotation-cancel-btn,
    .rotation-save-btn {
        flex: 1;
    }
}

/* ============================================
   移动端搜索功能样式
   ============================================ */

/* Mobile Search Button (next to upload button) */
.mobile-search-btn {
    display: none; /* Hidden by default */
}

@media (max-width: 768px) {
    .mobile-search-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        background: transparent;
        color: #333;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
        flex-shrink: 0;
        margin-right: 8px;
    }

    .mobile-search-btn:active {
        opacity: 0.5;
        transform: scale(0.9);
    }

    /* Mobile Search Modal */
    .mobile-search-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        z-index: 10000;
        display: none;
        flex-direction: column;
    }

    .mobile-search-modal.active {
        display: flex;
    }

    .mobile-search-header {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        padding-top: max(12px, env(safe-area-inset-top));
        border-bottom: 1px solid #e5e5e5;
        gap: 12px;
        background: #fff;
    }

    .mobile-search-input-wrapper {
        flex: 1;
        display: flex;
        align-items: center;
        background: #f5f5f5;
        border-radius: 8px;
        padding: 0 12px;
        gap: 8px;
    }

    .mobile-search-input-wrapper svg {
        color: #999;
        flex-shrink: 0;
    }

    .mobile-search-input-wrapper input {
        flex: 1;
        border: none;
        outline: none;
        background: transparent;
        font-size: 16px;
        padding: 10px 0;
        color: #333;
    }

    .mobile-search-input-wrapper input::placeholder {
        color: #999;
    }

    .mobile-search-close {
        background: none;
        border: none;
        font-size: 15px;
        color: #007AFF;
        cursor: pointer;
        padding: 8px 0;
        flex-shrink: 0;
    }

    .mobile-search-hints {
        padding: 20px 16px;
    }

    .mobile-search-hints p {
        font-size: 13px;
        color: #999;
        margin-bottom: 12px;
    }

    .search-hint-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .hint-tag {
        display: inline-block;
        padding: 6px 12px;
        background: #f0f0f0;
        border-radius: 16px;
        font-size: 13px;
        color: #333;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .hint-tag:active {
        background: #e0e0e0;
    }
}

/* Search Results Gallery Styles */
.gallery-view.search-mode .gallery-header {
    background: #f8f8f8;
}

.search-query-display {
    font-weight: 600;
    color: #333;
    margin-right: 8px;
}

.search-result-count {
    font-size: 13px;
    color: #666;
    margin-right: 8px;
}

.search-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* Similarity Badge on Gallery Items */
.similarity-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

/* Search Result Item Enhancements */
.search-result-item {
    break-inside: avoid;
}

.search-result-item .gallery-item-info {
    padding: 10px 12px;
}

.search-result-item .gallery-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.search-result-item .gallery-item-meta {
    font-size: 11px;
    color: #666;
}

.search-result-item .factory-name {
    color: #999;
}

.search-result-item .category-name {
    color: #666;
}

.search-result-item .factory-name::after {
    content: ' · ';
}

/* Gallery Item Thumbnails */
.gallery-item-thumbnails {
    display: flex;
    gap: 4px;
    padding: 0 12px 12px;
}

.gallery-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb.active {
    border-color: #333;
}

.gallery-thumb:hover {
    border-color: #999;
}

/* Video Poster for Search Results */
.search-result-item .video-poster {
    width: 100%;
    aspect-ratio: 3/4;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    position: relative;
    transition: opacity 0.3s ease;
}

.search-result-item .gallery-item-video-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.search-result-item .gallery-item-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-item .gallery-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.search-result-item:hover .gallery-play-overlay {
    opacity: 1;
}

/* Global Search Loader */
.global-search-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.global-search-loader.active {
    display: flex;
}

.search-loader-content {
    text-align: center;
}

.search-loader-content .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.search-loader-content p {
    margin-top: 16px;
    color: #666;
    font-size: 14px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .global-search-loader {
        background: rgba(255, 255, 255, 0.95);
    }
}

/* =================================
   My Boards Section Styles
   ================================= */

.boards-login-hint {
    padding: 10px 20px;
    font-size: 12px;
    color: #999;
}

.board-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.board-nav-item:hover {
    background: #f5f5f5;
}

.board-nav-item.active {
    background: #333;
    color: white;
}

.board-nav-item .board-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-nav-item .board-count {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}

.board-nav-item.active .board-count {
    color: rgba(255,255,255,0.7);
}

.board-nav-item .board-default-star {
    color: #f1c40f;
    margin-left: 4px;
    font-size: 10px;
}

.board-nav-item .board-export-btn {
    display: none;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border-radius: 50%;
    background: #27ae60;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
    align-items: center;
    justify-content: center;
}

.board-nav-item:hover .board-export-btn {
    display: inline-flex;
}

.board-nav-item .board-export-btn:hover {
    background: #219a52;
}

.board-nav-item.active .board-export-btn {
    background: rgba(255, 255, 255, 0.3);
}

.board-nav-item.active .board-export-btn:hover {
    background: #27ae60;
}

.board-nav-item .board-share-btn {
    display: none;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
    align-items: center;
    justify-content: center;
}

.board-nav-item:hover .board-share-btn {
    display: inline-flex;
}

.board-nav-item .board-share-btn:hover {
    background: #2980b9;
}

.board-nav-item.active .board-share-btn {
    background: rgba(255, 255, 255, 0.3);
}

.board-nav-item.active .board-share-btn:hover {
    background: #3498db;
}

.board-nav-item .board-delete-btn {
    display: none;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    font-size: 14px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.board-nav-item:hover .board-delete-btn {
    display: inline-block;
}

.board-nav-item:hover .board-count {
    display: none;
}

.board-nav-item .board-delete-btn:hover {
    background: #c82333;
}

.board-nav-item.active .board-delete-btn {
    background: rgba(255, 255, 255, 0.3);
}

.board-nav-item.active .board-delete-btn:hover {
    background: #dc3545;
}

.add-board-item {
    color: #666;
    font-size: 13px;
}

.add-board-item:hover {
    color: #333;
    background: #f5f5f5;
}

/* New Board Input */
.new-board-input-wrapper {
    padding: 8px 20px;
    display: none;
}

.new-board-input-wrapper.visible {
    display: block;
}

.new-board-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}

.new-board-input:focus {
    border-color: #333;
}

/* =================================
   Board View Styles
   ================================= */

.board-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.board-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
    background: #fff;
}

.board-back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.board-back-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.board-title {
    flex: 1;
    margin: 0 20px;
    font-size: 18px;
    font-weight: 600;
}

.board-actions {
    display: flex;
    gap: 10px;
}

.board-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: all 0.2s;
}

.board-action-btn:hover {
    background: #e9ecef;
}

.board-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.board-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    align-content: start;
}

.board-item-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.board-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.board-item-card img,
.board-item-card video {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}

.board-item-info {
    padding: 10px;
    background: #fff;
}

.board-item-id {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.board-item-factory {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.board-item-note {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.board-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

.board-item-card:hover .board-item-remove {
    display: flex;
}

.board-item-remove:hover {
    background: rgba(220, 53, 69, 0.9);
}

/* Board Empty State */
.board-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.board-empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.board-empty-state p {
    font-size: 14px;
}

/* Board Share Modal */
.board-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.board-share-modal.active {
    display: flex;
}

.board-share-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    padding: 20px;
}

.board-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.board-share-header h4 {
    font-size: 16px;
    margin: 0;
}

.board-share-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.board-share-link {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.board-share-link input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.board-share-copy-btn {
    padding: 10px 16px;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.board-share-copy-btn:hover {
    background: #444;
}

/* Board Share Modal - Body */
.board-share-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Password Protection Section */
.board-share-password-section {
    border-top: 1px solid #eee;
    padding-top: 16px;
}

.board-share-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.board-share-toggle span:first-child {
    font-size: 14px;
    color: #333;
}

.toggle-switch-wrapper {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch-wrapper input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch-wrapper input:checked + .toggle-slider {
    background-color: #3498db;
}

.toggle-switch-wrapper input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Password Input */
.board-share-password-input {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.board-share-password-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.board-share-password-input input:focus {
    outline: none;
    border-color: #3498db;
}

.board-share-password-input button {
    padding: 10px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.board-share-password-input button:hover {
    background: #2980b9;
}

/* Remove Share Button */
.board-share-actions {
    border-top: 1px solid #eee;
    padding-top: 16px;
}

.board-share-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.board-share-remove-btn:hover {
    background: #dc3545;
    color: white;
}

/* Share Hint */
.board-share-hint {
    font-size: 12px;
    color: #666;
    margin: 0;
    text-align: center;
}

/* Board Edit Modal */
.board-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.board-edit-modal.active {
    display: flex;
}

.board-edit-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    padding: 20px;
}

.board-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.board-edit-header h4 {
    font-size: 16px;
    margin: 0;
}

.board-edit-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.board-edit-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.board-edit-form label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.board-edit-form input[type="text"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.board-edit-form input[type="text"]:focus {
    outline: none;
    border-color: #333;
}

.board-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.board-edit-save-btn {
    flex: 1;
    padding: 10px;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.board-edit-save-btn:hover {
    background: #444;
}

.board-edit-delete-btn {
    padding: 10px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.board-edit-delete-btn:hover {
    background: #c82333;
}

/* Responsive */
@media (max-width: 768px) {
    .board-header {
        padding: 10px 15px;
    }

    .board-title {
        font-size: 16px;
        margin: 0 10px;
    }

    .board-items-container {
        padding: 15px;
    }

    .board-items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ==================== */
/* Comment Button & Modal */
/* ==================== */

.comment-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    color: #999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-btn:hover {
    transform: scale(1.1);
    color: #f39c12;
}

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

.comment-btn.has-comment {
    color: #f39c12;
}

.comment-btn.has-comment svg {
    fill: rgba(243, 156, 18, 0.2);
}

/* Video Comment Display */
.video-comment {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(243, 156, 18, 0.08);
    border-left: 3px solid #f39c12;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    max-width: 400px;
    word-break: break-word;
}

.video-comment .comment-text {
    display: block;
}

/* Product Note Display (Admin/Factory note - visible to all) */
.product-note {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(243, 156, 18, 0.08);
    border-left: 3px solid #f39c12;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    max-width: 400px;
    word-break: break-word;
}

.product-note .product-note-text {
    display: block;
}

.product-note::before {
    content: '';
    display: none;
}

/* Comment Modal */
.comment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.comment-modal.active {
    display: flex;
}

.comment-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.comment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.comment-modal-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.comment-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.comment-modal-close:hover {
    color: #333;
}

.comment-modal-body {
    padding: 20px;
}

.comment-modal-body textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.comment-modal-body textarea:focus {
    outline: none;
    border-color: #f39c12;
}

.comment-modal-body textarea::placeholder {
    color: #999;
}

.comment-char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.comment-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.comment-cancel-btn {
    flex: 1;
    padding: 10px;
    background: white;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.comment-cancel-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.comment-save-btn {
    flex: 1;
    padding: 10px;
    background: #f39c12;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.comment-save-btn:hover {
    background: #e08e0b;
}

.comment-save-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Mobile responsive for comment */
@media (max-width: 768px) {
    .video-comment {
        position: fixed;
        bottom: calc(55px + env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        max-width: calc(100% - 40px);
        margin: 0;
        padding: 8px 14px;
        background: rgba(243, 156, 18, 0.85);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-radius: 12px;
        border-left: none;
        z-index: 99;
    }

    .video-comment .comment-text {
        color: #fff;
    }

    .product-note {
        position: fixed;
        bottom: calc(100px + env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 40px);
        z-index: 99;
        background: rgba(243, 156, 18, 0.85);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-radius: 12px;
        border-left: none;
    }

    .product-note .product-note-text {
        color: #fff;
    }

    .comment-modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   自定义分类样式
   ═══════════════════════════════════════════════════════════════════════════ */

/* 侧边栏添加按钮 */
.nav-add-btn {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-add-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* 自定义分类项 */
.custom-category-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-category-item:hover {
    background: #f5f5f5;
}

.custom-category-item.active {
    background: #333;
    color: white;
}

.custom-category-item .category-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-category-item .category-count {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}

.custom-category-item.active .category-count {
    color: rgba(255, 255, 255, 0.7);
}

/* 子分类缩进 */
.custom-category-item[data-level="1"] {
    padding-left: 35px;
}

.custom-category-item[data-level="2"] {
    padding-left: 50px;
}

.custom-category-item[data-level="3"] {
    padding-left: 65px;
}

/* 展开/折叠图标 */
.category-toggle {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: transform 0.2s;
}

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

/* 分类操作按钮 */
.custom-category-actions {
    display: none;
    gap: 4px;
    margin-left: 8px;
}

.custom-category-item:hover .custom-category-actions {
    display: flex;
}

.custom-category-item:hover .category-count {
    display: none;
}

.category-action-btn {
    background: transparent;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #999;
    border-radius: 3px;
    transition: all 0.2s;
}

.category-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.custom-category-item.active .category-action-btn {
    color: rgba(255, 255, 255, 0.7);
}

.custom-category-item.active .category-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 批量操作区域 */
.batch-category-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.batch-category-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    min-width: 140px;
    background: white;
    cursor: pointer;
}

.batch-category-select:focus {
    outline: none;
    border-color: #333;
}

.batch-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.batch-add-btn:hover:not(:disabled) {
    background: #218838;
}

.batch-add-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 表格复选框 */
.sample-table th input[type="checkbox"],
.sample-table td input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 分类管理 Modal */
.category-manage-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.category-manage-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

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

.category-manage-item:hover {
    background: #f8f9fa;
}

.category-manage-item .item-name {
    flex: 1;
    font-size: 14px;
}

.category-manage-item .item-count {
    font-size: 12px;
    color: #999;
    margin-right: 12px;
}

.category-manage-item .item-actions {
    display: flex;
    gap: 8px;
}

.category-manage-item .item-action-btn {
    background: transparent;
    border: 1px solid #ddd;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-manage-item .item-action-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.category-manage-item .item-action-btn.danger {
    color: #dc3545;
    border-color: #dc3545;
}

.category-manage-item .item-action-btn.danger:hover {
    background: #dc3545;
    color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════
   分类显示设置面板
   ═══════════════════════════════════════════════════════════════════════════ */

.category-display-settings {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.category-display-settings .settings-panel h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.category-display-settings .settings-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-display-settings .settings-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.category-display-settings .settings-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.category-display-settings .settings-hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: #999;
}

/* 新建分类输入框 */
.new-category-input-wrapper {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 16px;
}

.new-category-input-wrapper input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.new-category-input-wrapper input:focus {
    outline: none;
    border-color: #333;
}

.new-category-input-wrapper button {
    padding: 8px 16px;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.new-category-input-wrapper button:hover {
    background: #555;
}

/* 空状态提示 */
.custom-category-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* 子分类添加按钮 */
.add-subcategory-btn {
    font-size: 11px;
    color: #666;
    padding: 2px 6px;
    margin-left: 4px;
}

.add-subcategory-btn:hover {
    color: #333;
    background: #f0f0f0;
}
