/**
 * 音浪 - 样式文件
 * 响应式设计，支持 4 套主题
 */

/* CSS 变量 */
:root {
    --bg-color: #0a0a1a;
    --text-color: #ffffff;
    --accent-color: #ff006e;
    --spectrum-color: #8338ec;
    --toolbar-height: 60px;
    --spectrum-height: 60px;
    --transition-speed: 0.3s;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2a 100%);
    /* v6.0: 动态背景图支持 */
    background-image: var(--bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: overlay;
    transition: background-color var(--transition-speed) ease, background-image 0.5s ease;
    position: relative; /* 为伪元素定位 */
}

/* 背景遮罩，确保文字可读性 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* 轻微暗化 */
    z-index: -1;
    pointer-events: none;
}


/* 工具栏 */
.toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--toolbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--spectrum-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* v5.0: Zen Mode 播放按钮 */
.zen-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.zen-toggle-btn:hover {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.zen-toggle-btn:active {
    transform: scale(0.95);
}

.zen-toggle-btn.active {
    border-color: var(--accent-color);
    background: var(--accent-color);
    box-shadow: 0 0 20px rgba(255, 0, 110, 0.4);
}

.zen-toggle-btn.active::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: zen-pulse 2s ease-in-out infinite;
}

@keyframes zen-pulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.zen-icon {
    position: absolute;
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.zen-icon-play {
    opacity: 1;
    transform: scale(1);
    /* 视觉居中修正：播放三角形重心偏左，需要向右偏移 */
    margin-left: 2px;
}

.zen-icon-pause {
    opacity: 0;
    transform: scale(0.5);
}

.zen-toggle-btn.active .zen-icon-play {
    opacity: 0;
    transform: scale(0.5);
}

.zen-toggle-btn.active .zen-icon-pause {
    opacity: 1;
    transform: scale(1);
}

.toolbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-switcher {
    display: flex;
    gap: 8px;
}

.theme-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: transparent;
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    opacity: 0.7;
}

.theme-btn:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.4);
}

.theme-btn.active {
    opacity: 1;
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative; /* 为下拉菜单定位 */
}

/* 主画布容器 */
.canvas-container {
    position: fixed;
    top: var(--toolbar-height);
    left: 0;
    right: 0;
    bottom: var(--spectrum-height);
    overflow: hidden;
}

#visualCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* 引导覆盖层 */
.guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 50;
    pointer-events: none;
}

.guide-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.guide-content {
    text-align: center;
}

.guide-ripple {
    width: 100px;
    height: 100px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: guide-pulse 2s ease-out infinite;
}

@keyframes guide-pulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.guide-text {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.guide-subtext {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* 音符指示器 */
.note-indicator {
    position: absolute;
    padding: 4px 12px;
    background: var(--accent-color);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.2s ease;
    z-index: 60;
}

.note-indicator.visible {
    opacity: 1;
}

/* 频谱容器 */
.spectrum-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--spectrum-height);
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: env(safe-area-inset-bottom);
}

#spectrumCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 帮助弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
    z-index: 200;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px 40px;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: transform var(--transition-speed) ease;

    /* v6.1: 锁定设置面板配色，不随主题变化，确保可读性 */
    --text-color: #ffffff;
    --accent-color: #00b4d8; /* 固定使用青色，避免受外部主题影响 */
    color: #ffffff;

    /* v6.2: PC端高度限制 */
    max-height: 80vh;
    overflow-y: auto;
    
    /* v6.4: 奢华暖色体系 (Deep Espresso) - 提升高级感 */
    background: rgba(30, 26, 24, 0.96); /* 深咖/黑檀木色 */
    box-shadow: 0 30px 60px rgba(15, 10, 5, 0.6); /* 暖色投影 */
    border: 1px solid rgba(255, 245, 235, 0.08); /* 香槟色微边框 */
    backdrop-filter: blur(20px); /* 加强毛玻璃质感 */
    -webkit-backdrop-filter: blur(20px);
}

/* 自定义滚动条样式 - 暖色调 */
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 245, 235, 0.02);
}
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 245, 235, 0.15);
    border-radius: 3px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 245, 235, 0.3);
}

/* 修复：暴力去除浏览器默认的青色方形聚焦框 & 移除导致闪烁的 transition: all */
.modal-content button,
.modal-content button:focus,
.modal-content button:focus-visible,
.modal-content button:active {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

/* 强制覆盖内部元素的颜色引用 - 默认态 (未选中) */
.modal-content .theme-btn,
.modal-content .wave-btn,
.modal-content .scale-btn,
.modal-content .backing-type-btn,
.modal-content .modal-close {
    color: rgba(255, 248, 242, 0.6);
    border: 1px solid rgba(255, 245, 235, 0.15);
    background: transparent;
    /* v6.6: 只过渡颜色属性，彻底解决 outline 闪烁问题 */
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
}

/* v6.6: 选中态 - 透光琉璃风格 (柔和高亮，不刺眼) */
.modal-content .theme-btn.active,
.modal-content .wave-btn.active,
.modal-content .scale-btn.active,
.modal-content .backing-type-btn.active {
    background: rgba(255, 236, 209, 0.15) !important; /* 15% 香槟色填充 */
    border: 1px solid rgba(255, 236, 209, 0.8) !important; /* 清晰的亮边框 */
    color: #ffecd1 !important; /* 香槟亮色文字 */
    font-weight: 600;
    transform: scale(1.02); /* 极微小的缩放反馈 */
    box-shadow: 0 0 12px rgba(255, 200, 150, 0.15) !important; /* 柔和辉光 */
    text-shadow: 0 0 8px rgba(255, 200, 150, 0.4); /* 文字发光 */
}

/* v6.5: Hover 态 (仅针对未选中项) */
.modal-content .theme-btn:not(.active):hover,
.modal-content .wave-btn:not(.active):hover,
.modal-content .scale-btn:not(.active):hover,
.modal-content .backing-type-btn:not(.active):hover {
    background: rgba(255, 245, 235, 0.1);
    border-color: rgba(255, 245, 235, 0.5);
    color: #fffaf0;
}

/* v6.4: 开关样式 - 暖色适配 */
.modal-content .toggle-switch input:checked + .toggle-slider {
    background: rgba(255, 245, 235, 0.25) !important;
}
.modal-content .toggle-switch input:checked + .toggle-slider::before {
    background: #fffaf0;
    box-shadow: 0 0 10px rgba(255, 220, 180, 0.3);
}

/* v6.7: 标题高级感优化 - 流金岁月风格 */

/* 1. 顶部大标题 "设置" - 香槟金渐变金属质感 */
.modal-content h2 {
    background: linear-gradient(135deg, #ffffff 0%, #ffeccf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    /* 防止标题覆盖关闭按钮的点击区域 */
    pointer-events: none;
    margin-top: 0;
}

/* 2. 分组小标题 ("视觉主题", "波形类型" 等) */
.settings-label span:first-child,
.settings-row .settings-sublabel,
.settings-label {
    color: rgba(255, 248, 242, 0.92); /* 柔和的暖亮白，比纯白更有质感 */
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 3. 分隔线优化 - 极细的暖光 */
.settings-divider {
    background: linear-gradient(90deg, transparent, rgba(255, 245, 235, 0.1), transparent);
    height: 1px;
}

/* 4. 说明文字 (Hint) - 暖灰，拉开层级 */
.modal-content .settings-hint, 
.modal-content .settings-description,
.modal-content .modal-note {
    color: rgba(255, 235, 220, 0.5) !important; /* 带一点点暖色的灰 */
    font-weight: 400;
    opacity: 1 !important;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    /* 触摸友好：确保点击区域与视觉区域对齐 */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    /* 确保关闭按钮在所有元素之上，点击区域不受遮挡 */
    z-index: 10;
    pointer-events: auto;
}

.modal-close:hover {
    opacity: 1;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-content ul {
    list-style: none;
    margin-bottom: 20px;
}

.modal-content li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content li:last-child {
    border-bottom: none;
}

.modal-content li strong {
    color: var(--accent-color);
}

.modal-note {
    font-size: 0.85rem;
    opacity: 0.7;
    text-align: center;
}

/* 设置面板样式 */
.settings-content {
    max-width: 450px;
}

.settings-group {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-group:last-of-type {
    margin-bottom: 16px;
    border-bottom: none;
}

.settings-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    font-weight: 500;
}

.settings-hint {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.6;
}

/* 波形选择器 */
.wave-type-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.wave-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    opacity: 0.7;
}

.wave-btn:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.wave-btn.active {
    opacity: 1;
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.wave-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
    font-weight: 300;
}

.wave-name {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 音阶选择器 */
.scale-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.scale-btn {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: transparent;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    opacity: 0.7;
    text-align: center;
}

.scale-btn:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.scale-btn.active {
    opacity: 1;
    background: var(--accent-color);
    border-color: var(--accent-color);
    font-weight: 500;
}

/* 开关样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    transition: all var(--transition-speed) ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-speed) ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* 设置面板分隔线 */
.settings-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

/* 设置描述文字 */
.settings-description {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-bottom: 16px;
}

/* 设置行 */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.settings-sublabel {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* 伴奏类型选择器 */
.backing-type-selector {
    display: flex;
    gap: 8px;
}

.backing-type-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: transparent;
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    opacity: 0.7;
}

.backing-type-btn:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.backing-type-btn.active {
    opacity: 1;
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* 音量滑块容器 */
.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.volume-slider {
    width: 120px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
}

.volume-value {
    font-size: 0.85rem;
    opacity: 0.8;
    min-width: 35px;
    text-align: right;
}

/* 响应式设计 */
@media (max-width: 768px) {
    :root {
        --toolbar-height: 50px;
        --spectrum-height: 80px;
    }

    .toolbar {
        padding: 0 10px;
        gap: 8px;
    }

    .toolbar-left {
        gap: 10px;
    }

    .logo {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }

    /* Zen 按钮移动端适配 */
    .zen-toggle-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .toolbar .theme-switcher {
        display: none;
    }

    .toolbar-right {
        gap: 8px;
    }

    .guide-text {
        font-size: 1.2rem;
    }

    .guide-subtext {
        font-size: 0.8rem;
        padding: 0 20px;
    }

    .guide-ripple {
        width: 80px;
        height: 80px;
    }

    .modal-content {
        padding: 20px 25px;
        max-height: 80vh;
        overflow-y: auto;
    }

    .modal-content h2 {
        font-size: 1.1rem;
    }

    /* 设置面板移动端适配 */
    .settings-content {
        max-width: 100%;
    }

    .wave-type-selector {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .wave-btn {
        padding: 10px 6px;
    }

    .wave-icon {
        font-size: 1.3rem;
    }

    .wave-name {
        font-size: 0.7rem;
    }

    .backing-type-selector {
        flex-wrap: wrap;
    }

    .backing-type-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .volume-slider {
        width: 80px;
    }

    /* 音符指示器移动端适配 */
    .note-indicator {
        font-size: 0.8rem;
        padding: 3px 10px;
    }
}

/* 超窄屏幕适配 */
@media (max-width: 480px) {
    :root {
        --toolbar-height: 44px;
        --spectrum-height: 70px;
    }

    .logo {
        font-size: 1rem;
    }

    .zen-toggle-btn {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    .guide-text {
        font-size: 1rem;
    }

    .guide-ripple {
        width: 60px;
        height: 60px;
    }

    .modal-content {
        padding: 16px 20px;
    }

    .modal-content ul {
        font-size: 0.9rem;
    }
}

/* 高对比度主题适配 */
@media (prefers-contrast: high) {
    .theme-btn {
        border-width: 2px;
    }
    
    .note-indicator {
        font-weight: 700;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 选择文本样式 */
::selection {
    background: var(--accent-color);
    color: white;
}

/* ========== 更多菜单按钮 ========== */
.more-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.more-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.more-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.more-icon .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-color);
}

/* ========== 更多菜单下拉 ========== */
.more-menu {
    position: absolute;
    top: calc(var(--toolbar-height) + 8px);
    right: 16px;
    min-width: 140px;
    background: rgba(30, 26, 24, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 245, 235, 0.1);
    border-radius: 12px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s ease;
    z-index: 150;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.more-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: rgba(255, 248, 242, 0.9);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
    text-align: left;
}

.more-menu-item:hover {
    background: rgba(255, 236, 209, 0.12);
}

.more-menu-item .menu-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.more-menu-item .menu-text {
    flex: 1;
}

/* 录制菜单项激活状态 */
.more-menu-item.recording .menu-icon {
    color: #ff4444;
}

.more-menu-item.recording {
    background: rgba(255, 68, 68, 0.15);
}

/* ========== 浮动录制胶囊 ========== */
.recorder-capsule {
    position: fixed;
    bottom: calc(var(--spectrum-height) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(30, 26, 24, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 245, 235, 0.15);
    border-radius: 30px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 120;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.recorder-capsule.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.capsule-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 248, 242, 0.9);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.capsule-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.capsule-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.capsule-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.capsule-icon {
    line-height: 1;
}

/* 录制按钮特殊样式（在更多菜单中） */
.more-menu-item .menu-icon.recording {
    color: #ff4444;
    animation: record-pulse-icon 1s ease-in-out infinite;
}

@keyframes record-pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 停止按钮特殊样式 */
.capsule-btn.stop-btn:hover:not(:disabled) {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

/* 播放按钮特殊样式 */
.capsule-btn.play-btn:hover:not(:disabled) {
    background: rgba(0, 200, 100, 0.2);
    color: #00c864;
}

.capsule-btn.play-btn.playing {
    background: rgba(0, 200, 100, 0.25);
    color: #00c864;
    animation: play-glow-capsule 2s ease-in-out infinite;
}

@keyframes play-glow-capsule {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 200, 100, 0.3); }
    50% { box-shadow: 0 0 15px rgba(0, 200, 100, 0.5); }
}

/* 清空按钮特殊样式 */
.capsule-btn.clear-btn:hover:not(:disabled) {
    background: rgba(255, 100, 100, 0.2);
}

/* 保存按钮特殊样式 */
.capsule-btn.save-btn:hover:not(:disabled) {
    background: rgba(100, 150, 255, 0.2);
    color: #6496ff;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .more-btn {
        width: 32px;
        height: 32px;
    }

    .more-icon .dot {
        width: 3px;
        height: 3px;
    }

    .more-menu {
        right: 10px;
        min-width: 130px;
    }

    .more-menu-item {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .recorder-capsule {
        padding: 6px 12px;
        gap: 6px;
        bottom: calc(var(--spectrum-height) + 15px);
    }

    .capsule-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .more-btn {
        width: 28px;
        height: 28px;
    }

    .more-icon {
        gap: 2px;
    }

    .more-icon .dot {
        width: 3px;
        height: 3px;
    }

    .more-menu {
        right: 8px;
        min-width: 120px;
        padding: 4px;
    }

    .more-menu-item {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .more-menu-item .menu-icon {
        font-size: 1rem;
    }

    .recorder-capsule {
        padding: 5px 10px;
        gap: 4px;
    }

    .capsule-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
}