/* BiliParse 播放器样式 */
.biliparse-player {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 18px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-size: 14px;
}

.biliparse-player .bp-frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

.biliparse-player.bp-idle .bp-frame,
.biliparse-player.bp-loading-box .bp-frame,
.biliparse-player.bp-error-box .bp-frame {
    padding-top: 0;
}

.biliparse-player .bp-frame > iframe,
.biliparse-player .bp-frame > video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

.biliparse-player .bp-video {
    object-fit: contain;
}

/* 点击播放占位 */
.biliparse-player .bp-launcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 160px;
    padding: 40px 16px;
    border: 1px dashed rgba(255, 255, 255, .35);
    border-radius: 8px;
    background: linear-gradient(135deg, #1c1f24, #2b2f36);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

.biliparse-player .bp-launcher:hover {
    border-color: #fb7299;
}

.biliparse-player .bp-play-icon {
    width: 0;
    height: 0;
    border-left: 18px solid #fb7299;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
}

.biliparse-player .bp-loading {
    padding: 40px 16px;
    text-align: center;
    color: #bbb;
    background: #1c1f24;
    border: 1px dashed rgba(255, 255, 255, .2);
    border-radius: 8px;
}

/* 无 JS 时的降级链接 */
.biliparse-player .bp-fallback {
    display: block;
    padding: 40px 16px;
    text-align: center;
    color: #fb7299;
    background: #1c1f24;
    border: 1px dashed rgba(255, 114, 153, .4);
    border-radius: 8px;
    text-decoration: none;
}

.biliparse-player .bp-error {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding: 32px 16px;
    color: #ffb4c4;
    background: #2a1c22;
    border: 1px solid rgba(255, 114, 153, .4);
    border-radius: 8px;
}

.biliparse-player .bp-error .bp-link {
    color: #fb7299;
}

.biliparse-player .bp-note {
    margin-top: 6px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.5;
    color: #b99100;
    background: #fff8e6;
    border: 1px solid #f2e3b3;
    border-radius: 6px;
}

/* 加载动画 */
.biliparse-player .bp-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fb7299;
    border-radius: 50%;
    animation: bp-spin .9s linear infinite;
}

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

/* 控制条 */
.biliparse-player .bp-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #1c1f24;
    color: #ddd;
    font-size: 13px;
}

.biliparse-player .bp-spacer {
    flex: 1;
}

.biliparse-player .bp-cdn {
    font-size: 12px;
    color: #888;
    max-width: 34%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.biliparse-player .bp-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 55%;
}

.biliparse-player .bp-bar select,
.biliparse-player .bp-bar button {
    max-width: 160px;
    padding: 3px 6px;
    border: 1px solid #3a3f47;
    border-radius: 4px;
    background: #262a31;
    color: #ddd;
    font-size: 12px;
    cursor: pointer;
}

.biliparse-player .bp-bar button:hover {
    border-color: #fb7299;
    color: #fff;
}

@media (max-width: 640px) {
    .biliparse-player .bp-title { max-width: 40%; }
    .biliparse-player .bp-bar { flex-wrap: wrap; }
}

/* 封面态：解析完成后先展示 B 站封面，测速在页面空闲时后台进行 */
.biliparse-player .bp-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1;
}

.biliparse-player .bp-cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.biliparse-player .bp-cover-shade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .55));
}

.biliparse-player .bp-dur {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .62);
    color: #fff;
    font-size: 12px;
    line-height: 18px;
}

.biliparse-player .bp-cover-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 22px 9px 17px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 32px;
    background: rgba(20, 22, 26, .55);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.biliparse-player .bp-cover-play:hover {
    background: rgba(251, 114, 153, .88);
    border-color: #fb7299;
}

.biliparse-player .bp-cover-note {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    text-align: center;
    color: rgba(255, 255, 255, .92);
    font-size: 12px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
