/* Video Search Widget Styles */

/* 主容器 */
.video-search-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    overflow: visible;
    border: none !important;
    box-shadow: none !important;
}

/* 视频背景 */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.video-background video,
.video-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
}

/* 搜索框区域 */
.search-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    width: 90%;
    max-width: 700px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 4px;
    overflow: visible;
    position: relative;
    height: 55px;
    padding: 8px;
}

/* 分类下拉 */
.category-dropdown {
    position: relative;
    min-width: 100px;
    cursor: pointer;
    z-index: 999;
}

.category-selected {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    gap: 8px;
    color: #333;
}

.category-selected .cat-icon {
    color: #666;
    display: flex;
    align-items: center;
}

.category-selected .cat-icon i,
.category-selected .cat-icon svg {
    width: 18px;
    height: 18px;
}

.category-selected .cat-icon img,
.category-item .cat-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.category-selected .dropdown-arrow {
    margin-left: auto;
    color: #999;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-dropdown:hover .dropdown-arrow,
.category-dropdown.is-open .dropdown-arrow {
    transform: rotate(-180deg);
}

.category-list {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease, max-height 0.3s ease;
    z-index: 999999 !important;
    padding: 0;
}


/* 浮动下拉列表 - 挂载到body上，完全脱离原有层级 */
.category-list-floating {
    position: fixed !important;
    width: 100px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 2147483647 !important;
    padding: 6px 0;
    opacity: 1 !important;
    visibility: visible !important;
}

.category-list-floating::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.05));
}

.category-list-floating .category-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    gap: 8px;
    color: #666;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 14px;
}

.category-list-floating .category-item:hover {
    background: #f8f8f8;
    color: #333;
}

.category-list-floating .category-item.active {
    color: #666;
}

.category-list-floating .category-item .cat-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-list-floating .category-item .cat-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.category-list::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.05));
}

.category-dropdown:hover .category-list,
.category-dropdown.is-open .category-list {
    opacity: 1;
    visibility: visible;
    max-height: 400px;
    padding: 6px 0;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    gap: 8px;
    color: #666;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 14px;
}

.category-item:hover {
    background: #f8f8f8;
    color: #333;
}

.category-item.active {
    color: #666;
}

.category-item .cat-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-item .cat-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.category-item .cat-name {
    font-size: 14px;
}

.category-item .cat-icon {
    display: flex;
    align-items: center;
    color: #666;
}

.category-item .cat-icon i,
.category-item .cat-icon svg {
    width: 16px;
    height: 16px;
}

/* 搜索输入框 */
.search-input-wrapper {
    flex: 1;
    padding: 0 15px;
    background: transparent !important;
    background-color: transparent !important;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.search-input {
    width: 100%;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 14px;
    color: #333;
    padding: 8px 0;
    background: transparent !important;
    background-color: transparent !important;
}

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

/* 相机图标 - 识图搜索（已隐藏） */
.image-search-btn {display: none !important;}
.image-search-btn-legacy {
    position: relative;
    padding: 10px 15px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.image-search-btn:hover {
    color: #333;
}

.image-search-btn .camera-icon {
    display: block;
}

.image-search-tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.image-search-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #333;
}

.image-search-btn:hover .image-search-tooltip {
    opacity: 1;
    visibility: visible;
}

/* 搜索按钮 */
.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s;
    flex-shrink: 0;
    background-color: #e53935; /* 默认红色，可被inline覆盖 */
}

.search-btn svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    stroke: white !important;
    fill: none;
}

.search-btn svg circle,
.search-btn svg path {
    stroke: white !important;
}

.search-btn:hover {
    opacity: 0.9;
}

/* 热搜词 */
.hot-keywords {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.hot-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 20px;
}

.hot-keyword {
    color: rgba(255, 255, 255, 0.85);
    font-size: 20px;
    text-decoration: none;
    transition: color 0.3s;
    padding: 4px 8px;
    border-radius: 3px;
}

.hot-keyword:hover {
    color: #e53935;
}

/* 视频底部弧度（白色填充） */
.video-arc {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 5;
    line-height: 0;
    pointer-events: none;
    overflow: visible;
    border: none;
}

.video-arc svg {
    display: block;
}

/* 彩虹弧线区域（紧贴视频弧下方） */
.rainbow-arc {
    position: relative;
    width: 100%;
    line-height: 0;
    pointer-events: none;
}

.rainbow-arc svg {
    display: block;
}

.rainbow-arc svg path[stroke] {
    stroke-linecap: butt;
    stroke-linejoin: miter;
}

/* 弹窗基础样式 */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
}

.modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    z-index: 9999;
    max-height: 90vh;
    overflow: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    z-index: 10;
    transition: all 0.3s;
}

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

/* 图片上传弹窗 */
.upload-content {
    width: 90%;
    max-width: 500px;
    padding: 40px;
    text-align: center;
}

.upload-content h3 {
    margin: 0 0 30px;
    font-size: 20px;
    color: #333;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 50px 20px;
    transition: border-color 0.3s;
}

.upload-area:hover {
    border-color: #e53935;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    color: #666;
}

.upload-label svg {
    color: #999;
}

.upload-label:hover svg {
    color: #e53935;
}

.upload-preview {
    margin-top: 20px;
}

.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
}

.search-by-image-btn {
    margin-top: 20px;
    padding: 12px 40px;
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.search-by-image-btn:hover {
    opacity: 0.9;
}

/* 登录弹窗 */
.login-content {
    width: 90%;
    max-width: 850px;
    overflow: hidden;
}

.login-wrapper {
    display: flex;
    min-height: 480px;
}

.login-left {
    width: 45%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    background-size: cover;
    background-position: center;
    padding: 50px 40px;
    color: #fff;
    position: relative;
}

.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.login-left > * {
    position: relative;
    z-index: 1;
}

.login-title {
    font-size: 42px;
    font-weight: bold;
    margin: 0 0 5px;
}

.login-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 40px;
    letter-spacing: 2px;
}

.login-features {
    list-style: none;
    padding: 0;
    margin: 0 0 40px;
}

.login-features li {
    padding: 8px 0;
    font-size: 16px;
    position: relative;
    padding-left: 20px;
}

.login-features li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #e53935;
}

.login-features li strong {
    font-weight: bold;
}

.login-domain {
    position: absolute;
    bottom: 40px;
    left: 40px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.login-right {
    flex: 1;
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
}

.login-tabs {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.login-tab {
    background: none;
    border: none;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    padding: 0;
    position: relative;
    transition: color 0.3s;
}

.login-tab:hover {
    color: #333;
}

.login-tab.active {
    color: #e53935;
}

.login-tab.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #e53935;
}

.login-tab-content {
    display: none;
    flex: 1;
}

.login-tab-content.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qrcode-wrapper {
    width: 200px;
    height: 200px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-wrapper img {
    max-width: 100%;
    max-height: 100%;
}

.qrcode-placeholder {
    color: #999;
}

.login-hint {
    margin: 30px 0 5px;
    color: #333;
    font-size: 14px;
}

.login-subhint {
    margin: 0;
    color: #999;
    font-size: 13px;
}

/* 登录表单 */
.login-form {
    width: 100%;
    max-width: 300px;
}

.form-group {
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #e53935;
}

.sms-group {
    display: flex;
    gap: 10px;
}

.sms-group .form-input {
    flex: 1;
}

.send-sms-btn {
    padding: 0 15px;
    background: #fff;
    border: 1px solid #e53935;
    color: #e53935;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    transition: all 0.3s;
}

.send-sms-btn:hover {
    background: #e53935;
    color: #fff;
}

.login-submit-btn {
    width: 100%;
    padding: 12px;
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.login-submit-btn:hover {
    opacity: 0.9;
}

/* 响应式 - 平板 */
@media (max-width: 1024px) {
    .search-wrapper {
        width: 90%;
        padding: 0 15px;
    }

    .hot-keywords {
        gap: 12px;
    }
}

/* 响应式 - 手机 */
@media (max-width: 768px) {
    .video-search-container {
        min-height: 250px;
        position: relative;
        overflow: visible;
    }

    .video-background {
        min-height: 250px;
    }

    .search-wrapper {
        width: 95%;
        padding: 0 10px;
        overflow: visible;
    }

    .search-box {
        height: 50px;
        padding: 2px;
        border-radius: 6px;
        overflow: visible;
    }

    .category-dropdown {
        min-width: 55px;
        position: relative;
        flex-shrink: 0;
    }

    .category-list {
        position: absolute;
        top: calc(100% + 10px);
        left: 50%;
        transform: translateX(-50%) translateY(10px);
        width: 85px;
        max-height: 60vh;
        overflow-y: auto;
        overflow-x: hidden;
        border-radius: 6px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        padding: 6px 0;
    }
    
    .category-list::before {
        content: '';
        display: block;
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 6px solid #fff;
    }

    .category-selected {
        padding: 6px 8px;
        gap: 4px;
    }

    .category-selected .cat-icon {
        display: flex;
    }

    .category-selected .cat-icon img {
        width: 14px;
        height: 14px;
    }

    .category-item {
        padding: 7px 10px;
        gap: 6px;
        font-size: 13px;
        justify-content: center;
    }
    
    .category-item .cat-icon {
        display: flex;
        width: 14px;
        height: 14px;
    }

    .category-item .cat-icon img {
        width: 14px;
        height: 14px;
    }

    .category-selected .cat-name {
        font-size: 12px;
    }

    /* 手机端禁用hover展开，只能点击 */
    .category-dropdown:hover .category-list {
        opacity: 0;
        visibility: hidden;
    }

    .category-dropdown.is-open .category-list {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    .category-dropdown:hover .dropdown-arrow {
        transform: none;
    }

    .category-dropdown.is-open .dropdown-arrow {
        transform: rotate(-180deg);
    }

    .category-selected .dropdown-arrow svg {
        width: 8px;
        height: 5px;
    }

    .search-input-wrapper {
        padding: 0 8px;
        min-width: 0;
        flex: 1;
    }

    .search-input {
        font-size: 14px;
        padding: 6px 0;
        width: 100%;
        min-width: 0;
        text-overflow: ellipsis;
    }

    .search-input::placeholder {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .image-search-btn {
        padding: 6px 8px;
        flex-shrink: 0;
    }

    .image-search-btn .camera-icon {
        width: 18px;
        height: 18px;
    }

    .search-btn {
        width: 45px;
        height: 45px;
        border-radius: 4px;
        flex-shrink: 0;
    }

    .search-btn svg {
        width: 18px !important;
        height: 18px !important;
    }

    .hot-keywords {
        gap: 8px;
        margin-top: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hot-label,
    .hot-keyword {
        font-size: 15px;
        padding: 2px 4px;
    }

    .login-wrapper {
        flex-direction: column;
    }

    .login-left {
        width: 100%;
        padding: 30px 25px;
    }

    .login-title {
        font-size: 28px;
    }

    .login-features {
        margin-bottom: 20px;
    }

    .login-domain {
        position: static;
        margin-top: 20px;
    }

    .login-right {
        padding: 30px 25px;
    }

    .login-tabs {
        gap: 15px;
        justify-content: center;
    }
}

/* 响应式 - 小屏手机 */
@media (max-width: 480px) {
    .search-box {
        height: 42px;
        padding: 8px;
    }

    .category-dropdown {
        min-width: 55px;
    }

    .category-selected {
        padding: 5px 6px;
    }

    .category-selected .cat-name {
        font-size: 12px;
    }

    .search-input {
        font-size: 12px;
    }

    .search-btn {
        width: 45px;
        height: 32px;
    }

    .hot-keywords {
        gap: 6px;
        margin-top: 12px;
    }

    .hot-label,
    .hot-keyword {
        font-size: 13px;
        padding: 2px 4px;
    }
}

/* ── 底部图片轮播 ── */
.vs-bottom-carousel {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 1600px;
    width: 100%;
    z-index: 6;
}

.vs-carousel-swiper {
    width: 100%;
    overflow: hidden;
}

.vs-carousel-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.vs-carousel-swiper .swiper-slide a {
    display: block;
    width: 100%;
    overflow: hidden;
}

.vs-carousel-img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.vs-carousel-img:hover {
    transform: scale(1.1);
}
