/* Стили с добавлением буфера */ :root { --player-bg: #ffffff; --player-text: #333333; --accent-color: #007bff; --accent-hover: #0056b3; --progress-bg: #e0e0e0; --progress-fill: #007bff; --progress-buffer: rgba(0, 123, 255, 0.3); --playlist-item-bg: #f8f9fa; --playlist-item-hover: #e9ecef; --shadow: 0 4px 20px rgba(0,0,0,0.1); --border-radius: 12px; } .custom-audio-player { max-width: 900px; max-height: 900px; margin: 20px auto; background: var(--player-bg); border-radius: var(--border-radius); box-shadow: var(--shadow); overflow: hidden; font-family: 'Segoe UI', Roboto, system-ui, sans-serif; color: var(--player-text); display: flex; flex-direction: column; } .player-main { flex-shrink: 0; padding: 20px; border-bottom: 1px solid rgba(0,0,0,0.05); display: flex; flex-direction: column; align-items: center; } .track-info { margin-bottom: 12px; text-align: center; width: 100%; } .track-title { font-size: 1.2rem; font-weight: 600; margin: 0 0 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .track-artist { font-size: 0.9rem; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .player-controls { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; } .control-btn { background: none; border: none; font-size: 1.2rem; color: var(--player-text); cursor: pointer; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background 0.2s, color 0.2s; } .control-btn:hover { background: rgba(0,123,255,0.1); color: var(--accent-color); } .control-btn.active { color: var(--accent-color); } .play-btn { background: var(--accent-color); color: white; font-size: 1.6rem; width: 50px; height: 50px; } .play-btn:hover { background: var(--accent-hover); color: white; transform: scale(1.05); } .progress-area { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.85rem; flex-wrap: wrap; width: 100%; } .progress-bar { flex: 0 1 300px; min-width: 150px; height: 6px; background: var(--progress-bg); border-radius: 10px; cursor: pointer; position: relative; overflow: hidden; } .progress-buffer { position: absolute; height: 100%; background: var(--progress-buffer); width: 0%; border-radius: 10px; transition: width 0.1s linear; z-index: 1; } .progress-fill { position: absolute; width: 0%; height: 100%; background: var(--progress-fill); border-radius: 10px; transition: width 0.1s linear; z-index: 2; } .time-current, .time-duration { min-width: 40px; text-align: center; } .volume-control { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; } .volume-btn { background: none; border: none; font-size: 1.2rem; color: var(--player-text); cursor: pointer; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; } .volume-slider { width: 80px; height: 4px; -webkit-appearance: none; background: var(--progress-bg); border-radius: 2px; outline: none; } .volume-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: var(--accent-color); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2); } .playlist { flex: 1; overflow-y: auto; background: var(--playlist-item-bg); display: block; border-top: 1px solid rgba(0,0,0,0.05); } .playlist-item { display: flex; align-items: center; padding: 12px 20px; cursor: pointer; transition: background 0.2s; border-bottom: 1px solid rgba(0,0,0,0.03); gap: 10px; } .playlist-item:hover { background: var(--playlist-item-hover); } .playlist-item.active { background: rgba(0,123,255,0.1); border-left: 4px solid var(--accent-color); } .playlist-item-info { flex: 1; min-width: 0; } .playlist-item-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .playlist-item-artist { font-size: 0.8rem; opacity: 0.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .playlist-item-duration { font-size: 0.8rem; opacity: 0.5; min-width: 45px; text-align: right; flex-shrink: 0; } /* Адаптация для мобильных устройств */ @media (max-width: 700px) { .progress-bar { flex: 0 1 250px; } .player-controls { gap: 5px; } } @media (max-width: 480px) { .playlist-item { padding: 10px 12px; } .playlist-item-duration { font-size: 0.7rem; min-width: 35px; } .control-btn { width: 36px; height: 36px; font-size: 1rem; } .play-btn { width: 44px; height: 44px; font-size: 1.4rem; } .volume-slider { width: 60px; } /* ИСПРАВЛЕНИЕ: элементы времени не переносятся под прогресс-бар */ .progress-area { flex-wrap: nowrap; justify-content: space-between; } .time-current, .time-duration { white-space: nowrap; flex-shrink: 0; } .progress-bar { flex: 1 1 auto; min-width: 100px; } } /* ДОПОЛНИТЕЛЬНАЯ ЗАЩИТА для очень узких экранов */ @media (max-width: 360px) { .progress-area { flex-wrap: wrap; justify-content: center; } .time-current, .time-duration { min-width: 30px; } .progress-bar { order: 2; width: 100%; flex: 0 0 100%; margin: 5px 0; } }