* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #242836;
    --bg-card: #252a3a;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #374151;
    --user-message-bg: #6366f1;
    --ai-message-bg: #242836;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    margin-bottom: 8px;
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.sidebar-header .logo svg {
    color: var(--primary-color);
}

.new-chat-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.new-chat-btn:hover {
    background-color: var(--bg-card);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

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

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

.chat-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 4px;
}

.chat-item:hover {
    background-color: var(--bg-tertiary);
}

.chat-item:hover .chat-delete-btn {
    opacity: 1;
}

.chat-item.active {
    background-color: rgba(99, 102, 241, 0.15);
}

.chat-item.active .chat-icon {
    background-color: var(--primary-color);
}

.chat-delete-btn {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background-color: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.chat-delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    opacity: 1;
}

.chat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-preview {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.sidebar-footer {
    padding: 8px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.user-info-sidebar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background-color: var(--bg-tertiary);
    margin-bottom: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-points {
    font-size: 12px;
    color: #fbbf24;
    margin-top: 1px;
}

.sidebar-btn {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background-color: transparent;
    color: var(--text-secondary);
    text-align: left;
    margin-bottom: 4px;
}

.sidebar-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.message-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.message-container::-webkit-scrollbar {
    width: 6px;
}

.message-container::-webkit-scrollbar-track {
    background: transparent;
}

.message-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    flex: 1;
}

.welcome-icon {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.welcome-message h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.welcome-message p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.welcome-tips {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
    text-align: left;
    max-width: 480px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background-color: rgba(99, 102, 241, 0.08);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
}

.tip-item svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 1px;
}

.tip-item strong {
    color: var(--primary-color);
    font-weight: 500;
}

.quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.quick-prompt {
    padding: 10px 18px;
    border-radius: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-prompt:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

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

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background-color: var(--primary-color);
    color: white;
}

.message.ai .message-avatar {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

.message-content {
    max-width: 70%;
}

.message.user .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.message-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 8px;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.6;
}

.message.user .message-bubble {
    background-color: var(--user-message-bg);
    color: white;
    border-bottom-right-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uploaded-image-preview {
    width: 100%;
    max-width: 250px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.uploaded-image-preview img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.uploaded-image-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.uploaded-image-preview:hover .uploaded-image-actions {
    opacity: 1;
}

.uploaded-image-actions button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.uploaded-image-actions button:hover {
    background: white;
}

.message-text {
    margin-top: 12px;
    display: block;
}

.message.ai .message-bubble {
    background-color: var(--ai-message-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.message-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.message-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    background-color: var(--bg-tertiary);
}

.message-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-image-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.message-image:hover .message-image-actions {
    opacity: 1;
}

.message-image-actions button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.message-image-actions button:hover {
    background: white;
}

.input-container {
    padding: 16px 24px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
}

.input-wrapper {
    position: relative;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.input-wrapper:hover {
    border-color: var(--primary-color);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
}

.input-wrapper textarea {
    width: 100%;
    padding: 14px 16px;
    padding-right: 80px;
    padding-bottom: 48px;
    background-color: transparent;
    border: none;
    resize: none !important;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
    cursor: text;
}

.send-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-btn:hover {
    background-color: var(--primary-hover);
    transform: scale(1.05);
}

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

.send-btn.stop-mode {
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.send-btn.stop-mode:hover {
    background-color: rgba(239, 68, 68, 0.3);
}

.send-btn .stop-icon {
    display: none;
}

.send-btn.stop-mode .send-icon {
    display: none;
}

.send-btn.stop-mode .stop-icon {
    display: block;
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 2px dashed var(--primary-color);
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    cursor: pointer;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.upload-btn:hover {
    background-color: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.image2-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.image2-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.typing-cursor {
    display: inline-block;
    width: 10px;
    height: 16px;
    background-color: var(--text-secondary);
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.upload-preview {
    padding: 12px;
    background-color: var(--bg-card);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.upload-preview img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 8px;
}

.remove-preview-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background-color: #ef4444;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.remove-preview-btn:hover {
    background-color: #dc2626;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    background-color: var(--bg-secondary);
    padding: 40px 50px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-color);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-content p {
    color: var(--text-secondary);
    font-weight: 500;
}

.toast {
    position: fixed;
    bottom: 100px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1001;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    position: relative;
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease;
}

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

.auth-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.auth-close:hover {
    background: var(--bg-card);
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.auth-tab:hover {
    background: var(--bg-card);
}

.auth-tab.active {
    background: var(--primary-color);
    color: white;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    width: 100%;
    background: var(--primary-color);
    color: white;
    margin-top: 8px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.auth-submit {
    margin-top: 12px;
}

.recharge-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    animation: fadeIn 0.2s ease;
}

.recharge-modal {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    position: relative;
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease;
}

.recharge-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.recharge-close:hover {
    background: var(--bg-card);
}

.recharge-modal h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.points-cost-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.info-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.2);
    border-radius: 50%;
    color: #fbbf24;
    flex-shrink: 0;
}

.info-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-text p {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}

.info-text strong {
    color: #fbbf24;
    font-weight: 600;
}

.info-hint {
    font-size: 12px !important;
    color: var(--text-secondary) !important;
}

.recharge-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.recharge-rule {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-tertiary);
}

.recharge-rule:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.recharge-rule.recommended {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.15);
}

.rule-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.rule-description {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.rule-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.rule-points {
    font-size: 13px;
    color: #10b981;
    margin-bottom: 12px;
}

.select-rule-btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    margin-top: 0;
}

.recharge-summary {
    text-align: center;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.summary-item span:first-child {
    color: var(--text-secondary);
}

.summary-item span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.recharge-pay-btn {
    margin-top: 20px;
}

.recharge-paying {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}

.paying-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.recharge-paying p {
    color: var(--text-secondary);
}

.recharge-success {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    font-size: 32px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.recharge-success h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.recharge-success p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.recharge-success p:last-child {
    margin-bottom: 20px;
}

.recharge-success span {
    font-weight: 600;
    color: #10b981;
}

.recharge-qrcode {
    text-align: center;
    padding: 20px 0;
}

.recharge-qrcode h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.qrcode-container {
    background: white;
    padding: 12px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 12px;
}

.qrcode-container img {
    width: 200px;
    height: 200px;
    display: block;
}

.qrcode-hint {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.qrcode-order, .qrcode-amount {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 6px;
}

.qrcode-order span, .qrcode-amount span {
    font-weight: 600;
    color: var(--text-primary);
}

#qrcode-cancel-btn {
    margin-top: 12px;
}

.message.ai.generating .message-bubble {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    align-items: flex-start;
}

.generating-canvas {
    width: 100%;
    max-width: 180px;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.canvas-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 2px;
    padding: 4px;
    width: 100%;
    height: 100%;
}

.canvas-cell {
    background: var(--border-color);
    border-radius: 2px;
    animation: cellReveal 2s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes cellReveal {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.6) 0%, rgba(168, 85, 247, 0.6) 100%);
    }
}

.canvas-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.3);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #a855f7);
    animation: progressMove 3s ease-in-out infinite;
}

@keyframes progressMove {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

.generating-info {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.generating-text {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.generating-dots {
    display: flex;
    gap: 4px;
    margin-right: 8px;
}

.message.ai .message-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.generating-dots {
    display: flex;
    gap: 6px;
    margin-right: 8px;
}

.generating-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #a855f7);
    box-shadow: 0 0 8px var(--primary-color);
    animation: dotFloat 1.2s ease-in-out infinite;
}

.generating-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.generating-dots .dot:nth-child(2) {
    animation-delay: 0.15s;
}

.generating-dots .dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes dotFloat {
    0%, 100% {
        transform: translateY(0) scale(0.8);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-8px) scale(1.2);
        opacity: 1;
    }
}

.image-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.image-preview-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-preview-container img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.image-preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.message-image img {
    cursor: zoom-in;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex !important;
    }

    .sidebar {
        width: 280px;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .mobile-header {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        background-color: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
    }
    
    .mobile-menu-btn {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        border: none;
        background-color: var(--bg-tertiary);
        color: var(--text-primary);
        cursor: pointer;
        display: none;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-menu-btn:active {
        background-color: var(--bg-card);
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .message-container {
        padding: 16px;
    }
    
    .message-bubble {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message-images {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .input-container {
        padding: 12px 16px;
    }
    
    .recharge-rules {
        grid-template-columns: 1fr;
    }
    
    .welcome-message {
        padding: 40px 16px;
    }
    
    .welcome-message h1 {
        font-size: 22px;
    }
    
    .quick-prompts {
        gap: 8px;
    }
    
    .quick-prompt {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .input-wrapper textarea {
        padding-bottom: 56px;
    }
    
    .send-btn {
        width: 36px;
        height: 36px;
        right: 6px;
        bottom: 6px;
    }
    
    .auth-modal {
        margin: 16px;
        padding: 24px;
    }
    
    .recharge-modal {
        margin: 16px;
        padding: 24px;
    }
}