/**
 * 安安主页样式
 * 现代化的响应式设计，支持动态背景和调试模式
 */

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

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 主容器 */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部标题区域 */
.app-header {
    text-align: center;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-header h1 {
    font-size: 2.5em;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    background: linear-gradient(45deg, #fff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-header .subtitle {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* 主要内容区域 */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 状态区域 */
.status-section {
    display: flex;
    justify-content: center;
}

.status-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    min-width: 400px;
}

.status-card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.status-text {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 20px;
    font-weight: 500;
}

/* 状态指示器 */
.status-indicators {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #666;
}

.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    transition: background-color 0.3s ease;
}

.indicator-dot.active {
    background: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* 功能展示区域 */
.features-section {
    display: flex;
    justify-content: center;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    width: 100%;
}

.feature-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
    display: block;
}

.feature-card h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.feature-card p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.feature-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    background: #f5f5f5;
    color: #999;
    border: 1px solid #e0e0e0;
}

.feature-status.success {
    background: #e8f5e8;
    color: #4caf50;
    border-color: #4caf50;
}

.feature-status.warning {
    background: #fff3cd;
    color: #f57c00;
    border-color: #f57c00;
}

.feature-status.info {
    background: #e3f2fd;
    color: #2196f3;
    border-color: #2196f3;
}

.feature-status.error {
    background: #ffebee;
    color: #f44336;
    border-color: #f44336;
}

/* API测试区域 */
.api-section {
    display: flex;
    justify-content: center;
}

.api-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 600px;
}

.api-card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.api-endpoints {
    margin-bottom: 25px;
}

.endpoint {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.endpoint:last-child {
    border-bottom: none;
}

.endpoint-method {
    background: #4caf50;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
}

.endpoint-url {
    flex: 1;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9em;
    color: #555;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 6px;
}

.endpoint-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    background: #f5f5f5;
    color: #999;
    border: 1px solid #e0e0e0;
}

.endpoint-status.success {
    background: #e8f5e8;
    color: #4caf50;
    border-color: #4caf50;
}

.endpoint-status.error {
    background: #ffebee;
    color: #f44336;
    border-color: #f44336;
}

/* 测试按钮 */
.test-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.test-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.test-button:hover::before {
    left: 100%;
}

.test-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.test-button:active {
    transform: translateY(0);
}

.test-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.test-button.error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

/* 底部信息 */
.app-footer {
    margin-top: auto;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-footer p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
    font-size: 0.9em;
}

#api-url {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-weight: 600;
    color: #fff;
}

/* 调试面板 */
.debug-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    max-width: 500px;
    max-height: 80vh;
    background: rgba(0, 0, 0, 0.95);
    color: #0f0;
    padding: 20px;
    border-radius: 12px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.4;
    z-index: 9999;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.debug-panel h3,
.debug-panel h4 {
    color: #fff;
    margin: 15px 0 10px 0;
    font-size: 14px;
}

.debug-panel h3:first-child {
    margin-top: 0;
}

.debug-panel ul {
    list-style: none;
    margin-bottom: 15px;
}

.debug-panel li {
    margin-bottom: 5px;
    padding-left: 10px;
}

.debug-panel li strong {
    color: #ff0;
    margin-right: 5px;
}

.debug-panel pre {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #333;
}

.debug-panel .error-details {
    background: rgba(255, 0, 0, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f44336;
    margin-top: 10px;
}

/* 加载提示 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    font-size: 1.1em;
    text-align: center;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        padding: 15px;
    }

    .app-header {
        padding: 20px;
        margin-bottom: 25px;
    }

    .app-header h1 {
        font-size: 2em;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .status-card,
    .api-card {
        min-width: unset;
        padding: 20px;
    }

    .status-indicators {
        flex-direction: column;
        gap: 10px;
    }

    .endpoint {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .debug-panel {
        position: relative;
        top: auto;
        left: auto;
        max-width: none;
        max-height: none;
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.6em;
    }

    .app-header .subtitle {
        font-size: 1em;
    }

    .feature-card {
        padding: 20px;
    }

    .feature-icon {
        font-size: 2em;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {

    .feature-card,
    .status-card,
    .api-card {
        border: 2px solid #333;
    }

    .debug-panel {
        border: 2px solid #fff;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* 浮动文字卡片系统 */
.floating-text-card {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 18px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.5;
    max-width: 420px;
    word-wrap: break-word;
    z-index: 500;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* 使用居中定位但不会跳动 */
    left: 50%;
    transform: translateX(-50%);
}

.floating-text-card.show {
    opacity: 1;
}

.floating-text-card.hide {
    opacity: 0;
}

/* ASR识别文字卡片 - 在底部25%位置 */
.asr-text-card {
    bottom: 32%;
    border-left: 5px solid #4285f4;
    color: #1976d2;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.asr-text-card::before {
    content: '🎤';
    margin-right: 8px;
    font-size: 16px;
}

/* ASR监听状态脉冲动画 */
.asr-text-card.listening-pulse {
    animation: asrPulse 2s infinite;
}

@keyframes asrPulse {

    0%,
    100% {
        border-left-color: #4285f4;
        background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
    }

    50% {
        border-left-color: #1976d2;
        background: linear-gradient(135deg, rgba(66, 133, 244, 0.2) 0%, rgba(255, 255, 255, 0.98) 100%);
    }
}

/* TTS播放文字卡片 */
.tts-text-card {
    top: 2%;
    border-left: 5px solid #34a853;
    color: #2d5016;
    background: linear-gradient(135deg, rgba(52, 168, 83, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.tts-text-card::before {
    content: '🔊';
    margin-right: 8px;
    font-size: 16px;
}

/* === 控制区域样式 === */

/* 控制区域主容器 */
.control-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 20px;
    z-index: 1000;
}

.control-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 500px;
    width: 100%;
}

/* 模式切换按钮组 */
.mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    outline: none;
}

.mode-btn.active {
    background: linear-gradient(135deg, #FF9800 0%, #FF6F00 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(255, 152, 0, 0.3);
}

.mode-btn:hover:not(.active) {
    color: #333;
    background: rgba(255, 152, 0, 0.1);
}

/* 声波容器 */
.control-container .waveform-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 150px;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-container .waveform-container[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}


/* 输入模式切换 */
.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 245, 245, 0.95) 100%);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    padding: 4px;
    border: 2px solid rgba(255, 182, 193, 0.2);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.1);
}

.mode-btn {
    padding: 8px 16px;
    border: 2px solid rgba(255, 152, 0, 0.3);
    border-radius: 18px;
    background: transparent;
    color: #FF9800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 12px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.4s;
}

.mode-btn:hover::before {
    left: 100%;
}

.mode-btn:hover {
    transform: scale(1.05);
    border-color: rgba(255, 152, 0, 0.5);
    color: #FF6F00;
}

.mode-btn.active {
    background: linear-gradient(135deg, #FF9800 0%, #FF6F00 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.mode-btn.active:hover {
    background: linear-gradient(135deg, #FF6F00 0%, #FF9800 100%);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
}

/* 文字输入区域 */
.text-input-area {
    display: none;
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 245, 245, 0.95) 100%);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 182, 193, 0.2);
    box-shadow: 0 6px 16px rgba(255, 105, 180, 0.1);
}

.text-input-area.active {
    display: block;
    animation: expandInputArea 0.3s ease;
}

@keyframes expandInputArea {
    from {
        opacity: 0;
        transform: translateY(10px) scaleY(0.8);
        max-height: 0;
    }

    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        max-height: 120px;
    }
}

.text-input-area.collapsing {
    animation: collapseInputArea 0.3s ease;
}

@keyframes collapseInputArea {
    from {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        max-height: 120px;
    }

    to {
        opacity: 0;
        transform: translateY(10px) scaleY(0.8);
        max-height: 0;
    }
}

#textInput {
    width: 100%;
    min-height: 60px;
    max-height: 80px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 10px;
    font-size: 14px;
    padding: 5px;
    resize: none;
    outline: none;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#textInput:focus {
    border-color: rgba(102, 126, 234, 0.3);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15), inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#sendBtn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #FF9800 0%, #FF6F00 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

#sendBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

#sendBtn:hover::before {
    left: 100%;
}

#sendBtn:hover {
    background: linear-gradient(135deg, #FF6F00 0%, #FF9800 100%);
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
}

#sendBtn:active {
    transform: scale(0.98);
}

#sendBtn:disabled {
    background: linear-gradient(135deg, #ccc 0%, #ddd 100%);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 语音输入区域 */
.voice-input-area {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.voice-input-area[style*="display: none"] {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}


/* === 现代化录音按钮设计 === */

.record-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #FFD93D 0%, #FFA726 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    
    /* 现代化阴影 */
    box-shadow: 
        0 8px 32px rgba(255, 217, 61, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    
    /* 平滑过渡 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 增强移动端防护 */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    
    /* 外发光效果 */
    border: 3px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

/* 麦克风图标区域 */
.mic-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    
    /* 防止子元素触发右键菜单 */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

.mic-svg {
    width: 100%;
    height: 100%;
    color: white;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    
    /* 防止SVG触发右键菜单 */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* 按钮文字区域 */
.button-text {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    position: relative;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    
    /* 防止文字触发右键菜单 */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* 文字状态元素 */
.idle-text,
.recording-text {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

.recording-text {
    display: none;
}

/* === 悬停效果 === */
.record-button:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(255, 193, 7, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    
    /* 悬停时的渐变变化 */
    background: linear-gradient(135deg, #FFEB3B 0%, #FFC107 100%);
}

.record-button:hover .sound-wave {
    opacity: 0.3 !important;
    animation: idle-wave 2s ease-in-out infinite;
}

.record-button:hover .mic-icon {
    transform: scale(1.1);
}

/* === 录音状态 === */
.record-button:active,
.record-button.recording {
    background: linear-gradient(135deg, #ff6b7a 0%, #ff5252 100%);
    transform: scale(0.98);
    
    box-shadow: 
        0 8px 32px rgba(255, 107, 122, 0.6),
        0 4px 16px rgba(255, 82, 82, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.record-button.recording .idle-text {
    display: none;
}

.record-button.recording .recording-text {
    display: block;
    color: white;
    font-weight: 700;
}

.record-button.recording .sound-wave {
    opacity: 1 !important;
    animation: recording-wave 1.2s ease-in-out infinite;
}

.record-button.recording .mic-icon {
    animation: recording-pulse 1.5s ease-in-out infinite;
}

/* 状态显示 */
.status {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .control-section {
        padding: 15px;
    }

    .control-container {
        gap: 15px;
    }

    .mode-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .voice-input-area button {
        width: 100px;
        height: 100px;
        font-size: 14px;
    }

    .text-input-area {
        padding: 16px;
    }

    .text-input-area textarea {
        font-size: 16px;
        /* 防止iOS缩放 */
    }

    .floating-text-card {
        max-width: 90%;
        padding: 15px 20px;
        font-size: 16px;
    }

    .asr-text-card {
        bottom: 30%;
    }
}

@media (max-width: 480px) {
    .control-container {
        gap: 12px;
    }

    .mode-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .voice-input-area button {
        width: 80px;
        height: 80px;
        font-size: 13px;
    }

    .text-input-area {
        flex-direction: column;
        gap: 12px;
    }

    .text-input-area button {
        align-self: flex-end;
    }

    .floating-text-card {
        font-size: 15px;
        padding: 12px 18px;
    }

    /* 录音按钮响应式 */
    .record-button {
        width: 85px !important;
        height: 85px !important;
    }
    
    .mic-icon {
        width: 28px !important;
        height: 28px !important;
        margin-bottom: 3px !important;
    }
    
    .button-text {
        font-size: 11px !important;
    }
}

/* === 音波动画效果 === */

/* 音波圆圈基础样式 - 设置正确的变换原点 */
.sound-wave {
    transform-origin: 50px 40px; /* 以音波圆心为变换原点 */
}

/* 待机音波 - 轻微呼吸效果 */
@keyframes idle-wave {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(0.9);
    }
    50% { 
        opacity: 0.1; 
        transform: scale(1.1);
    }
}

/* 录音音波 - 纯扩散效果 */
@keyframes recording-wave {
    0% {
        opacity: 0.8;
        transform: scale(0.6);  /* 从小开始 */
    }
    30% {
        opacity: 0.6;
        transform: scale(0.8);  /* 正常大小 */
    }
    70% {
        opacity: 0.2;
        transform: scale(1.0);  /* 向外扩散 */
    }
    100% {
        opacity: 0;
        transform: scale(1.2);  /* 完全扩散消失 */
    }
}

/* 麦克风脉冲 */
@keyframes recording-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* 音波延迟效果 - 创造连续扩散感 */
.sound-wave.wave-1 {
    animation-delay: 0s;
    animation-duration: 1.2s;
}
.sound-wave.wave-2 {
    animation-delay: 0.2s;
    animation-duration: 1.4s;
}
.sound-wave.wave-3 {
    animation-delay: 0.4s;
    animation-duration: 1.6s;
}

/* === 录音按钮响应式优化 === */

/* 平板设备 */
@media (max-width: 1023px) and (min-width: 768px) {
    .record-button {
        width: 120px !important;
        height: 120px !important;
    }
    
    .mic-icon {
        width: 40px !important;
        height: 40px !important;
        margin-bottom: 6px !important;
    }
    
    .button-text {
        font-size: 13px !important;
    }
}

/* 手机设备 */
@media (max-width: 767px) {
    .record-button {
        width: 100px !important;
        height: 100px !important;
    }
    
    .mic-icon {
        width: 36px !important;
        height: 36px !important;
        margin-bottom: 4px !important;
    }
    
    .button-text {
        font-size: 12px !important;
    }
}

/* === 横屏布局专用样式 === */
@media (orientation: landscape) and (min-width: 768px) {
    
    /* 控制区域布局重构 */
    .control-section {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0;
        display: block; /* 改为block，子元素使用绝对定位 */
        pointer-events: none; /* 让背景不拦截点击事件 */
    }
    
    .control-container {
        position: relative;
        max-width: none;
        width: 100%;
        height: 100%;
        gap: 0; /* 清除gap，使用绝对定位 */
    }
    
    /* modeToggle移到左侧中央 */
    .mode-toggle {
        position: fixed !important;
        left: 50px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        flex-direction: column !important; /* 竖直排列 */
        width: auto !important;
        height: auto !important;
        gap: 12px !important; /* 按钮间距 */
        pointer-events: auto !important; /* 恢复点击事件 */
        z-index: 1001 !important;
        /* 重置可能影响布局的属性 */
        margin: 0 !important;
        max-width: none !important;
        bottom: auto !important;
        right: auto !important;
    }
    
    /* 横屏时按钮样式调整 */
    .mode-toggle .mode-btn {
        width: 50px;
        height: 120px; /* 增加高度以容纳4个字符 */
        padding: 12px 8px; /* 减少上下padding */
        font-size: 14px;
        line-height: 1.8; /* 增加行高确保字符间距 */
        flex: none; /* 取消flex布局 */
    }
    
    /* 文字显示控制 */
    .mode-toggle .portrait-text {
        display: none; /* 横屏时隐藏横排文字 */
    }
    
    .mode-toggle .landscape-text {
        display: inline; /* 横屏时显示竖排文字 */
        line-height: 1.8;
        letter-spacing: 0px; /* 移除letter-spacing避免挤压 */
        font-size: 14px; /* 确保字体大小 */
    }
    
    /* 录音按钮移到右侧中央 */
    .voice-input-area {
        position: fixed !important;
        right: 50px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        pointer-events: auto !important;
        z-index: 1001 !important;
        /* 重置可能影响布局的属性 */
        left: auto !important;
        bottom: auto !important;
        margin: 0 !important;
        width: auto !important;
        height: auto !important;
    }
    
    /* 文字输入区域保持在中下位置 */
    .text-input-area {
        position: fixed !important;
        bottom: 15% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 400px !important;
        max-width: 80% !important;
        pointer-events: auto !important;
        z-index: 1001 !important;
        /* 重置可能影响布局的属性 */
        top: auto !important;
        right: auto !important;
        margin: 0 !important;
    }
    
    /* 声波容器保持在中下位置 */
    .waveform-container {
        position: fixed !important;
        top: 65% !important; /* 移到更下方，与竖屏时相对位置一致 */
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 300px !important;
        max-width: 60% !important;
        pointer-events: none !important;
        z-index: 999 !important;
        /* 重置可能影响布局的属性 */
        bottom: auto !important;
        right: auto !important;
        margin: 0 !important;
    }
    
    /* 浮动文字卡片位置调整 */
    .asr-text-card {
        bottom: 25%; /* 稍微上移避免与文字输入重叠 */
    }
    
    .tts-text-card {
        top: 5%; /* 稍微下移 */
    }
}

/* 竖屏时隐藏横屏文字，显示竖屏文字 */
@media (orientation: portrait), (max-width: 767px) {
    .mode-toggle .landscape-text {
        display: none;
    }
    
    .mode-toggle .portrait-text {
        display: inline;
    }
}