/* ============================================================
   sheet.css · 底部设置抽屉（数据驱动）+ 设置项行 + toggle
   背景系统（bokeh + accent bar + 玻璃底）复用自 demo_v5 的 .drawer
   ============================================================ */

/* ============ 蒙层 ============ */
.sheet-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
    transition: opacity 320ms ease;
    z-index: 25;
}

.sheet-mask.open {
    opacity: 1;
    pointer-events: auto;
}

/* 邀请抽屉上方的独立点击关闭区（邀请抽屉高 620px，手机高 844px） */
.invite-dismiss-zone {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: calc(100% - 620px);
    z-index: 29;
    display: none;
    cursor: pointer;
}

.invite-dismiss-zone.open {
    display: block;
}

/* ============ 抽屉本体（近黑玻璃 + 品牌色晕染） ============ */
.drawer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 16px 28px;
    z-index: 26;
    border-radius: 26px 26px 0 0;
    overflow: hidden;
    /* 兜底不透明底色：即使合成器丢帧，透出的也是实色而非后方视频，杜绝浮层背景闪烁透明。 */
    background-color: #0a090e;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 20%),
        radial-gradient(80% 40% at 50% 100%,
            color-mix(in srgb, var(--brand-2) 22%, transparent) 0%, transparent 60%),
        linear-gradient(180deg, rgb(24, 22, 32) 0%, rgb(10, 9, 14) 100%);
    border-top: 1px solid color-mix(in srgb, var(--brand-2) 40%, rgba(255, 255, 255, 0.15));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 0 60px color-mix(in srgb, var(--brand-2) 4%, transparent),
        0 -6px 32px color-mix(in srgb, var(--brand-2) 30%, transparent),
        0 -24px 80px rgba(0, 0, 0, 0.7);
    isolation: isolate;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
    transform: translate3d(0, 100%, 0);
    visibility: hidden;
    transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 320ms;
}

.drawer.open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0s;
}

/* 静态主题光斑：避免浮层停留期间持续重绘后方视频。 */
.drawer::before {
    content: '';
    position: absolute;
    inset: -20% -10%;
    background:
        radial-gradient(circle 180px at 15% 20%, color-mix(in srgb, var(--brand-2) 55%, transparent) 0%, transparent 100%),
        radial-gradient(circle 140px at 85% 15%, color-mix(in srgb, var(--brand-3) 50%, transparent) 0%, transparent 100%),
        radial-gradient(circle 60px at 50% 45%, color-mix(in srgb, var(--brand-1) 60%, transparent) 0%, transparent 100%),
        radial-gradient(circle 100px at 20% 85%, color-mix(in srgb, var(--brand-3) 40%, transparent) 0%, transparent 100%),
        radial-gradient(circle 120px at 90% 90%, color-mix(in srgb, var(--brand-2) 45%, transparent) 0%, transparent 100%);
    opacity: 0.58;
    pointer-events: none;
}

/* 顶部 accent bar */
.panel-accent-bar {
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        color-mix(in srgb, var(--brand-2) 90%, transparent) 30%,
        color-mix(in srgb, var(--brand-3) 90%, transparent) 70%,
        transparent 100%);
    box-shadow:
        0 0 16px color-mix(in srgb, var(--brand-2) 70%, transparent),
        0 2px 24px color-mix(in srgb, var(--brand-2) 45%, transparent);
    pointer-events: none;
    border-radius: 0 0 2px 2px;
    z-index: 2;
}

/* 拖拽 handle */
.drawer-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 auto 16px;
    position: relative;
    z-index: 1;
}

/* 抽屉标题 */
.drawer-title {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #fff;
    margin-bottom: 16px;
}

/* 抽屉主操作按钮：主播随机连线、观众申请连麦等场景共用。 */
.primary-action-button {
    height: 40px;
    padding: 0 16px;
    border: 1px solid color-mix(in srgb, var(--brand-2) 35%, rgba(255, 255, 255, 0.08));
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--brand-1) 82%, #121824),
        color-mix(in srgb, var(--brand-2) 68%, #172132));
    box-shadow: 0 7px 18px color-mix(in srgb, var(--brand-1) 20%, transparent);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform 140ms ease, filter 180ms ease, color 180ms ease,
        border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.primary-action-button:active {
    filter: brightness(1.08);
    transform: scale(0.98);
}

.primary-action-button.is-cancel {
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: none;
}

.primary-action-button:disabled {
    border-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: none;
    cursor: default;
}

/* ============ 设置项（圆形图标横排，数据驱动渲染进 #settingList，复用 demo_v5 的 .cap） ============ */
.setting-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.setting-group {
    min-width: 0;
}

.setting-group-title {
    margin: 0 4px 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* 默认（一行放得下，≤5 项）：水平平均分布。
   .multiline（>5 项、会换行）：每个占 20% 宽、左对齐从第一列排（第二行不居中）。 */
.setting-list {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    row-gap: 14px;
}

.setting-list.multiline {
    justify-content: flex-start;
}

/* 直播设置分组可使用四列或五列栅格；顶部按钮按基础设置的列线对齐。 */
.setting-list.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 0;
}

.setting-list.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 0;
}

.setting-list.grid-4 .cap,
.setting-list.grid-5 .cap {
    width: 100%;
}

/* 能力项：上圆形图标 + 下文案，竖向堆叠。
   一行模式下 flex:1 平分整行宽度（水平平均分布，5 个也能塞进一行不换行） */
.cap {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 4px;
    cursor: pointer;
    position: relative;
    transition: opacity 200ms ease;
}

/* 多行模式：每个固定占 1/5 宽，保证一行五列、第二行从第一列左起 */
.setting-list.multiline .cap {
    flex: 0 0 20%;
    max-width: 20%;
}

.cap:active {
    opacity: 0.65;
}

.cap.is-static {
    cursor: default;
}

.cap.is-static:active {
    opacity: 1;
}

/* 圆形图标块：默认深灰底 + 白描边图标，激活态品牌渐变光晕 + 蓝描边 */
.cap-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms ease;
}

/* active 态（toggle 开）：品牌渐变光晕 */
.cap.on .cap-icon {
    background:
        radial-gradient(circle at 30% 30%, var(--brand-glow-1), transparent 60%),
        radial-gradient(circle at 70% 70%, var(--brand-glow-2), transparent 60%),
        rgba(var(--brand-1-rgb), 0.22);
    box-shadow:
        0 0 0 1px var(--brand-glow-1),
        0 4px 16px var(--brand-shadow);
}

.cap svg {
    width: 22px;
    height: 22px;
    stroke: rgba(255, 255, 255, 0.9);
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cap.on svg {
    stroke: var(--brand-text-strong);
}

.cap svg .beauty-eye,
.cap svg .beauty-sparkle {
    fill: rgba(255, 255, 255, 0.9);
    stroke: none;
}

.cap-label {
    width: 100%;
    overflow: hidden;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cap.on .cap-label {
    color: var(--brand-text-soft);
}

/* ============ 音效设置（二级抽屉） ============ */
.sound-effect-sheet {
    z-index: 27;
    padding-bottom: 22px;
}

.sound-effect-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sound-control-card {
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
        rgba(0, 0, 0, 0.2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        0 5px 18px rgba(0, 0, 0, 0.16);
}

.sound-control-row {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sound-control-row + .sound-control-row {
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.sound-single-row .sound-control-row {
    min-height: 50px;
}

.sound-control-label {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.84);
    font-size: 12px;
    font-weight: 500;
}

.sound-switch {
    width: 42px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.24);
    cursor: pointer;
    position: relative;
    transition: background 180ms ease, box-shadow 180ms ease;
}

.sound-switch span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.34);
    transition: transform 190ms cubic-bezier(0.22, 0.82, 0.32, 1);
}

.sound-switch.is-on {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    box-shadow: 0 0 12px color-mix(in srgb, var(--brand-2) 30%, transparent);
}

.sound-switch.is-on span {
    transform: translateX(18px);
}

.sound-range-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.sound-range-wrap output {
    width: 27px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.sound-range {
    width: min(166px, 100%);
    height: 16px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}

.sound-range::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background:
        linear-gradient(90deg,
            var(--brand-1) 0%,
            var(--brand-2) var(--range-value),
            rgba(255, 255, 255, 0.13) var(--range-value),
            rgba(255, 255, 255, 0.13) 100%);
}

.sound-range::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    margin-top: -5px;
    border: 2px solid color-mix(in srgb, var(--brand-2) 70%, #fff);
    border-radius: 50%;
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-2) 45%, rgba(0, 0, 0, 0.4));
}

.sound-section {
    min-width: 0;
}

.sound-section-title {
    margin: 0 4px 7px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.sound-option-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 5px;
}

.sound-option {
    min-width: 0;
    padding: 0;
    border: 0;
    color: rgba(255, 255, 255, 0.68);
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.sound-option-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 140ms ease;
}

.sound-option:active .sound-option-icon {
    transform: scale(0.94);
}

.sound-option svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sound-option-label {
    display: block;
    overflow: hidden;
    font-size: 10.5px;
    line-height: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sound-option.is-selected {
    color: #fff;
}

.sound-option.is-selected .sound-option-icon {
    border-color: color-mix(in srgb, var(--brand-2) 72%, rgba(255, 255, 255, 0.15));
    background:
        radial-gradient(circle at 28% 24%, var(--brand-glow-1), transparent 68%),
        linear-gradient(145deg,
            color-mix(in srgb, var(--brand-1) 34%, rgba(255, 255, 255, 0.06)),
            color-mix(in srgb, var(--brand-2) 24%, rgba(0, 0, 0, 0.1)));
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--brand-3) 42%, rgba(255, 255, 255, 0.1)),
        0 5px 15px color-mix(in srgb, var(--brand-2) 23%, transparent);
}

/* ============ 清晰度面板（二级，参考 demo_v5）============
   单列列表：每行独占，左档位名、右选中勾选；选中态品牌渐变描边 + 浓底 */
#qualitySheet {
    /* 盖在主设置抽屉之上 */
    z-index: 27;
}

.quality-list {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quality-item {
    width: 100%;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.015) 100%),
        rgba(0, 0, 0, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.28);
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: inherit;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    letter-spacing: 1px;
    position: relative;
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease, transform 120ms ease, box-shadow 200ms ease;
}

.quality-item:not(.active):active {
    transform: scale(0.97);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
}

/* active 态：品牌渐变描边 + 品牌色浓底（主题切换自动跟随） */
.quality-item.active {
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--brand-2) 42%, transparent) 0%,
            color-mix(in srgb, var(--brand-1) 26%, transparent) 100%);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--brand-3) 55%, transparent),
        inset 0 -1px 0 color-mix(in srgb, var(--brand-1) 30%, transparent),
        0 4px 16px color-mix(in srgb, var(--brand-2) 40%, transparent);
}

.quality-item.active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1.5px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* 右侧勾选：仅选中态显示白色对勾 */
.quality-check {
    display: none;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.quality-item.active .quality-check {
    display: inline;
}
