/* ========================================
   Watch Page Styles - Complete Rewrite
   Version: 20260722g
   ======================================== */

/* =============================================
   Desktop Layout (>= 768px) - YouTube Style
   ============================================= */
@media (min-width: 768px) {

  /* === Two-Column Layout === */
  .watch-desktop {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    align-items: flex-start;
  }
  .watch-main {
    flex: 1;
    min-width: 0;
  }
  .watch-sidebar {
    width: 360px;
    flex-shrink: 0;
    position: sticky;
    top: 70px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  /* === Video Player (16:9) === */
  .watch-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
  }
  .watch-player .plyr {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
  }

  /* === Title === */
  .watch-title {
    font-size: 18px;
    font-weight: 700;
    margin: 10px 0 2px;
    line-height: 1.3;
    color: var(--text-color, #0f0f0f);
  }

  /* === Meta === */
  .watch-meta {
    font-size: 13px;
    color: var(--text-secondary, #606060);
    margin-bottom: 8px;
  }
  .watch-meta-dot { margin: 0 5px; }

  /* === Publisher Row === */
  .watch-publisher-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
  }
  .watch-publisher {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .watch-publisher-avatar img {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
  }
  .watch-publisher-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color, #0f0f0f);
    text-decoration: none;
  }
  .watch-publisher-name:hover { color: var(--main-color, #4c4eb5); }
  .watch-follow-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 18px;
    background: var(--main-color, #4c4eb5);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  .watch-follow-btn:hover { filter: brightness(0.9); }

  /* === Action Bar (统一按钮样式) === */
  .watch-action-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color, #e5e5e5);
    flex-wrap: wrap;
  }

  /* Override main stylesheet's btn-default stat-item styles */
  .watch-action-bar .btn.btn-default.stat-item,
  .watch-action-bar #like-button {
    background: var(--bg-secondary, #f2f2f2) !important;
    border: none !important;
    border-radius: 18px !important;
    padding: 6px 14px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--text-color, #0f0f0f) !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
  }
  .watch-action-bar .btn.btn-default.stat-item:hover,
  .watch-action-bar #like-button:hover {
    background: var(--border-color, #e0e0e0) !important;
  }
  .watch-action-bar .btn.btn-default.stat-item.active-like,
  .watch-action-bar #like-button .active-like {
    color: var(--main-color, #4c4eb5) !important;
  }

  /* Fix the stats container inside action bar */
  .watch-action-bar .stats {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .watch-action-bar .stats.buttons {
    display: inline-flex !important;
  }

  /* Override reaction box styles in watch page */
  .watch-action-bar .wo-reaction {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
  }
  .watch-action-bar .wo-reaction .like-btn {
    background: var(--bg-secondary, #f2f2f2) !important;
    border: none !important;
    border-radius: 18px !important;
    padding: 6px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
  }

  /* Comment / Share / Post buttons */
  .watch-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 6px 14px !important;
    border: none !important;
    border-radius: 18px !important;
    background: var(--bg-secondary, #f2f2f2) !important;
    color: var(--text-color, #0f0f0f) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
    text-decoration: none !important;
    white-space: nowrap !important;
  }
  .watch-action-btn:hover {
    background: var(--border-color, #e0e0e0) !important;
    color: var(--text-color, #0f0f0f) !important;
    text-decoration: none !important;
  }
  .watch-action-btn svg { flex-shrink: 0; }
  .watch-action-count { font-weight: 600; }
  .watch-action-label { font-weight: 600; }

  /* === Description === */
  .watch-description {
    font-size: 14px;
    background: var(--bg-secondary, #f2f2f2);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 10px 0;
  }
  .watch-description-text {
    max-height: 60px;
    overflow: hidden;
    line-height: 1.5;
    white-space: pre-line;
    word-break: break-word;
  }
  .watch-description-expanded { max-height: none; overflow: visible; }
  .watch-description-toggle {
    display: none;
    margin-top: 6px;
    background: none; border: none;
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary, #606060);
    cursor: pointer; padding: 0;
  }

  /* === Comments Section === */
  .watch-comments-section { margin-top: 12px; }
  .watch-comments-heading {
    font-size: 15px; font-weight: 700;
    margin: 0 0 12px;
    color: var(--text-color, #0f0f0f);
  }

  /* Comment input area */
  .watch-comments-section .comment-section { background: transparent; padding: 0; }
  .watch-comments-section .wow_lightbox_right {
    position: relative; width: 100%;
    display: flex; flex-flow: column;
  }
  .watch-comments-section .lightbox-post-footer.post-comments {
    padding: 0; margin-bottom: 10px;
  }
  .watch-comments-section .post-commet-textarea {
    display: flex; align-items: center; gap: 10px;
  }
  .watch-comments-section .post-commet-textarea img {
    width: 36px; height: 36px;
    border-radius: 50%; flex-shrink: 0; object-fit: cover;
  }
  .watch-comments-section .comment-textarea {
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 18px;
    padding: 8px 14px; font-size: 13px;
    resize: none; width: 100%;
  }
  .watch-comments-section .comment-textarea:focus {
    border-color: var(--main-color, #4c4eb5); outline: none;
  }

  /* Comment list */
  .watch-comments-section .comments-list { padding: 0; }
  .watch-comments-section .comment {
    display: flex; gap: 10px; margin: 8px 0;
  }
  .watch-comments-section .comment .avatar {
    width: 36px; height: 36px;
    border-radius: 50%; flex-shrink: 0; object-fit: cover;
  }
  .watch-comments-section .comment-body { flex: 1; min-width: 0; }

  /* Comment heading - 所有元素同行显示 */
  .watch-comments-section .comment-heading {
    border: 1px solid var(--border-color, #e4e4e4);
    border-radius: 8px; padding: 10px;
  }
  .watch-comments-section .comment-heading .user {
    display: inline !important;
    font-size: 14px; font-weight: 600;
    color: var(--text-color, #050505);
    margin: 0 !important;
  }
  .watch-comments-section .comment-heading .verified-color {
    display: inline !important;
    margin-left: 3px; font-size: 12px;
  }
  .watch-comments-section .comment-heading .time {
    display: inline !important;
    font-size: 12px; color: #aaa;
    margin: 0 0 0 6px !important;
  }
  .watch-comments-section .comment-heading .comment_edele_options {
    display: none;
  }
  .watch-comments-section .comment-heading .comment-text {
    font-size: 13px; color: var(--text-secondary, #777);
    margin-top: 4px; line-height: 1.4;
  }
  .watch-comments-section .comment-options {
    display: inline !important;
    font-size: 12px;
  }

  /* No comments */
  .watch-comments-section .lightbox-no-comments {
    text-align: center; padding: 40px 0 10px; color: #696969;
  }
  .watch-comments-section .lightbox-no-comments svg {
    width: 60px; height: 60px; filter: grayscale(1); opacity: 0.5;
  }
  .watch-comments-section .load-more-comments {
    color: #777; font-size: 13px; cursor: pointer; padding: 6px 0;
  }

  /* === Sidebar === */
  .watch_videos_next { padding: 0; }
  .wo_watch_up_next {
    font-size: 15px; font-weight: 700;
    margin: 0 0 10px; color: var(--text-color, #0f0f0f);
  }
  .wo_watch_next {
    display: flex; gap: 8px; padding: 6px 0;
    cursor: pointer; border-radius: 8px;
    transition: background 0.15s ease;
  }
  .wo_watch_next:hover { background: var(--bg-secondary, #f2f2f2); }
  .wo_watch_next .thumb {
    width: 160px; height: 90px;
    border-radius: 8px; overflow: hidden;
    flex-shrink: 0; background: #000;
  }
  .wo_watch_next .thumb video,
  .wo_watch_next .thumb .plyr {
    width: 100%; height: 100%; object-fit: cover;
  }
  .wo_watch_next .info { flex: 1; min-width: 0; }
  .wo_watch_next .info h5 {
    font-size: 13px; font-weight: 600;
    margin: 0 0 3px; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    color: var(--text-color, #0f0f0f);
  }
  .wo_watch_next .info .foot {
    font-size: 11px; color: var(--text-secondary, #606060);
  }
  .wo_watch_next .info .foot p { margin: 0 0 2px; }
  .wo_watch_next .info .foot h6 {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 400;
    color: var(--text-secondary, #606060); margin: 0;
  }
  .wo_watch_next .info .foot h6 .avatar {
    width: 18px; height: 18px; border-radius: 50%; object-fit: cover;
  }
}

/* =============================================
   Mobile Layout (< 768px)
   ============================================= */
@media (max-width: 767px) {

  body.watch-mobile-active { overflow: hidden; }
  body.watch-mobile-active #site-header,
  body.watch-mobile-active #site-footer,
  body.watch-mobile-active #site-sidebar,
  body.watch-mobile-active .site-header,
  body.watch-mobile-active .site-footer,
  body.watch-mobile-active .site-sidebar,
  body.watch-mobile-active .wo_page_content,
  body.watch-mobile-active header,
  body.watch-mobile-active .navbar,
  body.watch-mobile-active footer,
  body.watch-mobile-active .wo_footer_wrapper {
    display: none !important;
  }

  /* === Fullscreen Container === */
  .watch-mobile {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh; height: 100dvh;
    background: #000; overflow: hidden; z-index: 9999;
    -webkit-user-select: none; user-select: none;
  }

  /* === Slides === */
  .watch-mobile-slides { position: relative; width: 100%; height: 100%; }
  .watch-mobile-slide {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; display: none;
  }
  .watch-mobile-slide.active { display: block; }

  /* === Video === */
  .watch-mobile-video {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #000;
  }
  .watch-mobile-video video,
  .watch-mobile-video .wo_video_player {
    width: 100% !important; height: 100% !important;
    object-fit: contain; background: #000;
  }

  /* === Tap Zone === */
  .watch-mobile-tap-zone {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; z-index: 2;
  }

  /* === Pause Icon (no circle, just triangle) === */
  .watch-mobile-pause-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3; pointer-events: none;
    opacity: 0; transition: opacity 0.2s ease;
    /* No background circle */
    background: none !important;
    border-radius: 0 !important;
    width: auto; height: auto;
  }
  .watch-mobile-pause-icon.show,
  .watch-mobile-pause-icon.visible {
    opacity: 1;
  }
  .watch-mobile-pause-icon svg {
    width: 48px; height: 48px;
    fill: rgba(255,255,255,0.85);
  }

  /* === Back Button === */
  .watch-mobile-back {
    position: absolute;
    top: 12px; left: 12px;
    z-index: 10;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.35);
    border-radius: 50%; text-decoration: none;
    color: #fff;
  }

  /* === Bottom Info === */
  .watch-mobile-info {
    position: absolute;
    bottom: 0; left: 0; right: 70px;
    z-index: 5;
    padding: 40px 12px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
  }
  .watch-mobile-user-row {
    display: flex; align-items: center;
    gap: 8px; margin-bottom: 4px;
  }
  .watch-mobile-avatar-link { flex-shrink: 0; text-decoration: none; }
  .watch-mobile-avatar {
    width: 36px; height: 36px;
    border-radius: 50%; border: 2px solid #fff;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  }
  .watch-mobile-username {
    display: inline-block; color: #fff;
    font-weight: 700; font-size: 14px;
    text-decoration: none;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  }
  .watch-mobile-username .verified-color {
    margin-left: 3px; font-size: 12px;
  }
  .watch-mobile-caption-wrap { position: relative; }
  .watch-mobile-caption {
    color: #fff; font-size: 13px; line-height: 1.4;
    max-height: 20px; overflow: hidden;
    transition: max-height 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    word-break: break-word;
  }
  .watch-mobile-caption.expanded { max-height: 200px; }
  .watch-mobile-caption-toggle {
    display: none; background: none; border: none;
    color: rgba(255,255,255,0.8); font-size: 12px;
    padding: 2px 0; cursor: pointer;
  }
  .watch-mobile-caption-toggle.show { display: inline; }

  /* === Right-side Action Buttons === */
  .watch-mobile-actions {
    position: absolute;
    right: 8px; bottom: 80px;
    z-index: 5;
    display: flex; flex-direction: column;
    align-items: center; gap: 14px;
  }
  .watch-mobile-action-btn {
    display: flex; flex-direction: column;
    align-items: center; gap: 2px;
    background: none; border: none;
    padding: 0; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .watch-mobile-action-btn svg {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
  }
  .watch-mobile-action-count {
    color: #fff; font-size: 11px; font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  }
  .watch-mobile-post-link { text-decoration: none; }

  /* Like button states */
  .watch-mobile-like-btn.liked svg,
  .watch-mobile-like-btn.liked svg path {
    fill: #ff2d55 !important;
  }

  /* === Comment Panel === */
  .watch-mobile-comment-panel {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 55%;
    background: #fff;
    border-radius: 12px 12px 0 0;
    z-index: 20;
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }
  .watch-mobile-comment-panel.open,
  .watch-mobile-comment-panel.active {
    transform: translateY(0);
  }
  .watch-mobile-comment-header {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
  }
  .watch-mobile-comment-count {
    font-weight: 700; font-size: 14px; color: #222;
  }
  .watch-mobile-comment-close {
    background: none; border: none;
    padding: 4px; cursor: pointer; color: #666;
  }
  .watch-mobile-comment-list {
    flex: 1; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 16px;
  }

  /* Comment items (fixed avatar 28px) */
  .wm-comment-item {
    display: flex; gap: 8px; padding: 8px 0;
  }
  .wm-comment-item + .wm-comment-item {
    border-top: 1px solid #f0f0f0;
  }
  .wm-comment-avatar {
    width: 28px; height: 28px;
    border-radius: 50%; object-fit: cover; flex-shrink: 0;
  }
  .wm-comment-body { flex: 1; min-width: 0; }
  .wm-comment-name {
    font-weight: 600; font-size: 12px; color: #333; margin-bottom: 1px;
  }
  .wm-comment-text {
    font-size: 13px; color: #444; line-height: 1.4; word-break: break-word;
  }
  .wm-comment-time {
    font-size: 11px; color: #999; margin-top: 2px;
  }

  /* Comment form */
  .watch-mobile-comment-form {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    border-top: 1px solid #eee;
    flex-shrink: 0; background: #fff;
  }
  .watch-mobile-comment-form-avatar {
    width: 28px; height: 28px;
    border-radius: 50%; object-fit: cover; flex-shrink: 0;
  }
  .watch-mobile-comment-form input {
    flex: 1; border: 1px solid #ddd;
    border-radius: 18px; padding: 6px 12px;
    font-size: 13px; outline: none;
  }
  .watch-mobile-comment-form input:focus {
    border-color: var(--main-color, #4c4eb5);
  }
  .watch-mobile-comment-send {
    background: var(--main-color, #4c4eb5);
    border: none; color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
  }
  .watch-mobile-comment-empty {
    text-align: center; padding: 30px 16px;
    color: #999; font-size: 13px;
  }

  /* === Progress Bar (no transition, real-time) === */
  .watch-mobile-progress-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px; background: rgba(255,255,255,0.2);
    z-index: 8;
  }
  .watch-mobile-progress-bar-fill {
    height: 100%; background: #fff; width: 0%;
  }

  /* === Slide Transitions === */
  .watch-mobile-slide.slide-up {
    animation: watchSlideUp 0.35s ease forwards;
  }
  .watch-mobile-slide.slide-down {
    animation: watchSlideDown 0.35s ease forwards;
  }
  @keyframes watchSlideUp {
    from { transform: translateY(0); }
    to   { transform: translateY(-100%); }
  }
  @keyframes watchSlideDown {
    from { transform: translateY(0); }
    to   { transform: translateY(100%); }
  }

  /* === Double-tap Heart → Paw === */
  .watch-mobile-doubletap-heart {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 6; pointer-events: none;
    opacity: 0; transition: none;
  }
  .watch-mobile-doubletap-heart.animate {
    animation: watchDoubleTapPaw 0.8s ease forwards;
  }
  @keyframes watchDoubleTapPaw {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    15%  { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    30%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    70%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
  }

  /* === Scrollbar === */
  .watch-mobile-comment-list::-webkit-scrollbar { width: 3px; }
  .watch-mobile-comment-list::-webkit-scrollbar-thumb {
    background: #ccc; border-radius: 3px;
  }
}
