.mmp {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: none;
    flex-direction: column;
    z-index: 9999;
    background: var(--bg);
    border: 1px solid var(--button-text);
    border-radius: 0.4em;
    padding: 0.2em;
    box-sizing: border-box;
    backdrop-filter: blur(30px);
    box-shadow: 0px -4px 7px 0px #0000006b;
    --mmp-button-height: var(--mmp-custom-height, 4vw);
    gap: 0.5em;
}

.mmp-media {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.mmp-header {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 0;
    /*position: relative;*/
     /*padding: 0.2em 0;*/
}

.mmp-time {
    font-size: 0.8em;
    min-width: 5em;
    text-align: center;
    color: var(--button-text);
    flex-shrink: 0;
    padding: 0;
    margin-right: 0.3em;
    line-height: 1.2;
    /*height: 100%;*/
    border: 1px solid var(--faint-contrast);
    border-radius: 0.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5em;
}

.mmp-title-container {
    flex-grow: 1;
    min-width: 0;
    height: auto;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin: 0;
    line-height: 1.2;
    justify-content: center;
}

.mmp-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9em;
    padding: 0;
    line-height: inherit;
}

.mmp-header-controls {
    display: flex;
    align-items: center;
    gap: 0.8em;
}

.mmp-volume-control {
    display: flex;
    align-items: center;
    gap: 0.1em;
    padding: 0.1em;

}

.mmp-vol-down,
.mmp-vol-up {
    width: 1.5em;
    height: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--button-text);
    cursor: pointer;
    font-size: 1em;
}

.mmp-volume-value {
    min-width: 3em;
    text-align: center;
    font-size: 1em;
}

.mmp-close {
    width: 1.5em;
    height: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--button-text);
    border-radius: 0.3em;
    color: var(--button-text);
    cursor: pointer;
    font-size: 1em;
}

.mmp-progress-container {
    border: 1px solid var(--button-text);
    border-radius: 0.25em;
    padding: 0.5em;
    margin-bottom: 0.5em;
}

.mmp-progress-bar {
    flex-grow: 1;
    height: 0.5em;
    cursor: pointer;
    background: var(--faint-contrast);
    border-radius: 0.25em;
    appearance: none;
    width: 100%;
}

.mmp-progress-bar::-webkit-slider-thumb {
    appearance: none;
    width: 3px;
    height: 1.8em;
    background: var(--good-contrast);
    cursor: pointer;
    border-radius: 0;
    border: none;
}

.mmp-progress-bar::-moz-range-thumb {
    width: 3px;
    height: 1.8em;
    background: var(--button-text);
    cursor: pointer;
    border-radius: 0;
    border: none;
}

.mmp-progress-bar:hover::-webkit-slider-thumb {
    width: 3px;
    background: var(--button-text);
}

.mmp-progress-bar:hover::-moz-range-thumb {
    width: 3px;
    background: var(--button-text);
}

.mmp-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3em;
}

.mmp-buttons {
    display: flex;
    flex-grow: 1;
    align-items: center;
    justify-content: space-between;
    gap: 0.3em;
}

.mmp-playback-buttons {
    display: flex;
    flex-grow: 1;
    justify-content: space-between;
    min-width: 0;
    gap: 0.3em;
    height: var(--mmp-button-height);
    min-height: 30px;
}

.mmp-play-pause,
.mmp-prev, 
.mmp-next {
    flex: 1;
    min-width: 0;
    text-align: center;
    color: inherit;
    border: 1px solid var(--button-text);
    border-radius: 0.4em;
    height: var(--mmp-button-height);
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: clamp(1em, calc(var(--mmp-button-height) * 0.5), 1.8em);
    position: relative;
    overflow: hidden;
}

.mmp-play-pause.playing {
    color: var(--bg);
}

.mmp-play-pause.playing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--button-text);
    z-index: -1;
}

.mmp-custom-button {
    width: 10%;
    min-width: 40px;
    height: var(--mmp-button-height);
    min-height: 30px;
    color: inherit;
    border: 1px solid var(--button-text);
    border-radius: 0.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: clamp(1em, calc(var(--mmp-button-height) * 1.2), 1.2em);
    background: var(--bg);
}

button.mmp-play {
    background: none;
    cursor: pointer;
    padding: 0 0.5em;
    font-size: 0.9em;
    color: inherit;
}

.mmp button {
    transition: none;
    border: 1px solid var(--button-text);
}

.mmp button:hover {
    background-color: var(--button-bg);
    color: var(--button-text); 
    outline: none;
}

.mmp-audio-icon {
    cursor: pointer !important;
}

.mmp-audio-icon:hover {
    opacity: 0.8;
}

@media (orientation: portrait) {
    .mmp-header {
        justify-content: flex-start;
        gap: 0;
    }
    .mmp-time {
        margin-right: 0.1em;
        min-width: 4.5em;
    }
    .mmp-title {
        text-align: left;
    }
    .mmp-volume-control {
        display: none;
    }
}

@media (orientation: landscape) {
    .mmp-header {
        justify-content: center;
        padding: 0.2em 0;
    }
    .mmp-time {
        position: absolute;
        left: 0.5em;
        margin-right: 0;
    }
    .mmp-title-container {
        max-width: 60%;
    }
    .mmp-header-controls {
        position: absolute;
        right: 0.5em;
    }
}

@media (max-width: 200px) {
    .mmp {
        padding: 0.3em;


    }
    
    .mmp-header {
        padding: 0.1em 0;
    }
    
    .mmp-time {
        font-size: 0.7em;
        min-width: 4em;
    }
    
    .mmp-title {
        font-size: 0.8em;
    }
    
    .mmp-playback-buttons {
        height: 40px;
    }
    
    .mmp-custom-button {
        min-width: 35px;
    }
}
/* 在文件最后添加 */
@media (orientation: portrait) {
    .mmp-custom-button.hide-portrait {
        display: none !important;
    }
    
    .mmp-playback-buttons {
        justify-content: center !important;
    }
}