/* ============================================
   会议纪要助手 - 聊天界面样式
   ============================================ */

/* ===== 全局变量 ===== */
:root {
    /* 现代化配色系统 (Inter/Slate inspired) */
    --primary-color: #2563EB;        /* Royal Blue 600 */
    --primary-hover: #1D4ED8;        /* Royal Blue 700 */
    --primary-light: #EFF6FF;        /* Blue 50 */
    
    --secondary-color: #10B981;      /* Emerald 500 */
    --danger-color: #EF4444;         /* Red 500 */
    --warning-color: #F59E0B;        /* Amber 500 */
    
    --text-primary: #1E293B;         /* Slate 800 */
    --text-secondary: #475569;       /* Slate 600 */
    --text-muted: #94A3B8;           /* Slate 400 */
    
    --bg-page: #F1F5F9;              /* Slate 100 - 页面背景 */
    --bg-surface: #FFFFFF;           /* 纯白 - 卡片/侧边栏背景 */
    --bg-input: #F8FAFC;             /* Slate 50 - 输入框背景 */
    
    --border-light: #E2E8F0;         /* Slate 200 */
    
    /* 阴影系统 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-input: 0 0 0 1px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.05);

    /* 间距 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* 布局 */
    --sidebar-width: 280px;
    --header-height: 64px;
    --input-area-height: auto;
}

/* ===== 基础样式重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden; /* 防止整个页面滚动 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-page);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-light);
    z-index: 20;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    overflow: hidden;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.new-session-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.new-session-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-light);
}

.session-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

/* 滚动条美化 */
.session-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.session-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}
.session-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.session-item {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.session-item:hover {
    background: var(--bg-page);
}

.session-item.active {
    background: var(--primary-light);
    border-color: rgba(37, 99, 235, 0.1);
}

.session-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.session-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.session-item.active .session-title {
    color: var(--primary-color);
}

.session-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 会话菜单 */
.session-menu {
    position: relative;
    margin-left: var(--spacing-sm);
}

.session-menu-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s;
    padding: 0;
}

.session-menu-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.session-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
}

.session-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.session-menu-item {
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.session-menu-item:first-child {
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.session-menu-item:last-child {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.session-menu-item:hover {
    background: var(--bg-page);
    color: var(--text-primary);
}

.session-menu-item.delete-session {
    color: var(--danger-color);
}

.session-menu-item.delete-session:hover {
    background: rgba(239, 68, 68, 0.1);
}

.session-menu-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.logout-btn-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 4px;
}

.logout-btn-icon:hover {
    background: #FEF2F2;
    color: var(--danger-color);
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg-page);
    width: 100%;
    min-width: 0; /* 防止flex子项溢出 */
}

/* 侧边栏切换按钮 */
.sidebar-toggle {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: none; /* 桌面端默认隐藏，或根据JS逻辑控制 */
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    z-index: 30;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* ===== 聊天容器 ===== */
.chat-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-page);
    position: relative;
}

/* ===== 聊天头部 ===== */
.chat-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    padding: 0 var(--spacing-lg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 10;
}

.header-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin: 0 auto;
    width: 100%;
    max-width: 900px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.header-info {
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.header-back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-back-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.bot-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.bot-status {
    font-size: 0.8rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.bot-status::before {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    background: var(--secondary-color);
    border-radius: 50%;
}

/* ===== 聊天消息区 ===== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    scroll-behavior: smooth;
}

.message {
    display: flex;
    gap: var(--spacing-md);
    max-width: 900px;
    width: 100%;
    margin: 0 auto; /* 居中显示，适合大屏 */
    animation: message-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom left;
}

.user-message {
    transform-origin: bottom right;
}

@keyframes message-pop {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 机器人消息 */
.bot-message {
    align-self: center; /* 使用 margin: 0 auto 控制容器宽度，所以这里配合 width: 100% */
}

.bot-message .message-avatar {
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.bot-message .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.bot-message .message-content {
    flex: 1;
    max-width: 85%;
}

.bot-message .message-text {
    background: var(--bg-surface);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    position: relative;
}

/* 用户消息 */
.user-message {
    align-self: center;
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.user-message .message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    max-width: 85%;
}

.user-message .message-text {
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg) 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.message-text {
    line-height: 1.6;
    font-size: 0.95rem;
}

/* 系统消息 */
.system-message {
    justify-content: center;
}
.system-message .message-text {
    background: rgba(0,0,0,0.05);
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-radius: var(--radius-full);
    padding: 0.25rem 1rem;
    border: none;
    box-shadow: none;
}

/* 时间戳 */
.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

/* 录音控制 */
.recording-panel {
    background: var(--danger-color);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
    z-index: 15;
    margin: 0 auto;
    width: 100%;
    max-width: 900px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.recording-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 16px;
}
.recording-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s infinite;
}
#recording-visualizer {
    height: 40px;
    width: 200px;
    margin-right: 16px;
    opacity: 0.8;
}
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

.stop-recording-btn {
    background: white;
    color: var(--danger-color);
    border: none;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== 输入区域 ===== */
.chat-input-area {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-md) var(--spacing-lg);
    flex-shrink: 0;
    position: relative;
    z-index: 20;
}

/* 输入框容器限制最大宽度 */
.chat-input-area .input-wrapper {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-end;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    padding: var(--spacing-sm);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-input);
    transition: all 0.2s;
}

.chat-input-area .input-wrapper:focus-within {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chat-input {
    flex: 1;
    min-height: 24px;
    max-height: 120px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    resize: none;
    color: var(--text-primary);
    line-height: 1.5;
}

.chat-input:focus {
    outline: none;
}

.input-actions {
    display: flex;
    gap: 4px;
    padding-bottom: 2px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--border-light);
    color: var(--primary-color);
}

.action-btn.active {
    color: var(--danger-color);
    background: #FEF2F2;
}

.send-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 4px;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.send-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

/* ===== Toast & Loading ===== */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 10px 20px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    font-size: 0.9rem;
    font-weight: 500;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}
.toast.success { background: var(--secondary-color); }
.toast.error { background: var(--danger-color); }

.loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: var(--spacing-md);
}
.loading-overlay.show { display: flex; }
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-text { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }

.message-status {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.message-status .loading-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Markdown 优化 ===== */
.markdown-content h1, .markdown-content h2, .markdown-content h3 {
    margin-top: 1.2em; margin-bottom: 0.6em; line-height: 1.3;
}
.markdown-content p { margin-bottom: 0.8em; }
.markdown-content ul, .markdown-content ol { padding-left: 1.5em; margin-bottom: 0.8em; }
.markdown-content li { margin-bottom: 0.4em; }
.markdown-content code {
    background: rgba(0,0,0,0.06);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

/* =========================================
   响应式设计 (H5 & Mobile)
   ========================================= */

@media (max-width: 768px) {
    /* 移动端侧边栏逻辑 */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }
    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
    }
    
    .sidebar-toggle {
        display: flex;
    }

    .chat-header {
        padding-left: 60px; /* 给汉堡菜单留空间 */
    }

    .chat-messages {
        padding: var(--spacing-md);
    }

    .bot-message .message-content,
    .user-message .message-content {
        max-width: 95%; /* 移动端气泡更宽 */
    }

    .chat-input-area {
        padding: var(--spacing-sm);
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .chat-input-area .input-wrapper {
        border-radius: 24px; /* 移动端更圆润 */
    }
    
    .send-btn {
        width: 32px; height: 32px;
    }
    .action-btn {
        width: 32px; height: 32px;
    }
}

/* ===== 录音消息样式 ===== */
.recording-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
}

.audio-player {
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    position: relative;
}

.audio-player audio {
    width: 100%;
    height: 40px;
    outline: none;
}

.audio-player audio::-webkit-media-controls-panel {
    background-color: var(--bg-surface);
}

.local-badge {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    background: var(--warning-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.transcription-text {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.transcription-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.transcription-content {
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .recording-container {
        gap: var(--spacing-sm);
    }

    .audio-player,
    .transcription-text {
        padding: var(--spacing-sm);
    }

    .audio-player audio {
        height: 36px;
    }
}

/* ===== 自定义确认弹窗样式 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: var(--spacing-md);
}

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

.modal-container {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 440px;
    width: 100%;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

.modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: var(--spacing-xl) auto var(--spacing-md);
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary-color);
}

.modal-icon svg {
    stroke-width: 2;
}

/* 不同类型的图标颜色 */
.modal-container.danger .modal-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.modal-container.warning .modal-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.modal-container.success .modal-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
}

.modal-header {
    padding: 0 var(--spacing-xl) var(--spacing-md);
    text-align: center;
    position: relative;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
}

.modal-close {
    position: absolute;
    top: -8px;
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-page);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0 var(--spacing-xl) var(--spacing-xl);
}

.modal-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
    margin: 0;
}

.modal-footer {
    padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-xl);
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

.modal-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    min-width: 100px;
}

.modal-btn-cancel {
    background: var(--bg-page);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.modal-btn-cancel:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.modal-btn-confirm {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.modal-btn-confirm:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.modal-btn-confirm:active {
    transform: translateY(0);
}

/* 危险操作确认按钮 */
.modal-container.danger .modal-btn-confirm {
    background: var(--danger-color);
}

.modal-container.danger .modal-btn-confirm:hover {
    background: #DC2626;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* 警告操作确认按钮 */
.modal-container.warning .modal-btn-confirm {
    background: var(--warning-color);
}

.modal-container.warning .modal-btn-confirm:hover {
    background: #D97706;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

/* 输入框样式 */
.input-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-input);
    transition: all 0.2s;
    outline: none;
}

.modal-input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-input::placeholder {
    color: var(--text-muted);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .modal-container {
        max-width: 90%;
        margin: var(--spacing-md);
    }

    .modal-icon {
        width: 56px;
        height: 56px;
        margin: var(--spacing-lg) auto var(--spacing-sm);
    }

    .modal-header {
        padding: 0 var(--spacing-md) var(--spacing-sm);
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 0 var(--spacing-md) var(--spacing-md);
    }

    .modal-message {
        font-size: 0.9rem;
    }

    .modal-footer {
        padding: var(--spacing-md);
        flex-direction: column-reverse;
    }

    .modal-btn {
        width: 100%;
    }

    .modal-close {
        top: -12px;
        right: var(--spacing-xs);
    }

    /* 录音面板移动端优化 */
    .recording-panel {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .recording-text {
        display: none; /* 隐藏文字只保留红点 */
    }
    
    .recording-indicator {
        margin-right: 8px;
    }
    
    #recording-visualizer {
        width: 100px; /* 减小波形图宽度 */
        margin-right: 8px;
    }
    
    .stop-recording-btn {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
}
