* {
    box-sizing: border-box;
  }
  :root {
    --nav-h: 70px;
    --video-col-w: 100vw;
    --safe: env(safe-area-inset-bottom, 0px);
  }
  .tiktok-page-container {
    background: #000;
    min-height: 100vh;
    height: 100vh;
    width: 100vw;
    padding: 0;
    margin: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
  }
  .tiktok-video-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: pointer;
    /* box-shadow: 0 0 9px rgba(191, 191, 191, 0.36); */
  }
  @media (min-width: 768px) {
    .tiktok-video-container {
      width: 400px;
      max-width: 400px;
      height: 100vh;
      padding-bottom: 0;
    }
    .video-item {
      height: 100dvh;
    }
    .video-player-container {
      width: 100%;
      height: 100%;
      position: absolute;
    }
  }
  .video-list {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(0);
    display: flex;
    flex-direction: column;
    overflow-y: scroll;      /* Cho phép cuộn dọc */
    scroll-snap-type: y mandatory; /* Kích hoạt chế độ hít theo trục dọc */
    scroll-behavior: smooth; /* Cuộn mượt mà */
    scrollbar-width: none;   /* Ẩn thanh cuộn trên Firefox */
  }
  .video-item {
    position: relative;
    width: 100%;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
    cursor: pointer;
    scroll-snap-align: start; /* Khi dừng, bài đăng sẽ hít vào đỉnh container */
    scroll-snap-stop: always; /* Chống việc cuộn quá nhanh lướt qua nhiều bài */
  }
  @media (max-width: 768px) {
    .video-item {
      height: 100dvh;
      padding-bottom: 0;
    }
    .video-player-container {
      width: 100vw;
      height: 100vh;
      position: relative;
      overflow: hidden;
    }
    .video-player {
      width: auto;
      height: auto;
      max-width: 100vw;
      max-height: 100vh;
      object-fit: contain;
      object-position: center;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
  }
  .video-player-container {
    width: 100%;
    height: 100%;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: baseline;
    overflow: hidden;
    background: #000;
    cursor: pointer;
    z-index: 1;
  }
  .video-player {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #000;
    object-position: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
  }
  .video-player:not([src]):not([data-loaded]) {
    background: #000;
  }
  .video-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
  }
  .video-player::-webkit-media-controls {
    display: none !important;
  }
  .video-player::-webkit-media-controls-panel {
    display: none !important;
  }
  .video-player::-webkit-media-controls-play-button {
    display: none !important;
  }
  .video-player::-webkit-media-controls-volume-slider {
    display: none !important;
  }
  .video-player::-webkit-media-controls-mute-button {
    display: none !important;
  }
  .video-player::-webkit-media-controls-timeline {
    display: none !important;
  }
  .video-player::-webkit-media-controls-current-time-display {
    display: none !important;
  }
  .video-player::-webkit-media-controls-time-remaining-display {
    display: none !important;
  }
  .video-player::-webkit-media-controls-fullscreen-button {
    display: none !important;
  }
  .video-player::-webkit-media-controls-overlay-play-button {
    display: none !important;
  }
  .video-player::-webkit-media-controls-start-playback-button {
    display: none !important;
  }
  .video-player::-moz-media-controls {
    display: none !important;
  }
  .video-player::-ms-media-controls {
    display: none !important;
  }
  .video-player {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
  .video-player:focus {
    outline: 0;
  }
  .video-player:focus::-webkit-media-controls,
  .video-player:hover::-webkit-media-controls {
    display: none !important;
  }
  .video-player {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: auto;
  }
  .pause-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
  }
  .pause-icon-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  .pause-icon-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
  }
  .pause-icon {
    color: #fff;
    font-size: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
  }
  @media (max-width: 768px) {
    .pause-icon-overlay {
      padding: 15px;
    }
    .pause-icon {
      font-size: 50px;
      width: 50px;
      height: 50px;
    }
  }
  .video-controls-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 30px;
  }
  .video-controls-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .control-btn {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.41);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
  }
  .control-btn:hover {
    opacity: 0.8;
  }
  .control-btn:active {
    opacity: 0.6;
  }
  .skip-btn {
    width: 55px;
    height: 55px;
    background: rgba(0, 0, 0, 0.41);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
  }
  .skip-btn:hover {
    opacity: 0.8;
  }
  .skip-btn:active {
    opacity: 0.6;
  }
  .play-btn {
    width: 80px !important;
    height: 80px !important;
    background: rgba(0, 0, 0, 0.41) !important;
  }
  .play-icon-svg {
    width: 36px;
    height: 36px;
    fill: white;
  }
  .skip-icon {
    width: 24px;
    height: 24px;
    fill: white;
  }
  .play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
    cursor: pointer;
  }
  .play-icon-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  @media (max-width: 768px) {
    .video-controls-overlay {
      gap: 15px;
    }
    .control-btn {
      width: 65px;
      height: 65px;
    }
    .skip-btn {
      width: 45px;
      height: 45px;
    }
    .play-btn {
      width: 65px !important;
      height: 65px !important;
      background: rgba(0, 0, 0, 0.41) !important;
    }
    .play-icon-svg {
      width: 30px;
      height: 30px;
    }
    .skip-icon {
      width: 20px;
      height: 20px;
    }
  }
  .video-header {
    position: absolute;
    top: 20px;
    left: 10px;
    right: 10px;
    z-index: 30;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }
  .video-controls-left {
    display: flex;
    gap: 10px;
  }
  .video-controls-right {
    display: flex;
    gap: 10px;
  }
  .video-close-btn,
  .video-control-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: 0 0;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  }
  .video-close-btn:hover,
  .video-control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
  }
  .video-close-btn.active,
  .video-control-btn.active {
    background: rgba(255, 255, 255, 0.2);
  }
  .side-controls-container {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 103;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(5px, 2.5vh, 5px);
    min-height: auto;
    transition: opacity 0.25s ease, all 0.3s ease;
    pointer-events: auto;
  }
  @media (max-width: 768px) {
    .side-controls-container {
      right: calc(50vw - (var(--video-col-w) / 2) - 10px);
      display: none;
    }
  }
  .like-controls {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1.2vh, 10px);
    padding: clamp(12px, 2vh, 18px) 8px;
    transition: opacity 0.25s ease, all 0.3s ease;
    pointer-events: auto;
  }
  .mute-controls {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1.2vh, 10px);
    transition: opacity 0.25s ease, all 0.3s ease;
    pointer-events: auto;
  }
  .share-controls {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(6px, 1.2vh, 10px);
    padding: clamp(12px, 2vh, 18px) 8px;
    transition: opacity 0.25s ease, all 0.3s ease;
    pointer-events: auto;
  }
  .mute-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: clamp(46px, 9vw, 54px);
    height: clamp(46px, 9vw, 54px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
  }
  .mute-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
  }
  .mute-btn:active {
    transform: scale(0.95);
  }
  .mute-btn i {
    font-size: clamp(18px, 4vw, 22px);
    transition: transform 0.3s ease;
  }
  .mute-btn.muted,
  .mute-btn[data-muted="true"] {
    background: rgba(255, 87, 87, 0.25) !important;
    border-color: rgba(255, 87, 87, 0.4) !important;
    color: #ff6b6b !important;
    box-shadow: 0 0 10px rgba(255, 87, 87, 0.3);
    transition: all 0.3s ease;
  }
  .mute-btn.muted:hover,
  .mute-btn[data-muted="true"]:hover {
    background: rgba(255, 87, 87, 0.35) !important;
    border-color: rgba(255, 87, 87, 0.5) !important;
    box-shadow: 0 0 15px rgba(255, 87, 87, 0.4);
    transform: scale(1.05);
  }
  .share-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: clamp(46px, 9vw, 54px);
    height: clamp(46px, 9vw, 54px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
  }
  .share-btn:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
  }
  .share-btn:active {
    transform: scale(0.95);
  }
  .share-btn i {
    font-size: clamp(18px, 4vw, 22px);
    transition: transform 0.3s ease;
  }
  .share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
  }
  .share-modal {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    animation: scaleIn 0.3s ease forwards;
  }
  .share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .share-modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .share-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }
  .share-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
  }
  .share-modal-content {
    padding: 20px;
  }
  .share-url-section {
    margin-bottom: 20px;
  }
  .share-url-section label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 8px;
  }
  .share-url-container {
    display: flex;
    gap: 8px;
  }
  .share-url-container input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    padding: 10px 12px;
    font-size: 14px;
    outline: 0;
  }
  .share-copy-btn {
    background: rgba(0, 123, 255, 0.8);
    border: none;
    color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
  }
  .share-copy-btn:hover {
    background: #007bff;
    transform: scale(1.05);
  }
  .share-platform-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 12px;
  }
  .share-platform-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .share-platform-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
  }
  .share-platform-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  .share-platform-btn.facebook:hover {
    background: rgba(24, 119, 242, 0.2);
    border-color: rgba(24, 119, 242, 0.5);
  }
  .share-platform-btn.twitter:hover {
    background: rgba(29, 161, 242, 0.2);
    border-color: rgba(29, 161, 242, 0.5);
  }
  .share-platform-btn.telegram:hover {
    background: rgba(0, 136, 204, 0.2);
    border-color: rgba(0, 136, 204, 0.5);
  }
  .share-platform-btn.whatsapp:hover {
    background: rgba(37, 211, 102, 0.2);
    border-color: rgba(37, 211, 102, 0.5);
  }
  @media (max-width: 768px) {
    .share-modal {
      width: 95%;
      margin: 0 20px;
    }
    .share-platform-buttons {
      grid-template-columns: 1fr;
    }
    .share-platform-btn {
      justify-content: center;
      padding: 14px;
    }
    .share-modal-header {
      padding: 16px;
    }
    .share-modal-content {
      padding: 16px;
    }
  }
  @keyframes fadeIn {
    to {
      opacity: 1;
    }
  }
  @keyframes scaleIn {
    to {
      transform: scale(1);
    }
  }
  .navigation-controls {
    /* position: fixed; */
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 103;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.6vh, 14px);
    padding: clamp(12px, 2vh, 20px) 8px;
    pointer-events: auto;
  }
  @media (min-width: 768px) {
    .navigation-controls {
      left: calc(50vw - (var(--video-col-w) / 2) - 10px);
    }
  }
  .like-btn,
  .nav-btn {
    width: clamp(44px, 6.8vw, 54px);
    height: clamp(44px, 6.8vw, 54px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: clamp(16px, 2.6vw, 18px);
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, background 0.2s ease;
    cursor: pointer;
    visibility: visible;
  }
  .like-btn:hover,
  .nav-btn:hover {
    transform: scale(1.06);
    background: rgba(255, 255, 255, 0.18);
  }
  .nav-btn:disabled {
    opacity: 0.55;
    transform: none;
    cursor: not-allowed;
  }
  .like-btn.liked {
    background: rgba(255, 20, 147, 0.85);
    border-color: rgba(255, 20, 147, 0.9);
    color: #fff;
    animation: heartPulse 0.6s ease-in-out;
    cursor: default;
  }
  .like-btn.liked:hover {
    background: rgba(255, 20, 147, 0.9);
    transform: none;
  }
  .like-count {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: clamp(10px, 1.7vw, 12px);
    line-height: 1;
    min-width: clamp(26px, 5.2vw, 36px);
    min-height: clamp(18px, 3.2vw, 22px);
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    transition: transform 0.15s ease;
    visibility: visible;
  }
  .like-btn.liked + .like-count {
    transform: translateY(-2px);
  }
  @keyframes heartPulse {
    0% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.3);
    }
    100% {
      transform: scale(1);
    }
  }
  @keyframes alreadyLikedShake {
    0%,
    100% {
      transform: translateX(0);
    }
    25% {
      transform: translateX(-3px);
    }
    75% {
      transform: translateX(3px);
    }
  }
  .like-animation {
    position: absolute;
    font-size: 30px;
    color: #ff1493;
    pointer-events: none;
    animation: likeAnimation 1.5s ease-out forwards;
    z-index: 100;
  }
  @keyframes likeAnimation {
    0% {
      opacity: 1;
      transform: translateY(0) scale(0.5);
    }
    15% {
      transform: translateY(-10px) scale(1.2);
    }
    100% {
      opacity: 0;
      transform: translateY(-100px) scale(1);
    }
  }
  @media (min-width: 768px) {
    .video-item {
      /* display: flex; */
      align-items: center;
      justify-content: center;
      /* flex-direction: column; */
    }
    .video-player-container {
      width: 100%;
      height: 100%;
      position: relative;
    }
    .video-info {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 10px;
        z-index: 10; /* Cao hơn ảnh */
        padding-bottom: 90px; /* Chừa chỗ cho thanh điều hướng */
        background: linear-gradient(to top, transparent 0%, rgb(0 0 0 / 32%) 100%, rgba(0, 0, 0, 0.2) 40%);
        color: #fff;
        pointer-events: none; /* Click xuyên qua vùng trống */
    }
  }
  /* .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    pointer-events: none;
    background: linear-gradient(
      transparent 60%,
      rgba(0, 0, 0, 0.3) 80%,
      rgba(0, 0, 0, 0.6) 100%
    );
  } */
  .video-info {
    position: absolute;
    bottom: 80px;
    z-index: 50;
    padding: 10px;
    background: linear-gradient(to top, transparent 0%, rgb(0 0 0 / 32%) 100%, rgba(0, 0, 0, 0.2) 40%);
    color: #fff;
    border-radius: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    backdrop-filter: none;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(0);
  }
  .video-info.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
  }
  .video-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-height: none;
    transition: opacity 0.3s ease;
  }
  .video-description {
    font-size: 13px;
    line-height: 1.3;
    opacity: 0.9;
    max-height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  }
  .video-controls {
    position: absolute;
    right: 20px;
    bottom: 100px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  .control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  .control-btn:hover {
    opacity: 0.8;
  }
  .video-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 30;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
  }
  .loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 30;
    color: #fff;
    font-size: 16px;
    text-align: center;
  }
  .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
  }
  @keyframes spin {
    from {
      transform: rotate(0);
    }
    to {
      transform: rotate(360deg);
    }
  }
  .video-error,
  .video-processing {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
  }
  .video-processing {
    background: linear-gradient(135deg, #1e3c72 0, #2a5298 100%);
  }
  .video-error {
    background: linear-gradient(135deg, #c94b4b 0, #4b134f 100%);
  }
  .video-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 0 0;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }
  .video-loading.hide {
    opacity: 0;
    pointer-events: none;
  }
  .video-loading-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
    text-align: center;
  }
  .loading-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
  }
  .loading-dot {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    animation: loadingPulse 1.4s ease-in-out infinite both;
  }
  .loading-dot:first-child {
    animation-delay: -0.32s;
  }
  .loading-dot:nth-child(2) {
    animation-delay: -0.16s;
  }
  .loading-dot:nth-child(3) {
    animation-delay: 0s;
  }
  @keyframes loadingPulse {
    0%,
    100%,
    80% {
      transform: scale(0.8);
      opacity: 0.5;
    }
    40% {
      transform: scale(1);
      opacity: 1;
    }
  }
  .loading-text {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin: 0;
  }
  .error-indicator,
  .processing-indicator {
    text-align: center;
    color: #fff;
    padding: 30px;
  }
  .error-indicator h3,
  .processing-indicator h3 {
    margin: 20px 0 10px 0;
    font-size: 22px;
    font-weight: 600;
  }
  .error-indicator p,
  .processing-indicator p {
    margin: 10px 0;
    font-size: 16px;
    opacity: 0.9;
  }
  .toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 280px;
    text-align: center;
    word-wrap: break-word;
  }
  .toast.show {
    opacity: 1;
  }
  @media (max-width: 768px) {
    body,
    html {
      height: 100vh;
      width: 100vw;
      position: fixed;
      overflow: hidden;
    }
    .tiktok-page-container {
      width: 100vw;
      height: 100vh;
      position: fixed;
      top: 0;
      left: 0;
    }
    .tiktok-video-container {
      height: 100vh;
      width: 100vw;
      position: relative;
      padding-bottom: 0;
      box-sizing: border-box;
    }
    .toast {
      top: env(safe-area-inset-top, 60px);
      max-width: calc(100vw - 40px);
      font-size: 14px;
    }
    #seek-feedback {
      top: env(safe-area-inset-top, 100px) !important;
      font-size: 13px !important;
      padding: 6px 12px !important;
      min-width: 50px !important;
    }
    .swipe-seek-feedback {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: rgba(0, 0, 0, 0.85);
      color: #fff;
      padding: 16px 24px;
      border-radius: 25px;
      font-size: 14px;
      font-weight: 600;
      z-index: 1001;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
      backdrop-filter: blur(15px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 0, 80, 0.2);
      pointer-events: none;
      white-space: nowrap;
      text-align: center;
      min-width: 240px;
    }
    .swipe-seek-instruction {
      color: rgba(255, 255, 255, 0.8);
      font-size: 12px;
      font-weight: 500;
      margin-bottom: 8px;
      letter-spacing: 0.5px;
      opacity: 0.9;
    }
    .swipe-seek-feedback.show {
      opacity: 1;
      visibility: visible;
    }
    .swipe-seek-progress {
      margin-top: 8px;
      width: 200px;
      height: 3px;
      background: rgba(255, 255, 255, 0.3);
      border-radius: 999px;
      overflow: hidden;
    }
    .swipe-seek-progress-bar {
      height: 100%;
      background: linear-gradient(90deg, #ff0050 0, #ff6b9d 50%, #ff4081 100%);
      border-radius: 999px;
      width: 0%;
      transition: width 50ms ease-out;
      box-shadow: 0 0 10px rgba(255, 0, 80, 0.6);
      position: relative;
    }
    .swipe-seek-progress-bar::after {
      content: "";
      position: absolute;
      right: -2px;
      top: 50%;
      transform: translateY(-50%);
      width: 8px;
      height: 8px;
      background: #fff;
      border-radius: 50%;
      box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    }
    .video-info {
      position: absolute;
      bottom: 80px;
      background: 0 0;
      padding: 10px;
      border-radius: 0;
      z-index: 50;
      color: #fff;
      opacity: 1;
      transition: opacity 0.3s ease;
      background: linear-gradient(to top, transparent 0%, rgb(0 0 0 / 32%) 100%, rgba(0, 0, 0, 0.2) 40%);
    }
    .video-title {
      font-size: 16px;
      margin-bottom: 6px;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      font-weight: 600;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
      color: #fff;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .video-description {
      font-size: 14px;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      max-height: 36px;
      opacity: 0.9;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
      color: #fff;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .video-header {
      top: calc(env(safe-area-inset-top, 15px));
      left: 16px;
      right: 16px;
    }
    .video-close-btn,
    .video-control-btn {
      width: 44px;
      height: 44px;
      font-size: 18px;
      background: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(10px);
    }
    .video-controls {
      right: 16px;
      bottom: 180px;
      gap: 20px;
    }
    .control-btn {
      width: 50px;
      height: 50px;
      font-size: 20px;
      background: rgba(255, 255, 255, 0.15);
      backdrop-filter: blur(10px);
    }
    .like-controls,
    .share-controls {
      right: 0;
      top: 50%;
    }
    .navigation-controls {
      left: 0;
      top: 50%;
      transform: translateY(-50%);
    }
  }
  .history-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  .history-panel-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  .history-panel {
    position: fixed;
    right: -100%;
    top: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 200;
    transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
  }
  .history-panel.active {
    right: 0;
  }
  @media (min-width: 769px) {
    .history-panel {
      width: 100%;
      max-width: 400px;
    }
  }
  .history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
  }
  .history-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 18px;
  }
  .history-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 400;
  }
  .history-panel-actions {
    display: flex;
    gap: 10px;
  }
  .history-clear-btn,
  .history-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
  }
  .history-clear-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    transform: scale(1.05);
  }
  .history-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
  }
  .history-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    max-height: calc(100vh - 120px);
    min-height: 0;
  }
  .history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 40px 20px;
  }
  .history-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
  }
  .history-empty p {
    font-size: 18px;
    margin: 0 0 8px 0;
  }
  .history-empty small {
    font-size: 14px;
    opacity: 0.7;
  }
  .history-list {
    padding: 10px 0;
  }
  .history-pagination {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
  }
  .history-pagination-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
  }
  .history-pagination-controls {
    display: flex;
    gap: 8px;
  }
  .history-pagination-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .history-pagination-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.05);
  }
  .history-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
  }
  .history-pagination-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    transform: none;
  }
  .history-panel-content::-webkit-scrollbar {
    width: 6px;
  }
  .history-panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
  }
  .history-panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
  }
  .history-panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
  }
  .history-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .history-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }
  .history-item-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 15px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
  }
  .history-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .history-item-thumbnail .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
  }
  .history-item-info {
    flex: 1;
    min-width: 0;
  }
  .history-item-title {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
  }
  .history-item-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
  }
  .history-item-remove {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    margin-left: 10px;
    flex-shrink: 0;
    font-size: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .history-item-remove:hover {
    background: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    transform: scale(1.1);
  }
  @media (max-width: 768px) {
    .history-panel {
      width: 100vw !important;
      max-width: none !important;
      right: -100vw !important;
      left: auto;
      border-left: none;
      transform: translateX(0);
    }
    .history-panel.active {
      right: 0 !important;
      transform: translateX(0);
    }
    .history-panel-content {
      max-height: calc(100vh - 70px) !important;
    }
    .history-item-thumbnail {
      width: 70px;
      height: 50px;
      margin-right: 12px;
    }
    .history-item-title {
      font-size: 13px;
    }
    .history-item-time {
      font-size: 11px;
    }
  }
  .bottom-nav-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 0 20px;
    box-sizing: border-box;
  }
  .nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: 400px;
    gap: 20px;
  }
  .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    min-width: 80px;
    border: none;
    background: 0 0;
    font-family: inherit;
  }
  .nav-item.active,
  .nav-item:hover {
    color: #fff;
    transform: translateY(-2px);
  }
  .nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
  }
  .nav-item span {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
  }
  .nav-item.active i,
  .nav-item:hover i {
    transform: scale(1.1);
  }
  .nav-item.active {
    animation: navPulse 0.3s ease;
  }
  @keyframes navPulse {
    0% {
      transform: scale(1) translateY(0);
    }
    50% {
      transform: scale(1.05) translateY(-3px);
    }
    100% {
      transform: scale(1) translateY(-2px);
    }
  }
  @media (max-width: 480px) {
    .bottom-nav-bar {
      height: 65px;
      padding: 0 15px;
    }
    .nav-items {
      gap: 15px;
    }
    .nav-item {
      min-width: 70px;
      padding: 6px 12px;
    }
    .nav-item i {
      font-size: 18px;
    }
    .nav-item span {
      font-size: 11px;
    }
  }
  #hud {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
  }
  #hud.show {
    opacity: 1;
    visibility: visible;
    animation: hudFadeIn 0.3s ease-out;
  }
  #hud.seeking {
    opacity: 1 !important;
    visibility: visible !important;
  }
  #hud.hiding {
    opacity: 0;
    visibility: hidden;
    animation: hudFadeOut 0.3s ease-in;
  }
  @keyframes hudFadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes hudFadeOut {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(10px);
    }
  }
  #hud.debug-show {
    opacity: 1 !important;
    visibility: visible !important;
    background: rgba(255, 0, 0, 0.1);
  }
  #progress-wrap {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--nav-h) + var(--safe));
    width: min(100vw, var(--video-col-w));
    padding: 0 12px;
    box-sizing: border-box;
    pointer-events: auto;
    height: 35px;
    display: flex;
    align-items: center;
    z-index: 102;
    cursor: pointer;
  }
  #progress-bg {
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    width: 100%;
    position: relative;
    transition: height 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }
  #progress-bar {
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #ff0050 0, #ff4081 100%);
    border-radius: 999px;
    transition: width 0.08s ease-out, height 0.2s ease, box-shadow 0.2s ease,
      transform 0.1s ease;
    box-shadow: 0 2px 6px rgba(255, 0, 80, 0.4);
    position: absolute;
    top: 0;
    left: 0;
    will-change: width, box-shadow;
  }
  #hud.seeking #progress-bg {
    height: 5px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
  #hud.seeking #progress-bar {
    height: 5px;
    background: #ff0050;
  }
  #progress-bar::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #ff0050 0, #ff4081 50%, #e91e63 100%);
    border: 2px solid rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 0, 80, 0.4), 0 0 0 0 rgba(255, 64, 129, 0.2),
      inset 0 1px 2px rgba(255, 255, 255, 0.3);
  }
  #hud.show #progress-bar::after {
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
    box-shadow: 0 2px 12px rgba(255, 0, 80, 0.5),
      0 0 0 3px rgba(255, 64, 129, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  }
  #hud.seeking #progress-bar::after {
    opacity: 1;
    transform: translateY(-50%) scale(1.25);
    box-shadow: 0 3px 16px rgba(255, 0, 80, 0.6),
      0 0 0 4px rgba(255, 64, 129, 0.25), inset 0 2px 3px rgba(255, 255, 255, 0.5);
  }
  @media (hover: hover) {
    #progress-wrap:hover #progress-bg {
      background: rgba(255, 255, 255, 0.4);
      height: 4px;
    }
    #progress-wrap:hover #progress-bar {
      height: 4px;
    }
    #progress-wrap:hover #progress-bar::after {
      opacity: 1;
      transform: translateY(-50%) scale(1.1);
      box-shadow: 0 2px 12px rgba(255, 0, 80, 0.5),
        0 0 0 3px rgba(255, 64, 129, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.4);
    }
  }
  @media (max-width: 768px) {
    #progress-wrap {
      height: 50px;
      z-index: 102;
      padding: 0 24px;
    }
    #progress-bg {
      height: 4px;
      background: rgba(255, 255, 255, 0.4);
    }
    #progress-bar {
      height: 4px;
    }
    #hud.seeking #progress-bg {
      height: 6px;
      background: rgba(255, 255, 255, 0.8);
    }
    #hud.seeking #progress-bar {
      height: 6px;
    }
    #progress-bar::after {
      width: 18px;
      height: 18px;
      right: -9px;
    }
  }
  .app-container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
  }
  .home-grid-container {
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
  }
  body.grid-mode #hud,
  body.grid-mode #progress-wrap {
    display: none !important;
  }
  .home-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .tab-navigation {
    display: flex;
    gap: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 6px;
    overflow: hidden;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  .tab-btn {
    background: 0 0;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    min-width: 100px;
    justify-content: center;
  }
  .tab-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
  }
  .tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
  }
  .tab-btn i {
    font-size: 12px;
  }
  .tab-btn.active i {
    color: #ff0050;
  }
  .home-title {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .home-title i {
    color: #ff0050;
  }
  .home-nav {
    display: flex;
    gap: 15px;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
  }
  .home-nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
  }
  .home-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
  }
  .mobile-home-nav {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 101;
    display: none;
    justify-content: center;
    align-items: center;
  }
  .mobile-home-nav .home-nav-link {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
    justify-content: center;
  }
  .mobile-home-nav .home-nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
  }
  .desktop-only {
    display: flex;
  }
  .tab-content {
    width: 100%;
    height: 100%;
  }
  .tab-panel {
    display: none;
    width: 100%;
    height: 100%;
  }
  .tab-panel.active {
    display: block;
  }
  .trending-container {
    padding: 60px 10px 100px 10px;
    max-width: 600px;
    margin: 0 auto;
  }
  .trending-header-info {
    text-align: center;
    margin-bottom: 30px;
  }
  .trending-header-info h2 {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
  }
  .trending-header-info p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
  }
  .trending-videos-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .trending-list-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
  }
  .trending-list-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  }
  .trending-rank-container {
    flex-shrink: 0;
  }
  .trending-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
  }
  .trending-rank.rank-1 {
    background: linear-gradient(45deg, gold, orange);
    border-color: gold;
    color: #000;
    font-size: 16px;
  }
  .trending-rank.rank-2 {
    background: linear-gradient(45deg, silver, #a0a0a0);
    border-color: silver;
    color: #000;
    font-size: 16px;
  }
  .trending-rank.rank-3 {
    background: linear-gradient(45deg, #cd7f32, sienna);
    border-color: #cd7f32;
    color: #fff;
    font-size: 16px;
  }
  .trending-video-info {
    flex: 1;
    display: flex;
    gap: 12px;
    align-items: center;
  }
  .trending-video-thumbnail {
    width: 80px;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  .trending-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    color: rgba(255, 255, 255, 0.5);
  }
  .trending-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 10px;
    opacity: 0.8;
  }
  .trending-video-details {
    flex: 1;
  }
  .trending-video-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
  .trending-video-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
  }
  .trending-video-stats {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .trending-likes {
    color: #ff0050;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .trending-status {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
  }
  .trending-status.success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
  }
  .trending-status.processing {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
  }
  .trending-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
  }
  .trending-arrow {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    flex-shrink: 0;
  }
  .trending-error,
  .trending-loading {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
  }
  .trending-error {
    color: #ef4444;
  }
  .trending-error i {
    font-size: 24px;
    margin-bottom: 12px;
  }
  .videos-grid {
    padding: 20px 10px 100px 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
  }
  .grid-video-item {
    aspect-ratio: 9/16;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    transition: transform 0.2s ease;
  }
  .grid-video-item:hover {
    transform: scale(1.02);
  }
  .grid-video-item:active {
    transform: scale(0.98);
  }
  .grid-video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111;
  }
  .grid-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      to bottom,
      transparent 50%,
      rgba(0, 0, 0, 0.7) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .grid-video-item:hover .grid-video-overlay {
    opacity: 1;
  }
  .grid-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
  }
  .grid-video-item:hover .grid-play-icon {
    opacity: 1;
  }
  .grid-video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0, transparent 100%);
  }
  .grid-video-title {
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  }
  .grid-video-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
  }
  .grid-video-stat {
    display: flex;
    align-items: center;
    gap: 3px;
  }
  .trending-section {
    grid-column: 1/-1;
    margin-bottom: 30px;
    padding: 0 10px;
  }
  .trending-header {
    text-align: center;
    margin-bottom: 20px;
  }
  .trending-header h2 {
    font-size: 2rem;
    margin: 0;
    color: #ff6b6b;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }
  .trending-subtitle {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
  }
  .trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    max-width: 1000px;
    margin: 0 auto;
  }
  .trending-video-item {
    position: relative;
    background: linear-gradient(135deg, #667eea 0, #764ba2 100%);
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    min-height: 180px;
    aspect-ratio: 16/9;
  }
  .trending-video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  }
  .trending-rank {
    top: 12px;
    left: 12px;
    background: #ff6b6b;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  }
  .trending-content {
    position: relative;
    height: 100%;
  }
  .trending-content .video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
  }
  .trending-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 25px 15px 15px;
    color: #fff;
  }
  .trending-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
  }
  .trending-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
  }
  .trending-stats .like-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
  }
  @media (max-width: 768px) {
    .trending-grid {
      grid-template-columns: 1fr;
      gap: 12px;
    }
    .trending-video-item {
      min-height: 160px;
    }
    .trending-header h2 {
      font-size: 1.5rem;
    }
    .trending-rank {
      padding: 5px 10px;
      font-size: 0.8rem;
    }
    .trending-title {
      font-size: 0.9rem;
    }
  }
  .grid-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    z-index: 50;
  }
  .close-video-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
  }
  .close-video-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
  }
  .close-video-btn:active {
    transform: scale(0.95);
  }
  .back-to-grid-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    height: 44px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 22px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
  }
  .back-to-grid-btn i {
    font-size: 16px;
  }
  .back-to-grid-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
  }
  .back-to-grid-btn:active {
    transform: scale(0.95);
  }
  @media (max-width: 768px) {
    .back-to-grid-btn {
      top: 15px;
      left: 15px;
      height: 40px;
      font-size: 13px;
      padding: 0 12px;
      gap: 6px;
    }
    .close-video-btn {
      top: 15px;
      right: 15px;
      width: 40px;
      height: 40px;
      font-size: 16px;
    }
    .videos-grid {
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 6px;
      padding: 30px 8px 100px 8px;
    }
    .home-header {
      height: 50px;
      padding: 0 15px;
    }
    .home-title {
      font-size: 18px;
    }
    .grid-video-title {
      font-size: 11px;
    }
    .grid-video-stats {
      font-size: 10px;
    }
    .close-video-btn {
      top: 15px;
      right: 15px;
      width: 40px;
      height: 40px;
      font-size: 16px;
    }
  }
  @media (min-width: 769px) and (max-width: 1024px) {
    .videos-grid {
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 10px;
    }
  }
  @media (min-width: 1025px) {
    .videos-grid {
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 12px;
    }
  }
  .search-container {
    padding: 15px 20px;
    background: 0 0;
    border-bottom: none;
  }
  .search-container.grid-search {
    width: 100%;
    max-width: 500px;
    z-index: 40;
    margin: 60px auto 0 auto;
    padding: 20px 20px 10px 20px;
    background: 0 0;
    box-shadow: none;
  }
  .search-input-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
  }
  .search-input {
    width: 100%;
    height: 44px;
    padding: 0 45px 0 45px;
    border: 2px solid #444;
    border-radius: 22px;
    font-size: 16px;
    background: #2a2a2a;
    color: #fff;
    transition: all 0.2s ease;
    outline: 0;
  }
  .search-input::placeholder {
    color: #888;
  }
  .search-input:focus {
    border-color: #ff0050;
    background: #333;
    box-shadow: 0 0 0 3px rgba(255, 0, 80, 0.2);
  }
  .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 16px;
    pointer-events: none;
  }
  .search-clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
  }
  .search-clear-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
  }
  .search-results-info {
    position: fixed;
    top: 144px;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border-bottom: 1px solid #444;
    z-index: 39;
    display: none;
  }
  .search-results-content {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-size: 14px;
  }
  .clear-search-btn {
    background: #ff0050;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .clear-search-btn:hover {
    background: #e6004a;
    transform: scale(1.05);
  }
  .video-player-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
  }
  .video-close-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }
  .video-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
  }
  .video-close-btn:active {
    transform: scale(0.95);
  }
  .video-player-header + .tiktok-video-container {
    margin-top: 50px;
    height: calc(100vh - 50px);
  }
  @media (max-width: 768px) {
    .video-player-header {
      height: 50px;
      padding: 0 15px;
    }
    .video-close-btn {
      width: 36px;
      height: 36px;
      font-size: 16px;
    }
    .video-player-header + .tiktok-video-container {
      margin-top: 50px;
      height: calc(100vh - 50px);
    }
    .search-container.grid-search {
      padding: 15px 12px 8px 12px;
      margin: 125px auto 0 auto;
    }
    .search-input {
      height: 38px;
      font-size: 14px;
      padding: 0 35px 0 35px;
    }
    .like-controls {
      top: 50%;
    }
    .navigation-controls {
      top: 50%;
    }
  }
  .grid-video-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    gap: 8px;
  }
  .grid-video-placeholder i {
    font-size: 24px;
    opacity: 0.8;
  }
  .grid-video-placeholder span {
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  @media (max-width: 768px) {
    .home-header {
      padding: 8px 16px;
      height: 70px;
      justify-content: center;
    }
    .tab-navigation {
      position: static;
      transform: none;
      padding: 8px;
      min-width: 280px;
      margin: 0 auto;
    }
    .tab-btn {
      padding: 12px 20px;
      font-size: 15px;
      min-width: 120px;
    }
    .tab-btn span {
      display: inline;
    }
    .tab-btn i {
      font-size: 16px;
    }
    .home-nav {
      display: none;
    }
    .mobile-home-nav {
      display: flex;
    }
    .desktop-only {
      display: none !important;
    }
    .home-header {
      top: 55px;
      height: 70px;
    }
    .trending-container {
      padding: 125px 12px 100px 12px;
    }
    .trending-header-info h2 {
      font-size: 20px;
    }
    .trending-list-item {
      padding: 16px;
      gap: 16px;
    }
    .trending-rank {
      width: 35px;
      height: 35px;
      font-size: 12px;
    }
    .trending-rank.rank-1,
    .trending-rank.rank-2,
    .trending-rank.rank-3 {
      font-size: 14px;
    }
    .trending-video-thumbnail {
      width: 70px;
      height: 95px;
    }
    .trending-video-title {
      font-size: 14px;
    }
    .trending-video-description {
      font-size: 12px;
    }
    .trending-likes {
      font-size: 11px;
    }
    .trending-status {
      font-size: 10px;
      padding: 1px 6px;
    }
  }
  .video-js {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #000 !important;
    font-family: inherit !important;
    display: block !important;
    visibility: visible !important;
    transform: none !important;
    z-index: 10 !important;
  }
  .video-js .vjs-tech,
  .video-js video {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    visibility: visible !important;
    z-index: 11 !important;
  }
  .video-js.vjs-fill .vjs-tech,
  .video-js.vjs-fill video {
    object-fit: contain !important;
    min-width: auto !important;
    min-height: auto !important;
  }
  .video-js .vjs-control-bar {
    display: none !important;
  }
  .video-js .vjs-big-play-button {
    display: none !important;
  }
  .video-js .vjs-loading-spinner {
    display: none !important;
  }
  .video-js .vjs-poster {
    display: none !important;
  }
  .video-js .vjs-menu-button .vjs-menu {
    display: none !important;
  }
  .video-js .vjs-fullscreen-control,
  .video-js .vjs-picture-in-picture-control,
  .video-js .vjs-play-control,
  .video-js .vjs-progress-control,
  .video-js .vjs-time-control,
  .video-js .vjs-volume-panel {
    display: none !important;
  }
  .video-js .vjs-overlay {
    display: none !important;
  }
  .video-js .vjs-modal-dialog {
    display: none !important;
  }
  .video-js,
  .video-js .vjs-tech {
    cursor: pointer !important;
  }
  .video-js.vjs-user-active .vjs-control-bar,
  .video-js.vjs-user-inactive .vjs-control-bar {
    display: none !important;
  }
  .video-player-container {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  .video-player-container .video-js ~ .video-player {
    display: none !important;
  }
  @media (max-width: 767px) {
    .video-js {
      width: 100vw !important;
      height: 100vh !important;
    }
  }
  @media (min-width: 768px) {
    .video-js {
      max-width: 405px !important;
      max-height: 100vh !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
    }
    .video-js .vjs-tech,
    .video-js video {
      min-width: auto !important;
      min-height: auto !important;
    }
  }
  .history-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
  }
  .history-modal {
    background: #1f1f1f;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.3s ease-out;
  }
  .history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #333;
    background: #252525;
  }
  .history-modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .history-close-btn {
    background: 0 0;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
  }
  .history-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  .history-modal-actions {
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    background: #252525;
  }
  .history-clear-btn {
    background: #ff4757;
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
  }
  .history-clear-btn:hover {
    background: #ff3838;
  }
  .history-modal-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
  }
  .history-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
  }
  .history-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }
  .history-item:last-child {
    border-bottom: none;
  }
  .history-item-thumbnail {
    position: relative;
    width: 60px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 16px;
  }
  .history-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .history-item-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
  }
  .history-item:hover .history-item-play {
    opacity: 1;
  }
  .history-item-info {
    flex: 1;
    min-width: 0;
  }
  .history-item-title {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .history-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .history-item-time {
    color: #888;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .history-item-remove {
    background: 0 0;
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    transform: scale(0.8);
  }
  .history-item:hover .history-item-remove {
    opacity: 1;
    transform: scale(1);
  }
  .history-item-remove:hover {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
  }
  .history-modal-content::-webkit-scrollbar {
    width: 6px;
  }
  .history-modal-content::-webkit-scrollbar-track {
    background: #2a2a2a;
  }
  .history-modal-content::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
  }
  .history-modal-content::-webkit-scrollbar-thumb:hover {
    background: #666;
  }
  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  @keyframes slideUp {
    from {
      transform: translateY(30px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  @media (max-width: 600px) {
    .history-modal {
      width: 95%;
      max-height: 85vh;
    }
    .history-modal-header {
      padding: 16px;
    }
    .history-modal-header h3 {
      font-size: 16px;
    }
    .history-modal-actions {
      padding: 12px 16px;
    }
    .history-item {
      padding: 12px 16px;
    }
    .history-item-thumbnail {
      width: 50px;
      height: 67px;
      margin-right: 12px;
    }
    .history-item-title {
      font-size: 13px;
    }
    .history-item-time {
      font-size: 11px;
    }
  }
  
  