/* ============================================
   豆包风格覆写 - 佛心AI Web 版
   只在现有 styles.css 基础上覆盖关键样式
   ============================================ */

/* ---------- 全局重置 ---------- */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #F5F5F5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- 顶部栏（豆包风格） ---------- */
.doubao-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    z-index: 100;
    border-bottom: 0.5px solid #F0F0F0;
}
.doubao-topbar .menu-btn {
    width: 40px;
    height: 40px;
    margin-left: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: none;
    color: #1A1A1A;
    font-size: 20px;
}
.doubao-topbar .topbar-right {
    margin-left: auto;
    margin-right: 12px;
    display: flex;
    gap: 4px;
}
.doubao-topbar .topbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: none;
    color: #666;
    font-size: 16px;
}

/* ---------- 隐藏原来不需要的元素 ---------- */
.chat-section h1 {
    display: none !important;
}
.settings-btn,
.volume-btn {
    display: none !important;
}

/* ---------- 容器 ---------- */
.container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 48px; /* 给固定顶栏留空间 */
}
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* ---------- 聊天消息区域 ---------- */
.chat-box {
    flex: 1;
    height: auto !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 12px 16px !important;
    margin-bottom: 0 !important;
    background: #FFFFFF !important;
    overflow-y: auto;
}
.chat-message {
    margin-bottom: 12px;
    padding: 0;
    border: none;
    background: none;
    border-radius: 0;
    user-select: none;
}
.chat-message.selected {
    background-color: transparent;
    user-select: text;
}
.chat-message strong {
    display: none; /* 隐藏 "AI:" / "你:" 标签 */
}

/* AI消息气泡 */
.chat-message.ai-message .msg-bubble {
    display: inline-block;
    max-width: 75%;
    background: #F0F0F0;
    color: #1A1A1A;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
    word-break: break-word;
    float: left;
    clear: both;
}

/* 用户消息气泡 */
.chat-message.user-message .msg-bubble {
    display: inline-block;
    max-width: 75%;
    background: #FFFFFF;
    color: #1A1A1A;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
    word-break: break-word;
    border: 1px solid #F0F0F0;
    float: right;
    clear: both;
}

/* 欢迎消息不显示泡泡形式 */
.chat-box > .chat-message:first-child .msg-bubble {
    background: none;
    border: none;
    padding: 0;
    color: #999;
    font-size: 13px;
    text-align: center;
    float: none;
    display: block;
    margin: 20px 0;
}
.chat-box > .chat-message:first-child strong {
    display: none;
}

/* 消息菜单（右键菜单） */
.message-menu {
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important;
    overflow: hidden;
}

/* ---------- 快捷功能卡片 ---------- */
.quick-links {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    background: #FFFFFF;
    scrollbar-width: none;
    border-top: 0.5px solid #F0F0F0;
}
.quick-links::-webkit-scrollbar {
    display: none;
}
.quick-links a {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    background: #FFFFFF;
    border: 0.5px solid #E8E8E8;
    border-radius: 18px;
    color: #1A1A1A !important;
    font-size: 13px;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.2s;
}
.quick-links a:hover {
    background: #F5F5F5;
}
.quick-links a.generator-link {
    background: #FFFFFF;
    border-color: #E8E8E8;
    color: #1A1A1A !important;
}
.quick-links a.generator-link:hover {
    background: #F5F5F5;
}
.quick-links a.clear-link {
    background: #FFFFFF;
    border-color: #E8E8E8;
    color: #1A1A1A !important;
}
.quick-links a.clear-link:hover {
    background: #F5F5F5;
}

/* ---------- 语音合成勾选框 ---------- */
.speech-checkbox-container {
    display: none !important; /* 始终隐藏 */
}

/* ---------- 输入区域 ---------- */
.input-area {
    padding: 4px 16px 4px 16px;
    background: #FFFFFF;
}
.input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F5F5F5;
    border-radius: 20px;
    padding: 2px 4px 2px 14px;
    height: 40px;
}
.input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 14px;
    color: #1A1A1A;
    outline: none;
    resize: none;
    line-height: 1.4;
    max-height: 80px;
    font-family: inherit;
}
.input-wrapper textarea::placeholder {
    color: #999;
}
.input-wrapper #sendBtn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #1A8CFF;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}
.input-wrapper #recordBtn {
    display: none; /* 语音按钮移到中间 */
}

/* ---------- 底部语音按钮（豆包风格·文字版） ---------- */
.doubao-voice-btn {
    height: 34px;
    padding: 0 28px;
    border-radius: 17px;
    border: none;
    background: #F0F0F0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 6px auto 10px auto;
    font-size: 13px;
    color: #1A1A1A;
    transition: background 0.2s;
    font-family: inherit;
}
.doubao-voice-btn:hover {
    background: #E0E0E0;
}
.doubao-voice-btn:active {
    background: #CCC;
}

/* ---------- 登录弹窗（豆包风格） ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.show {
    display: flex;
}
.modal-content {
    width: 90%;
    max-width: 340px;
    background: white;
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    position: relative;
}
.modal-content .close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}
.modal-content .close-btn:hover {
    color: #333;
}
.modal-content h2 {
    text-align: center;
    font-size: 20px;
    color: #1A1A1A;
    margin: 0 0 20px 0;
    font-weight: 600;
}

/* 登录/注册表单 */
.login-form .form-group {
    margin-bottom: 14px;
}
.login-form label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}
.login-form input[type="text"],
.login-form input[type="password"],
.login-form input[type="number"] {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #E8E8E8;
    border-radius: 10px;
    font-size: 14px;
    color: #1A1A1A;
    outline: none;
    box-sizing: border-box;
    background: #F5F5F5;
    transition: border-color 0.2s;
}
.login-form input:focus {
    border-color: #1A8CFF;
    background: white;
}
.login-form .code-group {
    display: flex;
    gap: 8px;
}
.login-form .code-group input {
    flex: 1;
}
.login-form .code-group button {
    width: 90px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: #F0F0F0;
    color: #1A8CFF;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}
.login-form .code-group button:hover {
    background: #E0E0E0;
}
.login-btn {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: #1A8CFF;
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s;
}
.login-btn:hover {
    background: #0D7AE8;
}
.login-btn:disabled {
    background: #CCC;
}

/* 登录标签页 */
.login-tabs {
    display: flex;
    margin-bottom: 16px;
    border-bottom: 1px solid #F0F0F0;
}
.login-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
    color: #999;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}
.login-tab.active {
    color: #1A8CFF;
}
.login-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: #1A8CFF;
    border-radius: 3px;
}

/* 登录底部链接 */
.login-footer {
    text-align: center;
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 24px;
}
.login-footer a {
    color: #666;
    font-size: 13px;
    text-decoration: none;
}
.login-footer a:hover {
    color: #1A8CFF;
}

/* ---------- 设置面板 ---------- */
.settings-panel {
    display: none;
}
