/* ==========================================================================
   章节页播放器（/book/ting/{id}）
   样式对齐 pageplay.vue：深色卡片、#ea2c58 主色、内联 SVG 图标。
   独立成文件是为了不污染全站样式，也方便以后被别的页面复用。
   ========================================================================== */

.tp-card {
    position: relative;   /* 弹出面板的定位基准 */
    max-width: 420px;
    margin: 0 auto 18px;
    padding: 22px 20px 14px;
    border-radius: 16px;
    background: #0e0e12;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .30), 0 2px 10px rgba(0, 0, 0, .22);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.tp-cover-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.tp-cover {
    display: block;
    width: 200px;
    height: 200px;
    border-radius: 10px;
    object-fit: cover;
    background: #1a1a20;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .55);
}

.tp-info {
    text-align: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.tp-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    color: #fff;
    word-break: break-all;
}

.tp-sub {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: #8e8e93;
    word-break: break-all;
}

/* ---------- 进度 ---------- */
.tp-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 2px;
}

.tp-time {
    flex: 0 0 44px;
    font-size: 12px;
    line-height: 1;
    color: #8e8e93;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.tp-range {
    flex: 1 1 auto;
    min-width: 0;
    height: 3px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 2px;
    /* 已播部分用渐变填充，--tp-p 由 JS 在 timeupdate 里更新 */
    background: linear-gradient(to right,
        #ea2c58 0%, #ea2c58 var(--tp-p, 0%),
        #2a2a31 var(--tp-p, 0%), #2a2a31 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.tp-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #ea2c58;
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(234, 44, 88, .18);
}

.tp-range::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: 0;
    border-radius: 50%;
    background: #ea2c58;
    cursor: pointer;
}

/* ---------- 控制按钮 ---------- */
.tp-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0 12px;
}

.tp-btn,
.tp-play {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    outline: none;
}

.tp-btn:disabled {
    opacity: .32;
    cursor: default;
}

.tp-play {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ea2c58;
    box-shadow: 0 8px 22px rgba(234, 44, 88, .38);
    transition: transform .12s ease;
}

.tp-play:active {
    transform: scale(.96);
}

/* ---------- 图标（内联 SVG，避免额外请求 / 字体依赖） ---------- */
.tp-ico {
    display: block;
    width: 26px;
    height: 26px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.tp-play .tp-ico {
    width: 24px;
    height: 24px;
}

.tp-ico-prev {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 5v14' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M19 5.6L9.6 12 19 18.4z' fill='%23ffffff'/%3E%3C/svg%3E");
}

.tp-ico-next {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 5v14' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M5 5.6L14.4 12 5 18.4z' fill='%23ffffff'/%3E%3C/svg%3E");
}

.tp-ico-back15 {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='13.2' r='7.3' fill='none' stroke='%23ffffff' stroke-width='1.5'/%3E%3Cpath d='M8.6 3.2L6.2 5.6l2.4 2.4' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ctext x='12' y='16.2' font-size='7' font-weight='700' fill='%23ffffff' text-anchor='middle' font-family='Arial,Helvetica,sans-serif'%3E15%3C/text%3E%3C/svg%3E");
}

.tp-ico-fwd15 {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='13.2' r='7.3' fill='none' stroke='%23ffffff' stroke-width='1.5'/%3E%3Cpath d='M15.4 3.2L17.8 5.6l-2.4 2.4' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ctext x='12' y='16.2' font-size='7' font-weight='700' fill='%23ffffff' text-anchor='middle' font-family='Arial,Helvetica,sans-serif'%3E15%3C/text%3E%3C/svg%3E");
}

.tp-ico-play {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.4 5.4L19 12 8.4 18.6z' fill='%23ffffff'/%3E%3C/svg%3E");
}

.tp-ico-pause {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='7.6' y='5' width='3.6' height='14' rx='1.2' fill='%23ffffff'/%3E%3Crect x='12.8' y='5' width='3.6' height='14' rx='1.2' fill='%23ffffff'/%3E%3C/svg%3E");
}

/* ---------- 工具栏 ---------- */
.tp-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
}

/* 提示单独一行，避免和三个按钮挤在一起 */
.tp-hint-row {
    min-height: 16px;
    margin-top: 8px;
    text-align: center;
}

.tp-tool {
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    color: #d9d9de;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    outline: none;
}

.tp-tool:hover {
    background: rgba(255, 255, 255, .08);
}

.tp-hint {
    min-height: 14px;
    font-size: 12px;
    line-height: 1;
    color: #ea2c58;
}

/* ---------- 无音频可播时的占位 ---------- */
.tp-empty {
    max-width: 420px;
    margin: 0 auto;
    padding: 26px 20px;
    border-radius: 14px;
    background: #f6f6f8;
    color: #8a8a90;
    font-size: 14px;
    text-align: center;
}

@media (max-width: 767px) {
    .tp-card {
        max-width: none;
        margin-bottom: 14px;
        padding: 18px 16px 12px;
    }

    .tp-cover {
        width: 160px;
        height: 160px;
    }
}

/* ==========================================================================
   弹出面板（倍速 / 定时 / 片头片尾 共用）
   定位在卡片内部，不遮挡整页，视觉上也更像"播放器的一部分"
   ========================================================================== */

.tp-sheet {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: flex-end;
    border-radius: 16px;
    overflow: hidden;
}

/* hidden 属性要显式处理，否则会被上面的 display:flex 覆盖掉 */
.tp-sheet[hidden] {
    display: none;
}

.tp-sheet-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .55);
}

.tp-sheet-panel {
    position: relative;
    width: 100%;
    padding: 16px 18px 14px;
    background: #17171c;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .45);
}

.tp-sheet-title {
    margin-bottom: 12px;
    font-size: 13px;
    color: #8e8e93;
    text-align: center;
}

.tp-sheet-opts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.tp-opt {
    min-width: 64px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    color: #e6e6ea;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    outline: none;
}

.tp-opt:hover {
    background: rgba(255, 255, 255, .08);
}

.tp-opt.is-active {
    border-color: #ea2c58;
    background: rgba(234, 44, 88, .12);
    color: #ea2c58;
}

.tp-sheet-cancel {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 9px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: #b9b9c0;
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

/* 片头 / 片尾输入行 */
.tp-skip-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.tp-skip-row label {
    font-size: 13px;
    color: #b9b9c0;
}

.tp-num {
    width: 64px;
    padding: 7px 8px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    background: #0e0e12;
    color: #fff;
    font-size: 13px;
    text-align: center;
    outline: none;
}

.tp-sheet-save {
    display: block;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 10px;
    background: #ea2c58;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
