/* ==================== Live2D AI 助手样式 ==================== */

/* 主容器 - 确保可以接收点击事件 */
.live2d-assistant {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 10000;
    font-family: 'Zpix', 'Rajdhani', sans-serif;
    cursor: pointer !important; /* 覆盖全局的 cursor: none */
    user-select: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 确保子元素也可以接收点击 */
.live2d-assistant * {
    cursor: pointer !important;
}

/* 拖拽状态 */
.live2d-assistant.dragging {
    cursor: grabbing !important;
    transform: scale(1.05);
    filter: drop-shadow(0 10px 40px rgba(0, 255, 249, 0.6));
}

.live2d-assistant.dragging * {
    cursor: grabbing !important;
}
    user-select: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 拖拽状态 */
.live2d-assistant.dragging {
    cursor: grabbing;
    transform: scale(1.05);
    filter: drop-shadow(0 10px 40px rgba(0, 255, 249, 0.6));
}

.live2d-assistant.dragging .pixel-character {
    animation: none;
}

.live2d-assistant.dragging .character-face {
    animation: none;
}

/* ==================== 像素小人 ==================== */
.pixel-character {
    width: 120px;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
}

.pixel-character:hover {
    transform: translateY(-5px);
}

.pixel-character:active {
    transform: scale(0.95);
}

/* 角色身体 */
.character-body {
    width: 100px;
    height: 90px;
    margin: 0 auto;
    position: relative;
    image-rendering: pixelated;
}

/* 脸部 - 像素团子风格 */
.character-face {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #00fff9 0%, #bf00ff 100%);
    border: 4px solid #0a0e27;
    border-radius: 8px; /* 方形，更像素风 */
    position: relative;
    box-shadow:
        0 0 20px rgba(0, 255, 249, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    margin: 0 auto;
    animation: float 3s ease-in-out infinite;
    /* 像素网格效果 */
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.1) 3px, rgba(0, 0, 0, 0.1) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(0, 0, 0, 0.1) 3px, rgba(0, 0, 0, 0.1) 4px);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 移除史莱姆抖动动画 */
@keyframes slimeJiggle {
    /* 保留空动画，避免报错 */
}

/* 眼睛 - 竖长条像素风 */
.eye {
    width: 6px; /* 很窄的竖条 */
    height: 20px; /* 比较长 */
    background: #0a0e27;
    border-radius: 2px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    box-shadow:
        inset 0 0 4px rgba(0, 0, 0, 0.5),
        0 0 4px rgba(0, 255, 249, 0.3);
}

.eye-left {
    left: 22px;
}

.eye-right {
    right: 22px;
}

@keyframes blink {
    0%, 90%, 100% {
        height: 20px;
    }
    95% {
        height: 2px;
    }
}
    95% {
        height: 2px;
    }
}

/* 嘴巴 - 隐藏 */
.mouth {
    display: none;
}

/* 表情 - 开心 */
.expression-happy .mouth {
    display: none;
}

/* 表情 - 说话 */
.expression-talking .mouth {
    display: none;
}

@keyframes talking {
    0%, 100% {
        height: 8px;
    }
    50% {
        height: 15px;
    }
}

/* 表情 - 思考 */
.expression-thinking .eye {
    animation: thinking 1s ease-in-out infinite;
}

@keyframes thinking {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(3px);
    }
}

/* 身体主体 - 已移除，改为史莱姆风格 */

/* 名字 */
.character-name {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #00fff9;
    margin-top: 8px;
    text-shadow: 0 0 10px rgba(0, 255, 249, 0.5);
    letter-spacing: 2px;
}

/* 状态指示器 */
.status-indicator {
    position: absolute;
    top: -5px;
    right: 0;
    background: rgba(10, 14, 39, 0.9);
    border: 2px solid #00fff9;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 10px;
    color: #00fff9;
    box-shadow: 0 0 10px rgba(0, 255, 249, 0.5);
}

.status-indicator.thinking {
    border-color: #ffbe0b;
    color: #ffbe0b;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 190, 11, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 190, 11, 0.8);
    }
}

/* ==================== 对话面板 ==================== */
.chat-panel {
    position: absolute;
    right: 140px;
    bottom: 0;
    width: 420px;
    height: 650px;
    background: rgba(10, 14, 39, 0.95);
    border: 3px solid #00fff9;
    border-radius: 16px;
    box-shadow:
        0 0 30px rgba(0, 255, 249, 0.5),
        inset 0 0 30px rgba(0, 255, 249, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 当聊天框在左侧时的动画 */
.chat-panel[style*="left: -440px"] {
    transform: translateX(-20px);
}

.chat-panel.open {
    opacity: 1 !important;
    transform: translateX(0) !important;
    pointer-events: all !important;
}

/* 对话框头部 */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 2px solid #00fff9;
    background: rgba(0, 255, 249, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00fff9, #bf00ff);
    border: 2px solid #00fff9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #0a0e27;
    font-size: 16px;
    box-shadow: 0 0 15px rgba(0, 255, 249, 0.5);
}

.header-info {
    flex: 1;
}

.header-name {
    font-size: 16px;
    font-weight: 700;
    color: #00fff9;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.header-status {
    font-size: 12px;
    color: var(--text-secondary, #888);
}

.btn-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 2px solid #ff6b6b;
    border-radius: 6px;
    color: #ff6b6b;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-close:hover {
    background: #ff6b6b;
    color: #0a0e27;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.5);
}

/* 消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: #00fff9 transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #00fff9;
    border-radius: 3px;
}

/* 消息气泡 */
.message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
}

.message.user .message-content {
    background: linear-gradient(135deg, #00fff9 0%, #00d4d4 100%);
    color: #0a0e27;
    border-bottom-right-radius: 4px;
    box-shadow: 0 0 15px rgba(0, 255, 249, 0.3);
}

.message.assistant .message-content {
    background: rgba(191, 0, 255, 0.15);
    border: 1px solid rgba(191, 0, 255, 0.3);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: var(--text-secondary, #888);
    margin-top: 4px;
    padding: 0 4px;
}

.message.user .message-time {
    text-align: right;
}

/* 思考中占位符 */
.thinking-placeholder .message-content {
    padding: 12px 20px;
}

.thinking-dots {
    display: inline-flex;
    gap: 4px;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    background: #00fff9;
    border-radius: 50%;
    animation: thinkingDot 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinkingDot {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 内容卡片 */
.content-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.content-card {
    background: rgba(0, 255, 249, 0.05);
    border: 1px solid rgba(0, 255, 249, 0.3);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.content-card:hover {
    background: rgba(0, 255, 249, 0.1);
    border-color: #00fff9;
    box-shadow: 0 0 15px rgba(0, 255, 249, 0.3);
    transform: translateX(5px);
}

.card-title {
    font-weight: 700;
    color: #00fff9;
    margin-bottom: 6px;
    font-size: 14px;
}

.card-author {
    font-size: 12px;
    color: #bf00ff;
    margin-bottom: 6px;
}

.card-preview {
    font-size: 13px;
    color: var(--text-primary, #fff);
    line-height: 1.5;
    margin-bottom: 8px;
}

.card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary, #888);
}

/* 快捷操作 */
.quick-actions {
    padding: 12px 20px;
    border-top: 1px solid rgba(0, 255, 249, 0.2);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 6px 12px;
    background: rgba(0, 255, 249, 0.1);
    border: 1px solid rgba(0, 255, 249, 0.3);
    border-radius: 16px;
    color: #00fff9;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Zpix', sans-serif;
}

.quick-btn:hover {
    background: rgba(0, 255, 249, 0.2);
    border-color: #00fff9;
    box-shadow: 0 0 10px rgba(0, 255, 249, 0.3);
}

/* 输入框容器 */
.chat-input-container {
    padding: 16px 20px;
    border-top: 2px solid #00fff9;
    display: flex;
    gap: 10px;
    background: rgba(0, 255, 249, 0.03);
}

.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 255, 249, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    font-family: 'Zpix', sans-serif;
    outline: none;
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: #00fff9;
    box-shadow: 0 0 15px rgba(0, 255, 249, 0.2);
}

.chat-input::placeholder {
    color: var(--text-secondary, #888);
}

.btn-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #00fff9, #00d4d4);
    border: none;
    border-radius: 8px;
    color: #0a0e27;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 255, 249, 0.3);
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 249, 0.5);
}

.btn-send:active {
    transform: scale(0.95);
}

/* 表情符号 */
.emoji {
    font-size: 16px;
    margin: 0 2px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .live2d-assistant {
        right: 15px;
        bottom: 15px;
    }

    .pixel-character {
        width: 100px;
    }

    .character-body {
        width: 80px;
        height: 100px;
    }

    .character-face {
        width: 60px;
        height: 60px;
    }

    .chat-panel {
        width: calc(100vw - 130px);
        max-width: 380px;
        height: 550px;
        right: 120px;
    }

    .quick-actions {
        padding: 10px 15px;
    }

    .quick-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .chat-panel {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        top: auto;
        width: 100%;
        height: 70vh;
        border-radius: 16px 16px 0 0;
        border-bottom: none;
    }

    .pixel-character {
        width: 80px;
    }
}

/* ==================== 暗色模式适配 ==================== */
body.light-theme .chat-panel {
    background: rgba(255, 255, 255, 0.95);
    border-color: #00d4d4;
}

body.light-theme .message.assistant .message-content {
    background: rgba(191, 0, 255, 0.08);
    color: #0a0e27;
}

body.light-theme .chat-input {
    background: rgba(255, 255, 255, 0.5);
    color: #0a0e27;
}
