/* 字体配置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito Sans', 'Poppins', 'Inter', 'Songti SC', 'SimSun', '宋体', system-ui, sans-serif;
    background-color: #fef7e7;
    min-height: 100vh;
    color: #1f2937;
}

/* 基础容器 - 只用于欢迎页和Persona页面 */
.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    position: relative;
}

/* 桌面端聊天界面容器 */
.chat-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    height: 100vh;
    background-color: #fef7e7;
}

/* 侧边栏样式 */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-size: 18px;
    font-weight: bold;
    color: #1f2937;
}

.new-chat-btn {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}

.new-chat-btn:hover {
    background: #059669;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.chat-history-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.chat-history-item:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.chat-history-item.active {
    background: #f0fdf4;
    border-color: #10b981;
}

.chat-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 4px;
}

.chat-preview {
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-date {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* 主聊天区域 */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: white;
}

/* 删除按钮 */
.delete-chat-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    position: absolute;
    top: 8px;
    right: 8px;
}

.chat-history-item:hover .delete-chat-btn {
    opacity: 1;
}

.delete-chat-btn:hover {
    background: #fef2f2;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 16px;
    }
    
    .chat-container {
        flex-direction: column;
        max-width: 100%;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .main-chat {
        height: calc(100vh - 200px);
    }
}

/* 状态栏样式 */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.signal-icons {
    display: flex;
    gap: 4px;
}

.signal-dot {
    width: 4px;
    height: 4px;
    background-color: #10b981;
    border-radius: 50%;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 16px;
}

/* Logo样式 */
.logo {
    text-align: center;
    margin: 32px 0;
}

.logo-symbol {
    font-size: 48px;
    color: #10b981;
    margin-bottom: 8px;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #1f2937;
}

/* 按钮样式 */
.btn-gradient {
    background: linear-gradient(to right, #fbbf24, #10b981);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s;
}

.btn-gradient:hover {
    transform: translateY(-1px);
}

.btn-gradient:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 文本样式 */
.title-large {
    font-size: 24px;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 8px;
}

.subtitle {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 24px;
}

/* Persona选项卡片 */
.persona-option {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.persona-option:hover {
    border-color: #10b981;
    transform: translateY(-2px);
}

.persona-option.selected {
    border-color: #10b981;
    background: #f0fdf4;
}

/* 聊天界面 */
.chat-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #1f2937;
    font-size: 18px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fef7e7;
}

.message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 70%;
    line-height: 1.5;
}

.message.user {
    background: #10b981;
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.ai {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-input-container {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    font-size: 16px;
    outline: none;
    resize: none;
    min-height: 48px;
    max-height: 120px;
    font-family: inherit;
}

.chat-input:focus {
    border-color: #10b981;
}

.chat-input:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

.send-btn {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 16px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    align-self: flex-end;
}

.send-btn:hover {
    background: #059669;
}

.send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* 语言切换按钮 */
.language-toggle {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
    color: #1f2937;
    transition: background-color 0.2s;
}

.language-toggle:hover {
    background: #f9fafb;
}

/* 欢迎页和Persona页面的语言切换按钮定位 */
.page:not(.chat-page) .language-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* AI助手卡片 */
.ai-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 24px 0;
}

.star-icon {
    font-size: 24px;
    color: #fbbf24;
}

/* 隐藏/显示页面 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 聊天页面特殊显示 */
.page.active.chat-page {
    display: flex;
    background: #fef7e7;
}

/* 时间显示 */
.current-time {
    font-weight: 600;
}
/* 退出按钮*/
.exit-btn {
    background-color: #e53e3e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
.exit-btn:hover {
    background-color: #c53030;
}

/* --- 系统提示样式 --- */
#system-hint {
  margin: 8px 0 0 8px;
  color: #999;
  font-size: 0.9em;
}
/* ✅ 麦克风按钮样式 */
.mic-btn {
    width: 36px;
    height: 36px;
    border: none;
    background-color: #f3f4f6;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.3s ease;
}

.mic-btn:hover {
    background-color: #e5e7eb;
}

/* ✅ 弹出层遮罩 */
.listening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 默认隐藏 */
.hidden {
    display: none;
}

/* ✅ 弹出内容卡片 */
.listening-card {
    background-color: white;
    border-radius: 12px;
    padding: 24px 32px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: fadeIn 0.2s ease-in-out;
}

/* ✅ 麦克风图标 */
.mic-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

/* ✅ “...”文本 */
.listening-text {
    font-size: 16px;
    margin-bottom: 12px;
    color: #374151;
}

/* ✅ 简单的动画波浪（可选） */
.wave-animation {
    width: 120px;
    height: 10px;
    background: linear-gradient(to right, #93c5fd, #3b82f6, #93c5fd);
    background-size: 200% 100%;
    animation: waveMove 1.5s linear infinite;
    border-radius: 8px;
    margin: 0 auto;
}

@keyframes waveMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ✅ 弹出层淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

