/* 首页推荐区 - 四格等宽，播放器高度 140px */
.article-featured-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

/* 后台关闭播放器时占位：保持四列栅格，文章宽度不变 */
.article-featured-grid .featured-media-player-slot.fmp-slot-empty {
    width: 100%;
    height: 140px;
    max-height: 140px;
    min-height: 140px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
}

.article-featured-grid .post.featured-post {
    height: 140px;
}

.article-featured-grid .featured-media-player {
    width: 100%;
    height: 140px;
    max-height: 140px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    padding: 0 6px 4px;
    border-radius: 16px;
    border: 1px solid rgba(42, 140, 255, 0.35);
    background: linear-gradient(145deg, #0c1628 0%, #0a1121 45%, #121a2e 100%);
    box-shadow: 0 12px 32px rgba(3, 11, 27, 0.28);
    color: #e8eef9;
    box-sizing: border-box;
    overflow: visible;
    position: relative;
    z-index: 5;
}

.fmp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.fmp-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* 音轨区：类目浮层覆盖在波形上方 */
.fmp-visual-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 54px;
    height: 54px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2px;
    border: 1px solid rgba(76, 201, 240, 0.15);
    box-shadow: inset 0 0 20px rgba(42, 140, 255, 0.08);
}

.fmp-mode-tabs {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    justify-content: flex-start;
    column-gap: 1em;
    row-gap: 2px;
    padding: 3px 4px 4px;
    margin: 0;
    background: linear-gradient(180deg, rgba(6, 10, 22, 0.82) 0%, rgba(6, 10, 22, 0.45) 65%, transparent 100%);
    box-sizing: border-box;
    text-align: left;
    pointer-events: none;
}

.fmp-mode-btn {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    line-height: 1.3;
    padding: 2px 5px;
    margin: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    min-width: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    pointer-events: auto;
}

.fmp-mode-btn:hover {
    color: #fff;
}

.fmp-mode-btn.is-active {
    background: linear-gradient(90deg, #2a8cff, #4cc9f0);
    color: #fff;
    font-weight: 600;
    text-shadow: none;
}

.fmp-visualizer {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 54px;
}

.fmp-text-view {
    position: absolute;
    inset: 0;
    padding: 18px 6px 4px;
    font-size: 10px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.88);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    z-index: 2;
}

.fmp-text-view.is-scrolling {
    white-space: pre-wrap;
    overflow-y: auto;
    text-overflow: clip;
}

.fmp-empty-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    padding: 16px 6px 4px;
    line-height: 1.3;
    z-index: 2;
}

.fmp-empty-hint[hidden],
.fmp-text-view[hidden] {
    display: none !important;
}

.fmp-track-meta {
    flex: 0 0 12px;
    height: 12px;
    margin-bottom: 1px;
    overflow: hidden;
}

.fmp-track-title {
    font-size: 10px;
    font-weight: 600;
    line-height: 12px;
    height: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fmp-progress {
    flex: 0 0 10px;
    height: 10px;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 2px;
}

.fmp-time {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    width: 26px;
    line-height: 10px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.fmp-time:last-child {
    text-align: right;
}

.fmp-seek {
    flex: 1;
    height: 3px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.fmp-seek:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.fmp-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4cc9f0;
    cursor: pointer;
}

.fmp-seek::-moz-range-thumb {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4cc9f0;
    border: none;
    cursor: pointer;
}

/* 底部控制栏：限制在 140px 容器内 */
.fmp-controls {
    flex: 0 0 22px;
    height: 22px;
    min-height: 22px;
    max-height: 22px;
    display: grid;
    grid-template-columns: 50px 1fr 24px;
    align-items: center;
    gap: 3px;
    position: relative;
    z-index: 6;
    overflow: visible;
    margin-bottom: 0;
}

.fmp-controls-left,
.fmp-controls-center {
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
}

.fmp-controls-center {
    justify-content: center;
    overflow: hidden;
}

.fmp-btn {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #e8eef9;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    padding: 0;
    transition: background 0.15s;
}

.fmp-btn:hover {
    background: rgba(42, 140, 255, 0.45);
}

.fmp-btn.is-active {
    background: rgba(42, 140, 255, 0.55);
    color: #fff;
    box-shadow: 0 0 6px rgba(76, 201, 240, 0.3);
}

.fmp-play-slot {
    position: relative;
    width: 22px;
    height: 20px;
    flex-shrink: 0;
}

.fmp-play-slot .fmp-btn-main {
    position: absolute;
    left: 50%;
    top: 50%;
    margin: 0;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    font-size: 10px;
}

.fmp-btn-main {
    background: linear-gradient(135deg, #2a8cff, #4cc9f0);
}

.fmp-btn-main:hover {
    background: linear-gradient(135deg, #3d9aff, #5dd4ff);
}

.fmp-icon-pause {
    opacity: 0;
    pointer-events: none;
}

.fmp-icon-play.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.fmp-icon-pause.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.fmp-icon-play {
    opacity: 1;
    pointer-events: auto;
}

.fmp-volume-wrap {
    position: relative;
    width: 22px;
    height: 20px;
    justify-self: end;
    z-index: 30;
    flex-shrink: 0;
}

.fmp-btn-vol {
    position: relative;
    z-index: 31;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    touch-action: manipulation;
}

.fmp-vol-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
}

.fmp-vol-icon {
    font-size: 11px;
    pointer-events: none;
}

.fmp-vol-muted-svg {
    display: none;
    color: #e8eef9;
}

.fmp-vol-icon-wrap.is-muted .fmp-vol-normal {
    display: none;
}

.fmp-vol-icon-wrap.is-muted .fmp-vol-muted-svg {
    display: block;
}

.fmp-btn-vol.is-muted {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.35);
}

.fmp-btn-vol.is-open {
    background: rgba(42, 140, 255, 0.55);
    color: #fff;
    border-color: rgba(76, 201, 240, 0.5);
}

/* 向上弹出音量条 */
.fmp-volume-popup {
    position: absolute;
    right: 0;
    bottom: calc(100% + 6px);
    width: 36px;
    height: 88px;
    padding: 8px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #1a2d4a 0%, #0f1a2e 100%);
    border: 1px solid rgba(76, 201, 240, 0.45);
    border-radius: 10px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45), 0 0 12px rgba(42, 140, 255, 0.25);
    z-index: 100;
    pointer-events: auto;
}

.fmp-volume-popup[hidden] {
    display: none !important;
}

.fmp-volume-popup.is-floating::after {
    display: none;
}

.fmp-volume-popup::after {
    content: '';
    position: absolute;
    right: 10px;
    bottom: -5px;
    width: 8px;
    height: 8px;
    background: #1a2d4a;
    border-right: 1px solid rgba(76, 201, 240, 0.35);
    border-bottom: 1px solid rgba(76, 201, 240, 0.35);
    transform: rotate(45deg);
}

.fmp-volume-slider-v {
    -webkit-appearance: slider-vertical;
    appearance: auto;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 8px;
    height: 72px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    accent-color: #4cc9f0;
}

.fmp-volume-slider-v::-webkit-slider-runnable-track {
    width: 4px;
    background: linear-gradient(180deg, rgba(76, 201, 240, 0.9), rgba(42, 140, 255, 0.35));
    border-radius: 2px;
}

.fmp-volume-slider-v::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(76, 201, 240, 0.95);
}

.fmp-volume-slider-v::-moz-range-track {
    width: 4px;
    background: linear-gradient(180deg, rgba(76, 201, 240, 0.9), rgba(42, 140, 255, 0.35));
    border-radius: 2px;
}

.fmp-volume-slider-v::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
}

@media (max-width: 1200px) {
    .article-featured-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .article-featured-grid .featured-media-player,
    .article-featured-grid .featured-media-player-slot {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .article-featured-grid .post.featured-post,
    .article-featured-grid .featured-media-player,
    .article-featured-grid .featured-media-player-slot.fmp-slot-empty {
        height: 150px;
        max-height: 150px;
        min-height: 150px;
    }

    .fmp-visual-wrap {
        min-height: 58px;
        height: 58px;
    }

    .fmp-visualizer {
        min-height: 58px;
    }
}
