:root {
    --dm-blue: #2f6bff;
    --dm-bg: #f5f6f8;
    --dm-text: #16181d;
    --dm-muted: #9aa0a6;
    --dm-font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--dm-bg);
    color: var(--dm-text);
    font-family: var(--dm-font);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 12px 10px 32px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
}

/* 顶部横幅：左小字 + 中间大标题 + 右小字 */
.topbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    padding: 16px 16px;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 48%, #7c3aed 100%);
    box-shadow: 0 6px 18px rgba(37, 99, 235, .28);
}

.topbar::after {
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 95% at 12% 0%, rgba(255, 255, 255, .3), transparent 58%);
    content: '';
    pointer-events: none;
}

.topbar__side {
    position: relative;
    z-index: 1;
    flex: 0 1 auto;
    align-self: flex-end;
    padding-bottom: 2px;
    color: rgba(255, 255, 255, .86);
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: .5px;
}

.topbar__side--right {
    text-align: right;
}

.topbar__title {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    overflow: hidden;
    padding: 0 4px;
    background: linear-gradient(180deg, #ffffff 8%, #ffe9a8 52%, #f0b64a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: "Ma Shan Zheng", "STXingkai", "华文行楷", "STLiti", "华文隶书", "KaiTi", "楷体", serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 3px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    -webkit-text-stroke: .5px rgba(96, 44, 0, .35);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .38));
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
    .topbar__title {
        color: #ffe9a8;
    }
}

@media (max-width: 360px) {
    .topbar {
        padding: 14px 12px;
    }

    .topbar__title {
        font-size: 23px;
        letter-spacing: 1px;
    }

    .topbar__side {
        font-size: 11px;
    }
}

.empty {
    padding: 80px 16px;
    color: var(--dm-muted);
    font-size: 14px;
    text-align: center;
}

.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* 封面：固定 3:4 画框，图片拉伸铺满，不裁剪不留边 */
.card__cover {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 10px;
    background: #eceef2;
}

.card__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.card__cover-none {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--dm-muted);
    font-size: 13px;
}

.card__badges {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    display: flex;
    gap: 4px;
}

.badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.5;
    color: #fff;
    white-space: nowrap;
}

.badge--year {
    background: var(--dm-blue);
}

.badge--status {
    background: rgba(0, 0, 0, .48);
}

.card__title {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.43;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card__tags {
    margin-top: 2px;
    overflow: hidden;
    color: var(--dm-muted);
    font-size: 12px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card__btn {
    display: block;
    margin-top: 8px;
    padding: 9px 10px;
    border-radius: 8px;
    background: var(--dm-blue);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: background .18s ease, transform .18s ease;
}

.card__btn:hover {
    background: #1f57e0;
}

.card__btn:active {
    transform: scale(.99);
}

/* 播放页 */
.play {
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: 36px;
}

.play__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.play__stage video {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 74vh;
    background: #000;
}

.play__empty {
    padding: 60px 16px;
    color: #9aa0a6;
    font-size: 14px;
    text-align: center;
    background: #000;
}

.play__info {
    padding: 14px 12px 0;
}

.play__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.play__tags {
    margin-top: 6px;
    color: var(--dm-muted);
    font-size: 12px;
}

.lead {
    margin: 16px 12px 0;
    padding: 14px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.lead__label {
    margin-bottom: 8px;
    color: #5b6470;
    font-size: 13px;
}

.lead__row {
    display: flex;
    gap: 8px;
}

.lead__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}

.lead__input:focus {
    border-color: var(--dm-blue);
}

.lead__btn {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--dm-blue);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.lead__btn:hover {
    background: #1f57e0;
}

.lead__msg {
    min-height: 18px;
    margin-top: 8px;
    color: #e5484d;
    font-size: 13px;
}

@media (max-width: 359px) {
    .card__title {
        font-size: 13px;
    }

    .lead__row {
        flex-wrap: wrap;
    }

    .lead__btn {
        flex: 1 1 100%;
    }
}

/* 首页底部浮层：蓝紫渐变，默认展开，下滑收起 */
.page-home {
    padding-bottom: 330px;
}

.leadbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    max-width: 720px;
    height: 32vh;
    min-height: 224px;
    max-height: 300px;
    margin: 0 auto;
    padding: 6px 16px calc(14px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    background: linear-gradient(160deg, #1d4ed8 0%, #3b82f6 46%, #7c3aed 100%);
    box-shadow: 0 -10px 30px rgba(30, 64, 175, .24);
    transition: transform .28s ease;
}

.leadbar::before {
    position: absolute;
    inset: 0;
    border-radius: 20px 20px 0 0;
    background: radial-gradient(120% 95% at 10% 0%, rgba(255, 255, 255, .26), transparent 60%);
    content: '';
    pointer-events: none;
}

.leadbar--collapsed {
    transform: translateY(calc(100% - 86px));
    cursor: pointer;
}

.leadbar__input,
.leadbar__btn,
.leadbar__msg {
    transition: opacity .2s ease;
}

.leadbar--collapsed .leadbar__input,
.leadbar--collapsed .leadbar__btn,
.leadbar--collapsed .leadbar__msg {
    opacity: 0;
}

.leadbar__handle {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 100%;
    height: 20px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.leadbar__handle::before {
    display: block;
    width: 44px;
    height: 4px;
    margin: 6px auto;
    border-radius: 2px;
    background: rgba(255, 255, 255, .55);
    content: '';
}

.leadbar__head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 2px 2px 10px;
}

.leadbar__title {
    background: linear-gradient(180deg, #ffffff 8%, #ffe9a8 52%, #f0b64a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: "Ma Shan Zheng", "STXingkai", "华文行楷", "KaiTi", "楷体", serif;
    font-size: 24px;
    line-height: 1.3;
    letter-spacing: 2px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3));
}

.leadbar__hint {
    color: rgba(255, 255, 255, .82);
    font-size: 12px;
    white-space: nowrap;
}

.leadbar__input {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    outline: none;
}

.leadbar__input::placeholder {
    color: rgba(255, 255, 255, .72);
}

.leadbar__input:focus {
    border-color: #ffe9a8;
    box-shadow: 0 0 0 3px rgba(255, 233, 168, .18);
}

.leadbar__btn {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 100%;
    height: 46px;
    margin-top: 12px;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffe9a8 0%, #f0b64a 100%);
    box-shadow: 0 6px 16px rgba(240, 182, 74, .32);
    color: #5a2b00;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    animation: leadbarPulse 2.6s ease-in-out infinite;
    transition: transform .18s ease;
}

/* 按钮上扫过的高光 */
.leadbar__btn::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 55%;
    height: 100%;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .8) 50%, rgba(255, 255, 255, 0) 100%);
    content: '';
    pointer-events: none;
    transform: translateX(-160%) skewX(-18deg);
    animation: leadbarShine 2.8s ease-in-out infinite;
}

.leadbar__btn:hover {
    transform: translateY(-1px);
}

.leadbar__btn:active {
    transform: translateY(0) scale(.99);
}

@keyframes leadbarShine {
    0% {
        transform: translateX(-160%) skewX(-18deg);
    }

    55%,
    100% {
        transform: translateX(280%) skewX(-18deg);
    }
}

@keyframes leadbarPulse {
    0%,
    100% {
        box-shadow: 0 6px 16px rgba(240, 182, 74, .32);
    }

    50% {
        box-shadow: 0 8px 26px rgba(255, 214, 120, .66);
    }
}

.leadbar__btn:disabled {
    opacity: .72;
    cursor: default;
}

.leadbar__msg {
    position: relative;
    z-index: 1;
    min-height: 16px;
    margin-top: 8px;
    color: #ffe9a8;
    font-size: 12px;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }

    .leadbar__btn,
    .leadbar__btn::after {
        animation: none !important;
    }
}
