/* BlogBot.css - 基于Figma设计全新重构 */
/* 设计尺寸: 414px x 619px */

/* ==================== CSS变量定义 ==================== */
:root {
    --chat-primary: #8746F8;
    --chat-primary-light: #A39CE9;
    --chat-success: #5CFF33;
    --chat-text-dark: #333333;
    --chat-text-gray: #8D8D8D;
    --chat-text-light: #CACACA;
    --chat-white: #FFFFFF;
    --chat-pink: #FF6BC9;
    --chat-blue: #1A62FF;
    --chat-window-width: 414px;
    --chat-window-height: 619px;
    --chat-border-radius: 35px;
    --chat-shadow: 0px 2px 4px rgba(0, 0, 0, 0.25);
}

/* ==================== 日间/夜间模式基础 ==================== */
[data-theme=light] #chatWindow {
    background: rgba(255,255,255,0.3)!important;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}


/* ==================== 聊天图标样式 ==================== */
#chatIcon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 75px;
    height: 75px;
    border-radius: 100%;
    background: rgba(255,255,255,0.35);
    /* background: transparent; */
    backdrop-filter: blur(5px) saturate(200%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    transition: transform 0.3s ease;
}

.chat-svg-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.3));
}

/* ==================== 主窗口容器 ==================== */
#chatWindow {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: var(--chat-window-width);
    height: var(--chat-window-height);
    display: none;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    resize: both;
    min-width: 300px;
    min-height: 300px;
    border-radius: var(--chat-border-radius);
    box-shadow: var(--chat-shadow);
}

/* 背景容器 */
.chat-window-background {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    border-radius: var(--chat-border-radius);
    overflow: hidden;
    z-index: 0;
}

/* 背景白色底色 */
.chat-window-bg-white {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: white;
    border-radius: var(--chat-border-radius);
    z-index: 1;
}

/* 渐变球容器 */
.chat-window-gradients {
    position: absolute;
    width: 737px;
    height: 481px;
    left: -101px;
    top: -39px;
    z-index: 2;
    pointer-events: none;
    transition: transform 0.1s ease-out;
}

/* 绿色/蓝色渐变球 Ellipse 3 */
.chat-gradient-ellipse-3 {
    position: absolute;
    width: 542px;
    height: 542px;
    left: 299px;
    top: -55px;
    background: radial-gradient(ellipse 50% 50% at 50% 50%, #1A62FF 6%, rgba(215.46, 246.42, 130.32, 0.52) 76%, rgba(255, 255, 255, 0) 100%);
    border-radius: 9999px;
    pointer-events: none;
    will-change: transform;
}

/* 粉色渐变球 Ellipse 2 */
.chat-gradient-ellipse-2 {
    position: absolute;
    width: 584px;
    height: 584px;
    left: -191px;
    top: -166px;
    background: radial-gradient(ellipse 50% 50% at 50% 50%, #FF6BC9 0%, rgba(255, 177.98, 226.76, 0.80) 49%, rgba(255, 255, 255, 0) 100%);
    border-radius: 9999px;
    pointer-events: none;
    will-change: transform;
}

/* 蒙版层 */
.chat-window-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: rgba(237.84, 237.84, 237.84, 0.21);
    border-radius: var(--chat-border-radius);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 3;
}

/* 内容容器 */
.chat-window-content {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 4;
    display: flex;
    flex-direction: column;
}

/* ==================== Header 区域 ==================== */
.chat-header-main {
    position: relative;
    width: calc(100% - 14px);
    height: 55px;
    margin: 7px;
    margin-bottom: 0;
    background: var(--chat-white);
    border-radius: 37px;
    display: flex;
    align-items: center;
    padding: 6px;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Bot头像 */
.chat-header-avatar {
    width: 43px;
    height: 43px;
    border-radius: 9999px;
    border: 2px solid var(--chat-white);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Bot信息容器 */
.chat-header-info {
    display: flex;
    flex-direction: column;
    margin-left: 8px;
    flex: 1;
}

/* Bot名称 */
.chat-header-name {
    font-family: 'DingTalkJinBuTi','Hammersmith One', sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: #000000;
    line-height: 1.2;
    background: black;
    -webkit-background-clip: text;
    background-clip: text;
}

/* Bot状态 */
.chat-header-status {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
}

.chat-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--chat-success);
}

.chat-status-text {
    font-family: 'Inter', sans-serif;
    font-size: 8px;
    font-weight: 400;
    color: var(--chat-success);
    text-transform: lowercase;
}

/* Header按钮组 */
.chat-header-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 4px;
}

.chat-header-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border-radius: 50%;
}

.chat-header-btn:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.chat-header-btn svg,
.chat-header-btn img {
    width: 100%;
    height: 100%;
}

/* ==================== Message Area 消息区域 ==================== */
.message-area-wrapper {
    position: relative;
    flex: 1;
    margin: 8px;
    margin-bottom: 0;
    overflow: hidden;
    border-radius: var(--chat-border-radius);
    display: flex;
    flex-direction: column;
}

/* 消息区域背景图片层 */
.message-area-bg {
    position: absolute;
    bottom: 10px;
    left: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: var(--chat-border-radius);
    filter: blur(0px);
    z-index: 0;
}

/* 消息区域半透明层（现在包含所有内容） */
.message-area-overlay {
    position: relative;
    bottom: 8px;
    top: 1px;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.46);
    border-radius: var(--chat-border-radius);
    backdrop-filter: blur(7.1px);
    -webkit-backdrop-filter: blur(7.1px);
    display: flex;
    flex-direction: column;
    z-index: 1;
    overflow: hidden;
}

/* ==================== Bot Info Area 机器人信息区域 ==================== */
.bot-info-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    flex-shrink: 0;
}

/* Bot头像容器 */
.bot-info-avatar-wrapper {
    position: relative;
    width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bot-info-avatar {
    width: 88px;
    height: 88px;
    border-radius: 9999px;
    border: 3px solid var(--chat-white);
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 条形码容器 */
.bot-info-barcode-wrapper {
    width: 140px;
    height: 41px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* 条形码SVG */
.bot-info-barcode {
    width: 140px;
    height: 35px;
    display: block;
}

.bot-info-barcode svg {
    width: 100%;
    height: 100%;
}

/* Session ID */
.bot-info-session-id {
    font-family: 'Hammersmith One', sans-serif;
    font-size: 9px;
    font-weight: 400;
    text-align: center;
    background: linear-gradient(180deg, rgba(51, 51, 51, 1) 0%, rgba(135, 70, 248, 1) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-top: 4px;
}

/* ==================== 消息列表区域 ==================== */
#messageArea {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 100px;
    scroll-behavior: smooth;
    background: transparent;
}

/* 当bot-info-area在messageArea内部时，使其固定在顶部 */
.message-area-overlay > .bot-info-area + #messageArea {
    padding-top: 0;
}

/* 消息容器布局 */
.message-container {
    display: flex;
    margin-bottom: 15px;
    max-width: 100%;
    opacity: 0;
}

.message-container.robot {
    flex-direction: row;
    align-items: flex-start;
    transform-origin: left center;
    animation: robotMessageAppear 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.message-container.user {
    flex-direction: row-reverse;
    align-items: flex-start;
    transform-origin: right center;
    animation: userMessageAppear 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes robotMessageAppear {
    0% {
        opacity: 0;
        transform: translateX(-20px) scale(0.9);
    }
    70% {
        opacity: 0.9;
        transform: translateX(5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes userMessageAppear {
    0% {
        opacity: 0;
        transform: translateX(20px) scale(0.9);
    }
    70% {
        opacity: 0.9;
        transform: translateX(-5px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* 头像容器 */
.avatar-container {
    position: relative;
    display: inline-block;
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    margin: 0 8px;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.content-container {
    max-width: calc(100% - 60px);
    display: flex;
    flex-direction: column;
}

/* 消息气泡样式 - Figma设计 */
.message-bubble {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    padding: 10px 15px;
    border-radius: 22px;
    word-break: break-word;
    position: relative;
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* 机器人消息气泡 */
.robot .message-bubble {
    background: var(--chat-white);
    color: var(--chat-text-dark);
    border-radius: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 用户消息气泡 */
.user .message-bubble {
    background: linear-gradient(131deg, #A39CE9 0%, #F0EEFF 100%);
    color: var(--chat-text-dark);
    border-radius: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 消息时间戳 */
.message-timestamp {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 8px;
    font-weight: 600;
    color: var(--chat-text-gray);
    margin-top: 4px;
    text-align: right;
}

.robot .message-timestamp {
    text-align: left;
}

/* ==================== Quick Buttons 快捷按钮 ==================== */
.quick-buttons-container {
    height: 38px;
    padding: 0 7px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background: transparent;
    overflow: hidden;
}

/* 当在overlay内部时 */
.message-area-overlay > .quick-buttons-container {
    background: transparent;
}

.quick-button {
    flex: 0 0 auto;
    height: 26px;
    padding: 0 12px;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 10px;
    font-style: italic;
    font-weight: 600;
    border: 1px solid var(--chat-primary);
    border-radius: 51px;
    background: var(--chat-white);
    color: var(--chat-primary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-button:hover {
    background: rgba(135, 70, 248, 0.1);
    transform: translateY(-1px);
}

/* 更多按钮 */
.more-button {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: auto;
}

.more-button:hover {
    background: rgba(135, 70, 248, 0.1);
}

.more-button svg,
.more-button img {
    width: 24px;
    height: 24px;
}

/* ==================== Message Input 输入区域 ==================== */
.message-input-area {
    width: calc(100% - 14px);
    height: 55px;
    margin: 7px;
    margin-top: 0;
    background: var(--chat-white);
    border-radius: 37px;
    display: flex;
    align-items: center;
    padding: 4px;
    box-sizing: border-box;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.25) inset;
    flex-shrink: 0;
}

/* 当在overlay内部时 */
.message-area-overlay > .message-input-area {
    margin-bottom: 0;
}

/* 表情包按钮 */
.emoji-button {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 9px;
}

.emoji-button:hover {
    transform: scale(1.1);
}

.emoji-button svg,
.emoji-button img {
    width: 22px;
    height: 22px;
    opacity: 0.6;
}

/* 输入框 */
.message-input {
    flex: 1;
    height: 100%;
    padding: 0 10px;
    border: none;
    outline: none;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 14px;
    font-style: italic;
    font-weight: 600;
    color: var(--chat-text-dark);
    background: transparent;
}

.message-input::placeholder {
    color: var(--chat-text-light);
}

/* 发送按钮 */
.send-button {
    right: 10px;
    position: fixed;
    width: 70px;
    height: 47px;
    background: var(--chat-primary);
    border: none;
    border-radius: 37px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 20px;
    font-style: italic;
    font-weight: 600;
    color: var(--chat-white);
    transition: all 0.2s ease;
    box-shadow: -1px 1px 2.7px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.send-button img {
    max-width: 35%;
}
.send-button:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* ==================== Tips Area 提示区域 ==================== */
.tips-area {
    width: calc(100% - 14px);
    height: 17px;
    margin: 0 7px 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* 当在overlay内部时 */
.message-area-overlay > .tips-area {
    margin-top: 8px;
}

.tips-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2px 13px;
    background: rgba(255, 255, 255, 0.60);
    border-radius: 41px;
    backdrop-filter: blur(5.7px);
    -webkit-backdrop-filter: blur(5.7px);
}

.tips-text {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 9px;
    font-weight: 600;
    color: #888888;
}

.tips-text em {
    font-style: italic;
}

/* ==================== 滚动条样式 ==================== */
#messageArea::-webkit-scrollbar {
    width: 6px;
}

#messageArea::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
}

#messageArea::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}

#messageArea::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

/* ==================== 打字指示器样式 ==================== */
.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    background: transparent !important;
    box-shadow: none !important;
    min-width: 60px;
}

.typing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 3px;
    background: #a0a0a0;
    animation: typing-dot 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-dot {
    0%, 80%, 100% { transform: scale(0.5); }
    40% { transform: scale(1); }
}

/* ==================== 气泡提示样式 ==================== */
.bubble-tip {
    position: fixed;
    bottom: calc(30px + 60px + 10px);
    right: 30px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #ba5a70;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 2px 15px rgba(0,0,0,0.15);
    z-index: 10000;
    display: none;
    cursor: pointer;
    text-align: center;
    border: 1px solid #ba5a70;
    font-weight: bold;
    transform-origin: bottom right;
    animation: bubbleAppear 0.5s ease-out forwards;
    will-change: transform, opacity;
    backdrop-filter: blur(8px);
    max-width: 200px;
}

.bubble-tip.hide {
    animation: bubbleDisappear 0.5s ease-out forwards;
}

@keyframes bubbleAppear {
    0% { transform: scale(0.5); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes bubbleDisappear {
    0% { transform: scale(1); opacity: 1; }
    50% { opacity: 0.5; }
    100% { transform: scale(0.5); opacity: 0; }
}

/* ==================== 管理员登录表单 ==================== */
.user-login-form {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--chat-white);
    border-radius: 8px;
    padding: 20px;
    margin: 0;
    width: 100%;
    height: 100%;
}

.login-message {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.login-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--chat-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

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

/* ==================== 管理员登录面板（Figma设计） ==================== */
.admin-login-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.50);
    border-radius: 35px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

.admin-login-header {
    position: relative;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-login-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.admin-login-header-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-login-title {
    font-family: 'Hammersmith One', sans-serif;
    font-size: 20px;
    font-weight: 400;
    background: linear-gradient(180deg, #000000 0%, #FFFFFF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    z-index: 1;
}

.admin-login-close-btn {
    position: absolute;
    right: 11px;
    top: 11px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    z-index: 2;
}

.admin-login-close-btn:hover {
    transform: scale(1.1);
}

.admin-login-close-btn img {
    width: 100%;
    height: 100%;
}

.admin-login-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.admin-login-avatar-wrapper {
    margin-top: 20px;
    margin-bottom: 20px;
}

.admin-login-avatar {
    width: 88px;
    height: 88px;
    border-radius: 9999px;
    border: 3px solid white;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-login-info-area {
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-input-wrapper {
    position: relative;
    width: 100%;
    height: 27px;
    background: white;
    border-radius: 25px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.admin-input-icon {
    width: 27px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-input-icon img {
    width: 100%;
    height: 100%;
}

.admin-input-field {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    padding: 0 10px;
}

.admin-input-field::placeholder {
    color: #aaa;
}

.password-toggle-icon {
    width: 18px;
    height: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
    flex-shrink: 0;
}

.password-toggle-icon img {
    width: 100%;
    height: 100%;
}

.admin-login-btn {
    margin-top: 25px;
    width: 175px;
    height: 36px;
    background: #8746F8;
    border: none;
    border-radius: 82px;
    cursor: pointer;
    font-family: 'Hammersmith One', sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: white;
    transition: all 0.2s ease;
}

.admin-login-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.admin-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.admin-login-message {
    margin-top: 15px;
    padding: 10px 15px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 10px;
    color: #f44336;
    font-size: 13px;
    text-align: center;
}

/* ==================== 按钮Active状态 ==================== */
.chat-admin-btn.admin-btn-active {
    background: rgba(135, 70, 248, 0.2);
}

.chat-log-btn.log-btn-active {
    background: rgba(135, 70, 248, 0.2);
}

/* ==================== 系统消息样式 ==================== */
.system-message {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin: 10px 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(0,0,0,0.05);
    word-break: break-word;
    line-height: 1.4;
}

/* ==================== 聊天界面 ==================== */
.chat-interface {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
}

/* ==================== 管理员徽章 ==================== */
.admin-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(45deg, var(--chat-primary), #ff6b6b);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 10;
    white-space: nowrap;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.admin-mode-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #f44336;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    z-index: 10;
    white-space: nowrap;
    font-weight: bold;
    display: none;
}

/* ==================== 管理员登录面板激活状态 ==================== */
.admin-login-panel.active {
    display: flex !important;
}

/* ==================== 返回链接（已弃用，保留兼容） ==================== */
.switch-to-user-link {
    display: none;
}

/* ==================== 错误弹窗 ==================== */
.admin-error-popup {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #ff6b6b, #f44336);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: fadeInPopup 0.3s ease-in-out;
    font-size: 14px;
    font-weight: 500;
}

.admin-error-popup.fade-out {
    animation: fadeOutPopup 0.3s ease-in-out;
}

@keyframes fadeInPopup {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeOutPopup {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, -20px); }
}

/* ==================== Markdown渲染样式 ==================== */
.message-bubble.markdown-content {
    padding: 12px 16px;
    line-height: 1.6;
    white-space: normal;
}

.markdown-content h1, .markdown-content h2, .markdown-content h3,
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
    margin: 0.5em 0 0.3em 0;
    font-weight: 600;
    line-height: 1.4;
    color: #2c3e50;
}

.markdown-content h1 { font-size: 1.4em; border-bottom: 1px solid #eaecef; padding-bottom: 0.3em; }
.markdown-content h2 { font-size: 1.25em; border-bottom: 1px solid #eaecef; padding-bottom: 0.3em; }
.markdown-content h3 { font-size: 1.1em; }
.markdown-content h4 { font-size: 1em; }

.markdown-content p { margin: 0.5em 0; line-height: 1.6; }
.markdown-content p:first-child { margin-top: 0; }
.markdown-content p:last-child { margin-bottom: 0; }

.markdown-content strong { font-weight: 600; color: #1a1a1a; }
.markdown-content em { font-style: italic; }
.markdown-content del { text-decoration: line-through; color: #999; }

.markdown-content code:not(pre code) {
    background: rgba(175, 184, 193, 0.2);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: #c7254e;
}

.markdown-content pre {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0.8em 0;
    overflow-x: auto;
    position: relative;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.85em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: #d4d4d4;
    line-height: 1.5;
    display: block;
    white-space: pre;
}

.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.markdown-content pre:hover .code-copy-btn { opacity: 1; }
.code-copy-btn:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.code-copy-btn.copied { background: #28a745; color: #fff; border-color: #28a745; }

.markdown-content blockquote {
    margin: 0.8em 0;
    padding: 0.5em 1em;
    border-left: 4px solid var(--chat-primary);
    background: rgba(135, 70, 248, 0.08);
    border-radius: 0 6px 6px 0;
    color: #555;
}

.markdown-content blockquote p { margin: 0.3em 0; }
.markdown-content blockquote blockquote { margin-top: 0.5em; }

.markdown-content ul, .markdown-content ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.markdown-content li { margin: 0.25em 0; line-height: 1.6; }
.markdown-content li > ul, .markdown-content li > ol { margin: 0.2em 0; }

.markdown-content ul.contains-task-list {
    list-style: none;
    padding-left: 0;
}

.markdown-content .task-list-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
}

.markdown-content .task-list-item input[type="checkbox"] {
    margin-top: 0.35em;
    pointer-events: none;
}

.markdown-content a {
    color: var(--chat-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.markdown-content a:hover {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 0.5em 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8em 0;
    font-size: 0.9em;
    overflow-x: auto;
    display: block;
}

.markdown-content thead { background: linear-gradient(135deg, #f6f8fa, #eef2f7); }
.markdown-content th, .markdown-content td { padding: 8px 12px; border: 1px solid #e1e4e8; text-align: left; }
.markdown-content th { font-weight: 600; color: #24292e; }
.markdown-content tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.02); }
.markdown-content tbody tr:hover { background: rgba(135, 70, 248, 0.05); }
.markdown-content hr { border: none; border-top: 2px solid #eaecef; margin: 1em 0; }

/* ==================== 可点击文本样式 ==================== */
.BlogBot-clickable-text {
    color: white;
    background: linear-gradient(135deg, var(--chat-primary), #ff6b6b);
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    display: inline-block;
    margin: 5px 2px;
    transition: all 0.2s ease;
    text-decoration: none;
    border-bottom: 2px solid var(--chat-primary);
}

.BlogBot-clickable-text:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(135, 70, 248, 0.4);
}

/* ==================== 图片样式 ==================== */
.message-image {
    transition: transform 0.3s;
    cursor: pointer;
    max-width: 200px;
    max-height: 250px;
    border-radius: 10px;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: block;
    margin: 5px 0;
}

.message-image.zoomed {
    transform: scale(2);
    z-index: 1000;
    position: relative;
    border-color: var(--chat-primary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* ==================== 转发消息样式 ==================== */
.forward-preview-container {
    width: 65%;
    border: 1px solid #ffffff;
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    background-color: #f9f9f9;
    cursor: pointer;
}

.forward-preview-container:hover { background-color: #f0f0f0; }

.forward-preview-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.forward-nodes-container { max-height: 150px; overflow: hidden; }
.forward-preview-node { display: flex; align-items: center; margin: 6px 0; }
.forward-preview-avatar { width: 20px; height: 20px; border-radius: 50%; margin-right: 8px; }
.forward-preview-text {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forward-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.forward-detail-content {
    background-color: white;
    border-radius: var(--chat-border-radius);
    width: 80%;
    max-width: 500px;
    max-height: 80%;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
}

.forward-detail-close {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    color: #999;
}

.forward-detail-close img {
    width: 25px;
} 
.forward-detail-close:hover { color: #333; }
.forward-detail-node { margin-bottom: 20px; }
.forward-detail-header { display: flex; align-items: center; margin-bottom: 8px; }
.forward-detail-avatar { width: 30px; height: 30px; border-radius: 50%; margin-right: 8px; }
.forward-detail-name { font-weight: bold; }
.forward-detail-messages { margin-left: 38px; }

.forward-detail-messages .message-bubble {
    background-color: #e6f7ff;
    border-radius: 18px;
    padding: 8px 16px;
    margin: 4px 0;
    display: inline-block;
    max-width: 80%;
}

.forward-detail-messages .message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin: 4px 0;
}

/* ==================== 系统消息Log面板样式 ==================== */
.chat-log-panel {
    position: absolute;
    top: 0px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.50);
    border-radius: 35px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.chat-log-header {
    width: 414px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 21px;
    position: relative;
    flex-shrink: 0;
}

.chat-log-title {
    font-family: 'Hammersmith One', sans-serif;
    font-size: 20px;
    font-weight: 400;
    background: linear-gradient(180deg, #000000 0%, #FFFFFF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.chat-log-close {
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.chat-log-close:hover {
    transform: scale(1.1);
}

.chat-log-close img {
    width: 100%;
    height: 100%;
}

.chat-log-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px 21px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-log-empty {
    text-align: center;
    color: var(--chat-text-gray);
    font-size: 14px;
    padding: 20px;
}

.chat-log-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.chat-log-avatar {
    flex-shrink: 0;
}

.chat-log-avatar img {
    width: 35px;
    height: 35px;
    border-radius: 9999px;
    object-fit: cover;
}

.chat-log-bubble-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.chat-log-bubble {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    padding: 10px 14px;
    background: #8746F8;
    color: white;
    border-radius: 22px;
    display: inline-block;
    max-width: calc(100% - 60px);
    word-break: break-word;
}

.chat-log-timestamp {
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 8px;
    font-weight: 600;
    color: var(--chat-text-gray);
    margin-left: auto;
}


/* ==================== 更多按钮下拉菜单 ==================== */
.more-button-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10002;
    backdrop-filter: blur(4px);
}

.more-button-tooltip.show { opacity: 1; }

.more-button-dropdown {
    position: fixed;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(135, 70, 248, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10001;
    min-width: 150px;
    display: none;
}

.more-button-dropdown.show { display: block; }

.more-button-dropdown .quick-button {
    display: block;
    width: 100%;
    max-width: none;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: none;
    text-align: left;
}

.more-button-dropdown .quick-button:last-child { border-bottom: none; }
.more-button-dropdown .quick-button:hover { transform: none; background: rgba(135, 70, 248, 0.1); }

/* ==================== 调整大小相关 ==================== */
.resize-handle { display: none; }

.resize-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 10000;
    background: transparent;
}

.resize-tl { top: 0; left: 0; cursor: nw-resize; }
.resize-tr { top: 0; right: 0; cursor: ne-resize; }
.resize-bl { bottom: 0; left: 0; cursor: sw-resize; }
.resize-br { bottom: 0; right: 0; cursor: se-resize; }

/* ==================== 竖屏样式 ==================== */
@media only screen and (orientation: portrait) {
    #chatWindow {
        width: 70% !important;
        right: 5% !important;
        bottom: 120px;
        height: 50%;
        min-width: unset;
        min-height: unset;
    }

    #chatIcon { width: 75px; bottom: 50px; }

    .message-input { padding: 8px; }
    
    .message-bubble {
        font-size: 10px;
        line-height: 1.4;
        padding: 10px 15px;
    }
    
    .user-login-form, .admin-login-form { padding: 15px; margin: 10px; }
    
    .login-button, .admin-login-button,
    .user-login-form input, .admin-login-form input {
        width: 90%;
        padding: 8px 12px;
    }
    
    .bot-info-avatar { width: 70px; height: 70px; }
}

@media (max-width: 480px) {
    .bubble-tip {
        right: 15px;
        bottom: calc(20px + 50px + 10px);
        max-width: 160px;
    }
    
    #chatWindow { width: 90% !important; right: 5% !important; }
    
    .chat-header-name { font-size: 16px; }
    
    .quick-button { padding: 4px 8px; font-size: 11px; min-width: 50px; }
    
    .message-input { padding: 8px 12px; font-size: 13px; }
    
    .send-button { padding: 8px 15px; min-width: 50px; font-size: 13px; }
}

/* ==================== 欢迎消息样式 ==================== */
.welcome-message {
    font-size: 12px;
    color: #666;
    text-align: center;
    padding: 10px;
    margin: 0 20px;
    border-radius: 10px;
    line-height: 1.5;
    background: rgba(0,0,0,0.05);
}

/* ==================== 状态颜色 ==================== */
.status-connected { color: var(--chat-success) !important; }
.status-disconnected { color: #f56565 !important; }
.status-connecting { color: #ed8936 !important; }
.status-error { color: #fc8181 !important; }
