/* AI助手页面样式 */
.ai-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.ai-header {
    text-align: center;
    margin-bottom: 24px;
}
.ai-header h1 {
    font-size: 28px;
    color: #1e293b;
    margin-bottom: 8px;
}
.ai-header p {
    color: #64748b;
    font-size: 14px;
}
.ai-chat-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    height: 80vh;
    min-height: 600px;
    width: 100%;
}
.ai-chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
}
.ai-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}
.ai-top-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ai-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ai-points-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ai-free-tag {
    background: rgba(255,255,255,0.25);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 4px;
}
.ai-login-tip {
    background: #10b981;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}
.ai-login-tip:hover {
    background: #059669;
    color: #fff;
}
.ai-scene-tabs {
    display: flex;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}
.ai-scene-tab {
    flex: 1;
    padding: 14px 16px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}
.ai-scene-tab:hover {
    color: #667eea;
    background: #f1f5f9;
}
.ai-scene-tab.active {
    color: #667eea;
    background: #fff;
    border-bottom-color: #667eea;
    font-weight: 600;
}
.ai-scene-tab .icon {
    margin-right: 4px;
}
.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
}
.ai-message {
    display: flex;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.ai-message.user {
    justify-content: flex-end;
}
.ai-message .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    overflow: hidden;
}
.ai-message.assistant .avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    margin-right: 10px;
}
.ai-message.user .avatar {
    background: #e2e8f0;
    margin-left: 10px;
}
.ai-message .bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.7;
    word-wrap: break-word;
}
.ai-message.assistant .bubble {
    background: #fff;
    color: #334155;
    border-top-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ai-message.user .bubble {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-top-right-radius: 4px;
}
.ai-message .bubble img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
}
.ai-message .meta {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ai-message .meta .model-tag {
    background: #eef2ff;
    color: #6366f1;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
}
.ai-message .meta .upgrade-tag {
    background: #fef3c7;
    color: #d97706;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
}
.ai-message .meta .msg-time {
    color: #94a3b8;
    font-size: 11px;
    margin-left: 4px;
}
.ai-message .feedback {
    display: inline-flex;
    gap: 4px;
    margin-left: auto;
}
.ai-message .feedback button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.5;
    transition: all 0.2s;
}
.ai-message .feedback button:hover {
    opacity: 1;
    background: #f1f5f9;
}
.ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}
.ai-typing span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}
.ai-input-area {
    border-top: 1px solid #f1f5f9;
    padding: 16px;
    background: #fff;
}
.ai-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.ai-input-wrapper {
    flex: 1;
    position: relative;
}
.ai-input {
    width: 100%;
    min-height: 44px;
    max-height: 120px;
    padding: 10px 40px 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}
.ai-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.ai-image-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    border-radius: 6px;
    opacity: 0.6;
    transition: all 0.2s;
}
.ai-image-btn:hover {
    opacity: 1;
    background: #f1f5f9;
}
.ai-send-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    padding: 0 24px;
    height: 44px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.ai-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}
.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.ai-stop-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    padding: 0 24px;
    height: 44px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.ai-stop-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239,68,68,0.4);
}
.ai-stop-btn:active {
    transform: translateY(0);
}
.ai-image-preview {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.ai-image-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.ai-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ai-image-item .remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
}
.ai-quick-questions {
    padding: 12px 20px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ai-quick-btn {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.ai-quick-btn:hover {
    background: #eef2ff;
    color: #6366f1;
}
.ai-welcome {
    text-align: center;
    padding: 20px 20px 40px;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.welcome-girl-container {
    position: relative;
    width: 240px;
    height: 300px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.welcome-girl-svg {
    overflow: visible;
}
/* 整体浮动 */
.girl-float {
    animation: girlFloat 4s ease-in-out infinite;
}
@keyframes girlFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}
/* 头部歪头 */
.head-tilt {
    animation: headTilt 5s ease-in-out infinite;
}
@keyframes headTilt {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(1deg); }
}
/* 眨眼 */
.eyes-blink {
    animation: eyesBlink 4s ease-in-out infinite;
}
@keyframes eyesBlink {
    0%, 92%, 100% { transform: scaleY(1); }
    95%, 97% { transform: scaleY(0.1); }
}
/* 挥手 */
.hand-wave {
    animation: handWave 2.5s ease-in-out infinite;
}
@keyframes handWave {
    0%, 100% { transform: rotate(-8deg); }
    50% { transform: rotate(12deg); }
}
/* 爱心发光 */
.heart-glow {
    animation: heartGlow 2s ease-in-out infinite;
}
@keyframes heartGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}
/* 左马尾飘动 */
.hair-left {
    animation: hairLeft 3.5s ease-in-out infinite;
}
@keyframes hairLeft {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(2deg); }
}
/* 右马尾飘动 */
.hair-right {
    animation: hairRight 3.5s ease-in-out infinite;
}
@keyframes hairRight {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-2deg); }
}
.ai-welcome h3 {
    color: #64748b;
    margin-bottom: 8px;
    font-size: 18px;
}
.ai-welcome p {
    font-size: 13px;
}
.ai-welcome .ai-disclaimer {
    margin-top: 10px;
    font-size: 12px;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    line-height: 1.6;
}
/* 历史会话侧边栏 */
.ai-history-toggle {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}
.ai-history-toggle:hover {
    opacity: 1;
    background: #f1f5f9;
}
.ai-history-panel {
    width: 280px;
    background: #fff;
    border-right: 1px solid #f1f5f9;
    transition: width 0.3s ease;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}
.ai-history-panel:not(.open) {
    width: 0;
    border-right: none;
}
.ai-history-header {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ai-history-header h4 {
    margin: 0;
    font-size: 14px;
    color: #1e293b;
}
.ai-history-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #94a3b8;
}
.ai-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.ai-history-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.2s;
}
.ai-history-item:hover {
    background: #f1f5f9;
}
.ai-history-item.active {
    background: #eef2ff;
}
.ai-history-item .title {
    font-size: 13px;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.ai-history-item .meta {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
}
.ai-history-item .delete {
    opacity: 0;
    color: #ef4444;
    font-size: 12px;
}
.ai-history-item:hover .delete {
    opacity: 1;
}
.ai-new-chat-btn {
    margin: 12px;
    padding: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
}
/* 思考步骤卡片 */
.think-steps { padding: 4px 0; }
.think-step { padding: 6px 10px; margin: 4px 0; font-size: 13px; color: #6b7280; border-radius: 6px; background: #f9fafb; }
.think-step.active { color: #374151; background: #eff6ff; }
.think-step .spinner { display: inline-block; width: 10px; height: 10px; border: 2px solid #3b82f6; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 6px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.think-content { font-size: 14px; line-height: 1.7; color: #1f2937; }

/* 模式切换条 */
.ai-mode-switch {
    display: flex;
    gap: 12px;
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    flex-direction: row;
}
.ai-mode-item {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    flex-direction: row;
    justify-content: flex-start;
}
.ai-mode-item:hover {
    border-color: #93c5fd;
    background: #f0f9ff;
}
.ai-mode-item.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}
.ai-mode-item .mode-icon {
    font-size: 16px;
    flex-shrink: 0;
}
.ai-mode-item .mode-name {
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
}
.ai-mode-item .mode-cost {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.ai-mode-item.active .mode-cost {
    background: #dbeafe;
    color: #3b82f6;
}
