/* ============================================
   Talego 作品详情播放页 — TapNow 风格
   ============================================ */

.wd-page {
    padding-top: var(--nav-h, 64px);
    min-height: 100vh;
    background: #000;
    overflow-x: hidden;
}

.wd-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    gap: 16px;
    color: rgba(255,255,255,.45);
    font-size: 14px;
}
.wd-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,.12);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: wdSpin .8s linear infinite;
}
@keyframes wdSpin { to { transform: rotate(360deg); } }

.wd-body {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0 60px;
    background: #000;
}

/* ============ 播放器 ============ */
.wd-player-section {
    background: #000;
    padding: 0;
}
.wd-player-wrap {
    position: relative;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    background: #000;
}

.wd-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}
.wd-video-container video,
.wd-video-container img,
.wd-fallback-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}
.wd-fallback-img,
.wd-no-media {
    position: absolute;
    inset: 0;
}
.wd-no-media {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

/* 返回按钮 */
.wd-back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 12;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.wd-back-btn:hover {
    background: rgba(0, 0, 0, 0.65);
}

/* 中央播放 */
.wd-center-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 8;
    cursor: pointer;
    padding-left: 4px;
    transition: transform 0.2s, opacity 0.2s;
}
.wd-center-play:hover {
    transform: translate(-50%, -50%) scale(1.06);
    background: rgba(255, 255, 255, 0.22);
}
.wd-center-play.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 控制栏 */
.wd-control-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    opacity: 1;
    transition: opacity 0.3s ease;
}
.wd-player-wrap.controls-hidden .wd-control-bar,
.wd-player-wrap.controls-hidden .wd-back-btn {
    opacity: 0;
    pointer-events: none;
}
.wd-player-wrap.controls-hidden .wd-center-play:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.wd-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.wd-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 进度条 */
.wd-progress-wrap {
    flex: 1;
    min-width: 0;
    padding: 8px 0;
}
.wd-progress-track {
    position: relative;
    height: 3px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 2px;
    cursor: pointer;
    transition: height 0.15s;
}
.wd-progress-track:hover {
    height: 5px;
}
.wd-progress-buffer {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.28);
    border-radius: inherit;
    pointer-events: none;
}
.wd-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: #3b82f6;
    border-radius: inherit;
    pointer-events: none;
}
.wd-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}
.wd-progress-track:hover .wd-progress-thumb {
    opacity: 1;
}

.wd-ctrl-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.wd-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    margin-right: 4px;
    min-width: 88px;
    text-align: right;
}

/* 画质菜单 */
.wd-quality-wrap {
    position: relative;
}
.wd-quality-menu {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    min-width: 140px;
    padding: 6px;
    background: rgba(26, 28, 35, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all 0.18s ease;
    z-index: 20;
}
.wd-quality-wrap.open .wd-quality-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.wd-quality-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.wd-quality-option:hover {
    background: rgba(255, 255, 255, 0.06);
}
.wd-quality-option.active {
    color: #fff;
}
.wd-quality-option.active::after {
    content: '✓';
    margin-left: auto;
    color: #3b82f6;
    font-size: 12px;
}

/* 音量 */
.wd-volume-wrap {
    position: relative;
}
.wd-volume-popup {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 8px;
    background: rgba(26, 28, 35, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.18s ease;
    z-index: 20;
}
.wd-volume-wrap.open .wd-volume-popup {
    opacity: 1;
    visibility: visible;
}
.wd-volume-slider {
    writing-mode: vertical-lr;
    direction: rtl;
    width: 4px;
    height: 80px;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.wd-volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}
.wd-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}

/* ============ 信息区 ============ */
.wd-info-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 24px;
    background: #000;
}
.wd-work-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 16px;
    color: #fff;
}
.wd-interact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.wd-author-col {
    display: flex;
    align-items: center;
    gap: 10px;
}
.wd-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.wd-author-name {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
}
.wd-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: all 0.15s;
}
.wd-follow-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}
.wd-follow-btn.followed {
    color: rgba(255, 255, 255, 0.45);
}

.wd-action-col {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.wd-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.15s;
}
.wd-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.wd-action-btn.active {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.1);
}

.wd-process-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #111;
    background: #fff;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}
.wd-process-btn:hover {
    opacity: 0.9;
}

/* ============ 推荐 ============ */
.wd-recommend-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 24px 48px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: #000;
}
.wd-section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
    color: #fff;
}
.wd-recommend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.wd-recommend-loading {
    text-align: center;
    padding: 24px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.wd-rec-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}
.wd-rec-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.12);
}
.wd-rec-thumb {
    aspect-ratio: 16 / 9;
    background: #111;
    position: relative;
    overflow: hidden;
}
.wd-rec-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wd-rec-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
}
.wd-rec-card:hover .wd-rec-play-overlay { opacity: 1; }
.wd-rec-play-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 3px;
}
.wd-rec-info { padding: 10px 12px; }
.wd-rec-title {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wd-rec-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}
.wd-rec-author {
    display: flex;
    align-items: center;
    gap: 4px;
}
.wd-rec-author-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 空状态 */
.wd-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 16px;
    color: rgba(255, 255, 255, 0.45);
    background: #000;
}
.wd-empty p { margin: 0; font-size: 14px; }
.wd-back-home {
    display: inline-flex;
    padding: 10px 24px;
    background: #fff;
    color: #111;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .wd-info-section,
    .wd-recommend-section {
        padding-left: 16px;
        padding-right: 16px;
    }
    .wd-interact-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .wd-action-col { width: 100%; }
    .wd-time { min-width: 72px; font-size: 11px; }
    .wd-quality-wrap { display: none; }
}

/* 分享成功 Toast */
.wd-share-toast {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 3000;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    min-width: 260px;
    background: rgba(26, 28, 35, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.25s ease;
}
.wd-share-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.wd-share-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wd-share-toast-title {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 2px;
}
.wd-share-toast-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}
.wd-action-btn.active svg {
    stroke: #3b82f6;
}
