@charset "utf-8";
/* ============================================================================
 *  帝国CMS 在线试听播放器 · 样式
 *  配色跟随本站主题：主色 #EF8781，正文 #444，次要文字 #a1a0a0，边框 #f0f0f0
 *  全部类名以 .mp- 前缀，不污染页面原有样式
 * ========================================================================== */

.mp-player,
.mp-player * {
    box-sizing: border-box;
}

.mp-player {
    position: relative;
    display: block;
    margin: 0 0 18px;
    padding: 14px 16px 12px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
    color: #444;
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* 顶部一条主色细线，呼应站点主题色。
   左右对称渐变：中间 30%~70% 为实色主色，两端各自过渡到透明，
   视觉上从中间向两侧淡出（而不是原来只有右端淡出）。 */
.mp-player::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 14px;
    right: 14px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg,
        rgba(239, 135, 129, 0) 0%,
        #EF8781 30%,
        #EF8781 70%,
        rgba(239, 135, 129, 0) 100%);
}

/* 真正的 audio 元素：留在 DOM 里但不可见、不可点 */
.mp-audio {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    left: -9999px;
    top: auto;
}

/* ----------------------------- 顶部：封面 + 信息 + 播放键 ----------------------------- */
.mp-head {
    display: flex;
    align-items: center;
}

.mp-cover {
    position: relative;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    margin-right: 12px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #fdf4f3, #f8e7e5);
    border: 1px solid #f5f5f5;
}

.mp-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}

/* 方案B 模板里直接输出的那张真实封面 <img class="mp-srcimg>
   ——爬虫不执行 JS，只有写在 HTML 里的 img 它们才抓得到。
   JS 执行前按封面框的尺寸显示（不会突然弹一张大图）；
   脚本会把它搬进 .mp-cover，搬走后本规则不再命中，改由 .mp-cover img 接管。 */
.mp-player > img.mp-srcimg {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #f5f5f5;
    background: linear-gradient(135deg, #fdf4f3, #f8e7e5);
}

/* v1.5.0：推荐把上面那张图再套一层 <figure class="mp-figure"> + <figcaption>，
   图片就有了语义和说明文字（利于图片收录）。同样只在 JS 执行前生效：
   脚本启动后 figure 会被播放器界面整体替换掉，用户看不到多余的一行字。 */
.mp-player > figure.mp-figure {
    display: block;
    margin: 0;              /* 浏览器默认给 figure 加 1em 外边距，必须清掉 */
    padding: 0;
    width: 56px;
    font: inherit;
}

.mp-player > figure.mp-figure > img.mp-srcimg {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #f5f5f5;
    background: linear-gradient(135deg, #fdf4f3, #f8e7e5);
}

.mp-player > figure.mp-figure > figcaption {
    margin: 4px 0 0;
    width: 56px;
    color: #9b9b9b;
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
    /* 标题长就截断，完整文字仍在 HTML 里（蜘蛛照样读到） */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* v1.7.0：大图模式降级为可选项 —— figure 要同时加 mp-figure--lg 类才生效：
     <figure class="mp-figure mp-figure--lg"><img class="mp-srcimg mp-srcimg-lg" …>
   默认推荐的小图模式（v1.5.0 写法）完全不受这段影响：width/height 属性照样写
   封面真实像素（1200×675，蜘蛛按大图收录），显示尺寸由上面的 56px 规则兜住，
   蜘蛛读属性、用户看小图，互不干扰。 */
.mp-player > figure.mp-figure--lg {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.mp-player > figure.mp-figure--lg > img.mp-srcimg-lg {
    display: block;
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: 0 auto;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #f5f5f5;
    background: linear-gradient(135deg, #fdf4f3, #f8e7e5);
}

.mp-player > figure.mp-figure--lg > figcaption {
    width: auto;
    max-width: 600px;
    margin: 8px auto 0;
    font-size: 13px;
    color: #999;
    text-align: center;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* 只想让蜘蛛和读屏软件读到、不想在页面显示这行说明时，
   给 <figcaption> 加 class="mp-sr"（视觉隐藏，不是 display:none，
   display:none 的内容搜索引擎可能直接忽略）。 */
.mp-player > figure.mp-figure > figcaption.mp-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 没有封面时显示音符图标 */
.mp-cover.mp-cover--ico::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 26px 26px;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23EF8781'%3E%3Cpath d='M12 3v10.55A4 4 0 1014 17V7h4V3h-6z'/%3E%3C/svg%3E");
}

.mp-info {
    flex: 1 1 auto;
    min-width: 0;
}

.mp-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-sub {
    margin-top: 3px;
    font-size: 12px;
    color: #a1a0a0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mp-badge {
    display: inline-block;
    padding: 1px 7px;
    margin-right: 6px;
    border-radius: 10px;
    background: #fdf0ef;
    color: #EF8781;
    font-size: 11px;
    vertical-align: 1px;
}

/* 播放中的跳动小均衡器 */
.mp-eq {
    display: none;
    height: 10px;
    margin-right: 6px;
    vertical-align: -1px;
}

.mp-eq i {
    display: inline-block;
    width: 2px;
    height: 4px;
    margin-right: 2px;
    border-radius: 1px;
    background: #EF8781;
    animation: mp-eq .9s ease-in-out infinite;
}

.mp-eq i:nth-child(2) { animation-delay: .18s; }
.mp-eq i:nth-child(3) { animation-delay: .36s; }

@keyframes mp-eq {
    0%, 100% { height: 4px; }
    50% { height: 10px; }
}

.mp-player.is-playing .mp-eq {
    display: inline-block;
}

/* 主播放键 */
.mp-play {
    flex: 0 0 auto;
    position: relative;
    width: 44px;
    height: 44px;
    margin-left: 10px;
    border-radius: 50%;
    border: 0;
    background: #EF8781;
    color: #fff;
    cursor: pointer;
    outline: none;
    box-shadow: 0 2px 8px rgba(239, 135, 129, .35);
    transition: background .18s, transform .12s, box-shadow .18s;
}

.mp-play:hover {
    background: #e7746e;
    box-shadow: 0 3px 12px rgba(239, 135, 129, .45);
}

.mp-play:active {
    transform: scale(.94);
}

.mp-play svg {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    fill: currentColor;
}

.mp-play .mp-ico-pause { display: none; }
.mp-player.is-playing .mp-play .mp-ico-play { display: none; }
.mp-player.is-playing .mp-play .mp-ico-pause { display: block; }

/* 加载中：转圈 */
.mp-spin {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mp-spin .7s linear infinite;
}

.mp-player.is-loading .mp-spin { display: block; }
.mp-player.is-loading .mp-play svg { display: none; }

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

/* ----------------------------- 进度条 ----------------------------- */
.mp-bar {
    margin-top: 12px;
    padding: 6px 0;
    cursor: pointer;
    touch-action: none;
}

.mp-track {
    position: relative;
    height: 6px;
    border-radius: 6px;
    background: #f0f0f0;
    overflow: visible;
}

.mp-buf,
.mp-cur {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 6px;
}

.mp-buf {
    width: 0;
    background: #e4e4e4;
}

.mp-cur {
    width: 0;
    background: linear-gradient(90deg, #EF8781, #f6a49f);
}

.mp-thumb {
    position: absolute;
    left: 0;
    top: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #EF8781;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
    transition: transform .12s;
    pointer-events: none;
}

.mp-bar:hover .mp-thumb,
.mp-player.is-dragging .mp-thumb {
    transform: scale(1.18);
}

.mp-player.is-noseek .mp-bar {
    cursor: default;
}

/* ----------------------------- 底部：时间 + 工具 ----------------------------- */
.mp-foot {
    display: flex;
    align-items: center;
    margin-top: 2px;
    font-size: 12px;
    color: #a1a0a0;
}

.mp-time {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    letter-spacing: .2px;
}

.mp-time .mp-sep {
    margin: 0 4px;
    color: #d5d5d5;
}

.mp-foot .mp-sp {
    flex: 1 1 auto;
    min-width: 8px;
}

.mp-tools {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.mp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    min-width: 28px;
    padding: 0 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #919191;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    outline: none;
    transition: background .16s, color .16s;
}

.mp-btn:hover {
    background: #f7f7f7;
    color: #EF8781;
}

.mp-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.mp-btn.is-on {
    color: #EF8781;
    background: #fdf0ef;
}

.mp-btn .mp-ico-off { display: none; }
.mp-btn.is-muted .mp-ico-on { display: none; }
.mp-btn.is-muted .mp-ico-off { display: block; }

/* 音量：PC 常显（手机端由下面的媒体查询自动隐藏） */
.mp-vol {
    display: flex;
    align-items: center;
}

/* 可点区域 = 细条上下各留 10px 空白：视觉上仍是 4px 细条，但 24px 高度内都点得中。
   （padding 属于盒子自身，所以即便父层是 overflow:hidden，这块空白依然可点） */
.mp-volwrap {
    width: 64px;
    padding: 10px 0;
    overflow: visible;   /* 圆点 / 填充略微外溢时不被裁掉 */
}

/* ★ display:block 不能删！这里是 span，默认是行内元素，行内元素上的 width / height
   会被浏览器直接忽略 —— 少了这一行音量条就是 0 宽：轨道看不见、红色填充看不见、
   点击算出的比例恒为 0，表现就是「音量怎么调都无效」。 */
.mp-volbar {
    display: block;
    position: relative;
    width: 56px;
    height: 4px;
    margin: 0 4px;
    border-radius: 4px;
    background: #f0f0f0;
    cursor: pointer;
    touch-action: none;
}

.mp-volcur {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    border-radius: 4px;
    background: #EF8781;
}

.mp-volbar i {
    position: absolute;
    left: 100%;
    top: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #EF8781;
    pointer-events: none;
}

.mp-rate {
    min-width: 38px;
    font-variant-numeric: tabular-nums;
}

/* 出错提示 */
.mp-msg {
    display: none;
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    background: #fdf6f5;
    border: 1px solid #f7e3e1;
    color: #c0706a;
    font-size: 12px;
    line-height: 1.6;
}

.mp-player.is-error .mp-msg {
    display: block;
}

.mp-player.is-error .mp-bar,
.mp-player.is-error .mp-foot {
    opacity: .5;
    pointer-events: none;
}

.mp-player :focus-visible {
    outline: 2px solid #EF8781;
    outline-offset: 2px;
}

/* ============================= 自适应 ============================= */
@media (max-width: 767px) {
    .mp-player {
        padding: 12px 12px 10px;
        border-radius: 7px;
    }

    .mp-cover {
        width: 48px;
        height: 48px;
        margin-right: 10px;
        border-radius: 7px;
    }

    .mp-player > img.mp-srcimg {
        width: 48px;
        height: 48px;
        border-radius: 7px;
    }

    .mp-player > figure.mp-figure,
    .mp-player > figure.mp-figure > img.mp-srcimg {
        width: 48px;
    }

    .mp-player > figure.mp-figure > img.mp-srcimg {
        height: 48px;
        border-radius: 7px;
    }

    .mp-player > figure.mp-figure > figcaption {
        width: 48px;
        font-size: 11px;
    }

    /* v1.7.0 大图模式（可选项，figure 加 mp-figure--lg）：手机端撑满栏宽 */
    .mp-player > figure.mp-figure--lg {
        width: 100%;
        max-width: 100%;
    }

    .mp-player > figure.mp-figure--lg > img.mp-srcimg-lg {
        width: 100%;
        max-width: 100%;
        height: auto;
        border-radius: 6px;
    }

    .mp-player > figure.mp-figure--lg > figcaption {
        width: auto;
        max-width: 100%;
        margin: 6px auto 0;
        font-size: 12px;
    }

    .mp-cover.mp-cover--ico::after {
        width: 22px;
        height: 22px;
        margin: -11px 0 0 -11px;
        background-size: 22px 22px;
    }

    .mp-title {
        font-size: 14px;
    }

    .mp-play {
        width: 40px;
        height: 40px;
        margin-left: 8px;
    }

    .mp-play svg,
    .mp-spin {
        width: 16px;
        height: 16px;
        margin: -8px 0 0 -8px;
    }

    .mp-spin {
        border-width: 2px;
    }

    /* 手机上音量条自动隐藏（保留静音按钮），避免窄屏上操作别扭 */
    .mp-volwrap {
        width: 0;
        padding: 0;
        margin: 0;
    }
}

@media (max-width: 400px) {
    .mp-btn {
        padding: 0 4px;
    }

    .mp-rate {
        min-width: 32px;
    }
}
