/* 吉他社：网页音轨面板从工具栏右端向内展开，避免按钮靠右时裁掉混音控件。 */
#gtptab-2025 .at-player-right .dropdown-track .tracklist {
    box-sizing: border-box;
    max-width: calc(100vw - 24px);
    max-width: calc(100dvw - 24px);
    border-radius: 12px;
}

@media (min-width: 769px) {
    #gtptab-2025 .at-player-right .dropdown-track .tracklist {
        left: auto !important;
        right: 0;
        transform: none !important;
    }
}

/* 吉他社：窄屏桌面版也使用横向铺满的面板，播放栏上方留出安全区。 */
@media (max-width: 768px) {
    #gtptab-2025 .at-player-right .dropdown-track .tracklist {
        position: fixed !important;
        left: max(10px, env(safe-area-inset-left, 0px)) !important;
        right: max(10px, env(safe-area-inset-right, 0px)) !important;
        bottom: calc(var(--at-footer-h, 64px) + env(safe-area-inset-bottom, 0px) + 8px) !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        max-height: min(55vh, 480px) !important;
        max-height: min(55dvh, 480px) !important;
        transform: none !important;
    }

    #gtptab-2025 .at-more.open .at-more-menu .at-loop {
        display: inline-flex !important;
    }
}

/* 吉他社：常用图标与收纳按钮用同样的按钮尺寸；JS 按播放栏实际剩余空间摆放。 */
#gtptab-2025 .at-web-adaptive .at-player-left {
    min-width: 0;
}

#gtptab-2025 .at-web-adaptive .at-player-right {
    --at-web-action-size: 36px;
    --at-web-action-gap: 4px;
    gap: var(--at-web-action-gap);
    padding: 0;
}

/* 吉他社：无录音的全谱和付费预览不加载音频专用样式，公共播放栏仍须遵守按钮的隐藏状态。 */
#gtptab-2025 .at-backing-audio[hidden] {
    display: none !important;
}

/* 吉他社：波形与旁边的工具图标同尺寸，按钮保留完整点击区域，选中时沿用音源的高亮样式。 */
#gtptab-2025 .at-player-right > .at-backing-audio {
    box-sizing: border-box;
    width: var(--at-web-action-size, 36px);
    min-width: 0;
    height: var(--at-web-action-size, 36px);
    padding: 0;
}

#gtptab-2025 .at-backing-audio[aria-pressed="false"] {
    color: #147d83;
}

#gtptab-2025 .at-backing-audio svg {
    width: 16px;
    height: 16px;
    flex: none;
}

@media (any-pointer: coarse) {
    #gtptab-2025 .at-web-adaptive .at-player-right {
        --at-web-action-size: 44px;
    }
}

#gtptab-2025 .at-web-inline-actions:not([hidden]) {
    display: flex;
    order: 1;
    gap: var(--at-web-action-gap);
}

#gtptab-2025 .at-web-adaptive .at-player-right .at-more {
    display: block;
    position: relative;
}

#gtptab-2025 .at-web-adaptive .at-player-right .at-more[hidden] {
    display: none;
}

#gtptab-2025 .at-web-adaptive .at-web-inline-actions .at-more-item,
#gtptab-2025 .at-web-adaptive .at-player-right .at-more-toggle {
    display: inline-flex !important;
    width: var(--at-web-action-size);
    height: var(--at-web-action-size);
    padding: 0;
    box-sizing: border-box;
    justify-content: center;
}

#gtptab-2025 .at-web-inline-actions .at-more-item > span,
#gtptab-2025 .at-more-toggle > i {
    display: none;
}

/* 吉他社：三点不依赖主题图标字体，原按钮的无障碍名称继续保留。 */
#gtptab-2025 .at-more-toggle::after {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 -6px currentColor, 0 6px currentColor;
    forced-color-adjust: none;
}

#gtptab-2025 .at-web-adaptive .at-more .at-more-menu {
    position: absolute;
    inset: auto 0 calc(100% + 8px) auto;
    display: none !important;
    width: 176px;
    max-height: 70vh;
    max-height: 70dvh;
    margin: 0;
    padding: 8px;
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(24, 28, 36, .16);
    z-index: 2000;
}

#gtptab-2025 .at-web-adaptive .at-more.open .at-more-menu {
    display: grid !important;
}

#gtptab-2025 .at-web-adaptive .at-more-menu .at-more-item {
    display: inline-flex !important;
    width: 100%;
    min-height: var(--at-web-action-size);
    padding-inline: 10px;
    justify-content: flex-start;
}

#gtptab-2025 .at-web-adaptive .at-more-menu .at-more-item > span {
    display: inline;
}

#gtptab-2025.at-preview-mode .at-web-adaptive :is(.at-save-image, .at-print) {
    display: none !important;
}

/* 吉他社：悬浮反馈使用实际播放栏高度让位，菜单展开也不会被悬浮栏盖住。 */
html.jts-web-gtp-toolbar .rightbar {
    bottom: max(30px, calc(var(--jts-web-gtp-footer-height, 68px) + 12px));
    z-index: 9998;
}
