@php
    $w = "width: ". (isset($width) ? $width : 2) ."rem";
    $w2 = "width: calc(100% - " . (isset($width) ? $width : 2) ."rem)";
    $h = "height: ". ((isset($width) ? $width : 2) / 3 * 4) ."rem";
    $link = isset($link) ? $link : ''
@endphp
@if (isset($multi))
    @empty($prevent)
        @if($link === '')
            <a href="/detail?bid={{ book_hash_encode($book['bid']) }}">
        @else
            <a href="/{{$link}}?id={{ book_hash_encode($book['bid']) }}">
        @endif
    @endempty
    <dl class="x-book x-book--multi {{$class or ''}}">
        <dt class="x-book__coverbox" style="{{$w.';'.$h}}">
            @if ($book->cover)
                <img src="{{ $book->cover }}" class="x-book__cover" style="{{$w.';'.$h}}">
            @else
                <img src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/book/cover/loading.png" class="x-book__cover" style="{{$w.';'.$h}}">
            @endif
        </dt>
        <dd class="x-book__text--multi" style="{{$w2.';'.$h}}">
            {{ $slot }}
        </dd>
    </dl>
    @empty($prevent)
        </a>
    @endempty
@else
    @empty($prevent)
        @if($link === '')
            <a href="/detail?bid={{ book_hash_encode($book['bid'])}}">
        @else
            <a href="/{{$link}}?id={{$book[0]['book_id']}}">
        @endif
    @endempty
    <dl class="x-book {{$class or ''}}" style="{{$w}}">
        <dt class="x-book__coverbox">
        @if ($book['cover'])
            <img src="{{ $book['cover'] }}" class="x-book__cover" style="{{$w.';'.$h}}">
        @else
            <img src="https://yueduyun.oss-cn-hangzhou.aliyuncs.com/book/cover/loading.png" class="x-book__cover" style="{{$w.';'.$h}}">
        @endif
        @isset($shadow)
            {{ $shadow }}
        @endisset
        </dt>
        <dd class="x-book__text--normal">{{ $book['book_name'] }}</dd>
    </dl>
    @empty($prevent)
        </a>
    @endempty
@endif