body {
    margin: 0;
    overflow: hidden;
    background: #000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
}

canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1;
    outline: none;
}

.controls-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 25vw; /* 占据 1/4 宽度 */
    min-width: 320px;
    max-width: 450px;
    height: 100vh;
    background: rgba(15, 15, 15, 0.9);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    box-sizing: border-box;
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 隐藏状态 */
.controls-container.hidden {
    transform: translateX(-100%);
}

/* 屏幕左侧触发区域 */
.sidebar-trigger {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px; /* 触发宽度 */
    height: 100vh;
    z-index: 1000; /* 置于顶层 */
    background: transparent;
    pointer-events: auto;
}

.controls-container h2 {
    margin: 0 0 20px 0;
    font-weight: 300;
    font-size: 1.2rem;
    color: #00d4ff;
    text-align: left;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    padding-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.hint-text {
    font-size: 0.75rem;
    color: #888;
    font-weight: normal;
}
/* 标签布局容器 */
.tabs-wrapper {
    display: flex;
    gap: 15px;
    flex: 1; /* 占据父容器剩余的所有空间 */
    min-height: 0; /* 关键：允许子元素在 flex 容器中正确收缩/滚动 */
    overflow: hidden;
}

/* 标签导航 - 改为竖向 */
.tabs-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 8px;
    width: 60px;
    flex-shrink: 0;
    overflow-y: auto; /* 导航项多时也可滚动 */
}

.tabs-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: transparent !important;
    border: none !important;
    color: #888 !important;
    padding: 10px 8px !important;
    font-size: 0.85rem !important;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    border-radius: 4px !important;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.tab-btn input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    margin: 0;
    accent-color: #00d4ff;
}

.tab-btn.active {
    color: #00d4ff !important;
    background: rgba(0, 212, 255, 0.1) !important;
    border-right: 3px solid #00d4ff !important;
    border-bottom: none !important;
}

.tab-btn:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* 标签内容区 */
.tabs-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    height: 100%; /* 填充 wrapper 高度 */
}

.tabs-content::-webkit-scrollbar {
    width: 4px;
}

.tabs-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 按钮组样式优化 */
.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 5px;
}

.btn-group button {
    padding: 8px 5px;
    font-size: 0.8rem;
}

.control-group {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.control-group:last-child {
    border-bottom: none;
}

.control-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: #ddd;
}

input[type="range"] {
    width: 100%;
    cursor: pointer;
    height: 4px;
}

input[type="number"] {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #00d4ff;
    width: 65px;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 12px;
    outline: none;
    float: right;
}
button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}
button:hover { background: rgba(0, 212, 255, 0.3); border-color: #00d4ff; }
button.active { background: #00d4ff; color: black; border-color: #00d4ff; }
#color-picker { width: 100%; height: 30px; border: none; padding: 0; background: none; cursor: pointer; }
#status {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    z-index: 100;
    transition: opacity 0.3s;
}
#status.hidden {
    opacity: 0;
    pointer-events: none;
}
#video-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    z-index: 101;
    pointer-events: none;
    transition: opacity 0.3s;
}

#video-container.hidden {
    opacity: 0;
    pointer-events: none;
}

#skeleton-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* 镜像显示 */
}

/* 移除 #mic-permission 相关样式 */
