:root {
    --app-vh: 1vh;
}

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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    overflow: hidden;
}

.app-container {
    max-width: 430px;
    margin: 0 auto;
    background: #fff;
    height: calc(var(--app-vh) * 100);
    min-height: calc(var(--app-vh) * 100);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.qq-browser .app-container {
    height: calc(var(--app-vh) * 100);
    min-height: calc(var(--app-vh) * 100);
}

/* 加载屏幕 */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #fff;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 导航按钮 */
.nav-circle-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    color: #6b7280;
}

.nav-circle-btn:hover {
    background: #f9fafb;
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* QQ 浏览器对 sticky + 动态重渲染兼容较差，降级为普通头部避免返回后丢失 */
body.qq-browser .header {
    position: relative;
}

.header-title {
    font-size: 17px;
    font-weight: 600;
    color: #111827;
}

/* 聊天区域 */
.chat-container {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: #fff;
}

/* 用户消息 */
.user-message {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 8px;
}

.user-message-content {
    background: #dbeafe;
    border-radius: 18px 18px 4px 18px;
    padding: 12px 16px;
    max-width: 85%;
    font-size: 15px;
    line-height: 1.5;
    color: #111827;
}

.user-message img {
    max-width: 80px;
    border-radius: 8px;
}

/* AI消息 */
.ai-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.ai-message-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 85%;
    background: #f3f4f6;
    border-radius: 4px 18px 18px 18px;
    padding: 12px 16px;
}

.ai-text {
    font-size: 15px;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* 图片 */
.ai-image {
    max-width: 100%;
    border-radius: 12px;
    background: #f3f4f6;
}

/* 视频 */
.ai-video {
    width: 100%;
    border-radius: 12px;
    background: #000;
}

/* 底部输入区域 */
.input-area {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid #f3f4f6;
    background: #fff;
}

.input-box {
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
}

.input-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
    min-width: 0;
}

.input-box input::placeholder {
    color: #9ca3af;
}

.input-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.input-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
}

.input-icon-btn:hover {
    background: #f3f4f6;
}

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
}

.send-btn.stop-mode {
    border-radius: 10px;
    background: #ef4444;
}

.send-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
}

/* 登录页面 */
.login-container {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: #111827;
}

.login-subtitle {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 32px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: #000;
}

.captcha-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.captcha-row .form-input {
    flex: 1;
}

.captcha-display {
    padding: 12px 20px;
    background: #f3f4f6;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 4px;
    color: #111827;
    cursor: pointer;
    user-select: none;
}

.captcha-display:hover {
    background: #e5e7eb;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
}

.submit-btn:hover {
    background: #1f2937;
}

.submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.toggle-mode {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #6b7280;
}

.toggle-mode button {
    background: none;
    border: none;
    color: #000;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.success-message {
    background: #f0fdf4;
    color: #16a34a;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* 用户面板 */
.user-panel {
    max-width: 430px;
    margin: 0 auto;
    min-height: calc(var(--app-vh) * 100);
    height: calc(var(--app-vh) * 100);
    display: flex;
    flex-direction: column;
    background: #fff;
}

.panel-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
}

.back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #374151;
}

.back-btn:hover {
    background: #f3f4f6;
}

.panel-title {
    font-size: 17px;
    font-weight: 600;
    color: #111827;
}

.panel-content {
    padding: 20px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.user-avatar {
    width: 64px;
    height: 64px;
    background: #f3f4f6;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar i {
    font-size: 24px;
    color: #9ca3af;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    text-align: center;
    margin-bottom: 24px;
}

.quota-section {
    margin-bottom: 24px;
}

.quota-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.quota-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.quota-bar-fill {
    height: 100%;
    background: #000;
    border-radius: 4px;
    transition: width 0.3s;
}

.quota-bar-fill.warning {
    background: #f59e0b;
}

.quota-bar-fill.danger {
    background: #ef4444;
}

.quota-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.recharge-section {
    margin-bottom: 24px;
}

.recharge-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.recharge-input-row {
    display: flex;
    gap: 12px;
}

.recharge-input-row .form-input {
    flex: 1;
}

.recharge-btn {
    padding: 12px 20px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.recharge-btn:disabled {
    background: #9ca3af;
}

.feature-feedback-textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    color: #111827;
    resize: vertical;
    outline: none;
    line-height: 1.5;
}

.feature-feedback-textarea:focus {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.quota-link-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #f3f4f6;
    color: #111827;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    margin-top: 16px;
}

.quota-link-btn:hover {
    background: #e5e7eb;
}

.logout-btn {
    width: 100%;
    padding: 14px;
    background: #fff;
    color: #ef4444;
    border: 1px solid #ef4444;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 32px;
}

.logout-btn:hover {
    background: #fef2f2;
}

/* 模型选择器 */
.model-selector {
    padding: 8px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.model-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.model-tab {
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
}

.model-tab.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* 上传预览 */
.upload-preview {
    padding: 8px 16px;
    position: relative;
    display: inline-block;
}

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

.upload-preview .remove-btn {
    position: absolute;
    top: 0;
    right: 8px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 加载动画 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 4px 18px 18px 18px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* 侧边菜单 */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.side-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 80%;
    height: 100%;
    background: #fff;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.side-menu.show {
    transform: translateX(0);
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.side-menu-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.side-menu-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
}

.side-menu-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    position: relative;
}

.menu-section {
    margin-bottom: 24px;
}

.menu-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    justify-content: center;
}

.menu-btn:hover {
    background: #f9fafb;
}

.menu-btn i {
    color: #6b7280;
}

/* 隐藏文件输入 */
.hidden {
    display: none;
}


/* 功能按钮 */
.action-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #f3f4f6;
    color: #111827;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    margin-bottom: 12px;
}

.action-btn:hover {
    background: #e5e7eb;
}

.action-btn.secondary {
    background: #fff;
    border: 1px solid #e5e7eb;
}

.action-btn.secondary:hover {
    background: #f9fafb;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    width: 100%;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
    text-align: center;
}

.modal-desc {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-btn {
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    background: #000;
    color: #fff;
}

.modal-btn:hover {
    background: #1f2937;
}

.modal-btn.secondary {
    background: #f3f4f6;
    color: #374151;
}

.modal-btn.secondary:hover {
    background: #e5e7eb;
}


/* 版本切换 */
.mode-switch {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
}

.mode-switch:hover {
    background: #e5e7eb;
}

.mode-label {
    font-weight: 500;
}

/* 选中的模型显示 */
.selected-model {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 8px;
}

.clear-model-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #6b7280;
}

.clear-model-btn:hover {
    background: #d1d5db;
}

/* 模型列表 */
.model-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.model-option {
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s;
}

.model-option:hover {
    background: #f3f4f6;
}

.model-option.active {
    background: #000;
    color: #fff;
}

/* 对话列表 */
.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.conversation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.conversation-item:hover {
    background: #f3f4f6;
}

.conversation-item.active {
    background: #e5e7eb;
}

.conversation-title {
    flex: 1;
    font-size: 14px;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.conversation-pin-icon {
    font-size: 12px;
    color: #f59e0b;
    margin-right: 8px;
}

.conversation-delete {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    opacity: 0;
    transition: opacity 0.2s;
}

.conversation-item:hover .conversation-delete {
    opacity: 1;
}

.conversation-delete:hover {
    background: #fef2f2;
    color: #ef4444;
}

.conversation-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
}

.conversation-sheet-panel {
    width: min(430px, 100%);
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.conversation-sheet-title {
    padding: 14px 16px 10px;
    font-size: 13px;
    color: #6b7280;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-sheet-btn {
    width: 100%;
    border: none;
    background: #fff;
    color: #111827;
    padding: 14px 16px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.conversation-sheet-btn:hover {
    background: #f9fafb;
}

.conversation-sheet-btn.danger {
    justify-content: center;
    color: #ef4444;
    border-bottom: none;
}

.new-chat-btn {
    background: #000;
    color: #fff;
    border: none;
}

.new-chat-btn:hover {
    background: #1f2937;
}

.menu-btn.danger {
    color: #ef4444;
    border-color: #fecaca;
}

.menu-btn.danger:hover {
    background: #fef2f2;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: #1f2937;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    animation: toastIn 0.3s ease;
}

.toast-warning {
    background: #f59e0b;
}

.toast-success {
    background: #16a34a;
}

.toast-error {
    background: #ef4444;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 模态框按钮激活状态 */
.modal-btn.active {
    background: #000;
    color: #fff;
}


/* 公告弹窗 */
.announcement-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.announcement-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.announcement-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 340px;
    width: calc(100% - 40px);
    max-height: 80vh;
    overflow-y: auto;
}

.announcement-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    text-align: center;
}

.announcement-body {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 20px;
}

.announcement-buttons {
    display: flex;
    gap: 12px;
}

.announcement-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.announcement-btn.confirm {
    background: #000;
    color: #fff;
}

.announcement-btn.dismiss {
    background: #f3f4f6;
    color: #374151;
}

/* 高级版模型配置 - 新版分组选择器 */
.model-config-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
}

.config-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

/* 模型区域标签页 */
.model-tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
}

.model-type-tab {
    flex: 1;
    padding: 10px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.model-type-tab.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.model-type-tab .tab-icon {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

/* 模型分组 */
.model-groups-container {
    max-height: 400px;
    overflow-y: auto;
}

.model-group {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.model-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f3f4f6;
    cursor: pointer;
    user-select: none;
}

.model-group-header:hover {
    background: #e5e7eb;
}

.model-group-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.model-group-toggle {
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.2s;
}

.model-group.collapsed .model-group-toggle {
    transform: rotate(-90deg);
}

.model-group-items {
    display: flex;
    flex-direction: column;
}

.model-group.collapsed .model-group-items {
    display: none;
}

.model-item {
    padding: 10px 12px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    border-top: 1px solid #f3f4f6;
    transition: all 0.15s;
}

.model-item:hover {
    background: #f9fafb;
}

.model-item.selected {
    background: #000;
    color: #fff;
}

.btn-save-models {
    width: 100%;
    padding: 12px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 12px;
}

.btn-save-models:hover {
    background: #1f2937;
}

/* 可折叠区域样式 */
.collapsible-section {
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9fafb;
    cursor: pointer;
    transition: background 0.2s;
}

.section-header:hover {
    background: #f3f4f6;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: #6b7280;
}

.section-toggle {
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.2s;
}

.section-toggle.expanded {
    transform: rotate(90deg);
}

.section-content {
    padding: 12px;
    background: #fff;
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.section-content.collapsed {
    max-height: 0;
    padding: 0 12px;
    overflow: hidden;
}

/* 模型搜索框样式 */
.model-search-box {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    gap: 8px;
}

.model-search-box i {
    color: #9ca3af;
    font-size: 14px;
}

.model-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #374151;
}

.model-search-box input::placeholder {
    color: #9ca3af;
}

/* 圆形悬浮保存按钮 */
.floating-save-btn {
    position: absolute;
    right: 16px;
    bottom: 25%;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.floating-save-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

/* 提示词区域样式 */
.prompt-desc {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.prompt-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.prompt-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.prompt-textarea::placeholder {
    color: #9ca3af;
}

.prompt-tip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

.prompt-tip i {
    color: #f59e0b;
}

/* 配置提示文字 */
.config-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin: 8px 0;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 8px;
    font-size: 12px;
    color: #92400e;
}

.config-tip i {
    color: #f59e0b;
}

/* 对话标题编辑输入框 */
.conversation-title-input {
    flex: 1;
    border: 1px solid #667eea;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

/* 加载状态美化 */
.loading-card {
    padding: 20px;
    border-radius: 16px;
    margin: 8px 0;
}

.loading-card-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: gradientShift 3s ease infinite;
    background-size: 200% 200%;
}

.loading-card-video {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    position: relative;
    overflow: hidden;
}

.loading-card-video::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: waveMove 2s infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes waveMove {
    0% { left: -100%; }
    100% { left: 100%; }
}

.loading-card-content {
    color: #fff;
    text-align: center;
}

.loading-card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.loading-card-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.loading-card-model {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.loading-card-time {
    font-size: 11px;
    opacity: 0.7;
}

.loading-card-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.loading-card-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 精致的思考动画 */
.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 4px 18px 18px 18px;
    width: fit-content;
}

.thinking-indicator span {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    animation: thinkingBounce 1.4s ease-in-out infinite;
}

.thinking-indicator span:nth-child(1) { animation-delay: 0s; }
.thinking-indicator span:nth-child(2) { animation-delay: 0.2s; }
.thinking-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinkingBounce {
    0%, 80%, 100% { 
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* 消息操作按钮 */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

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

.msg-action-btn {
    padding: 6px 12px;
    background: #f3f4f6;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.msg-action-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.msg-action-btn.active {
    background: #eef2ff;
    color: #4338ca;
}

/* 代码块样式 */
.code-block {
    position: relative;
    background: #1f2937;
    border-radius: 8px;
    margin: 8px 0;
    overflow: hidden;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #374151;
    font-size: 12px;
    color: #9ca3af;
}

.code-copy-btn {
    padding: 4px 8px;
    background: #4b5563;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
}

.code-copy-btn:hover {
    background: #6b7280;
}

.code-block pre {
    margin: 0;
    padding: 12px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    color: #e5e7eb;
}

/* 长内容折叠 */
.content-collapsible {
    max-height: 300px;
    overflow: hidden;
    position: relative;
}

.content-collapsible.expanded {
    max-height: none;
}

.content-collapsible:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, #fff);
}

.expand-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    margin-top: 8px;
}

.expand-btn:hover {
    background: #e5e7eb;
}

/* 图片/视频预览优化 */
.media-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.media-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.media-container:hover .media-actions {
    opacity: 1;
}

.media-action-btn {
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.media-action-btn:hover {
    background: rgba(0,0,0,0.8);
}

/* 图片全屏预览 */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-download {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    background: #fff;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    cursor: pointer;
}

/* 视频播放器优化 */
.video-player-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-player-container video {
    width: 100%;
    display: block;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* 输入框优化 */
.input-box textarea {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
    min-width: 0;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    font-family: inherit;
}

.input-box textarea::placeholder {
    color: #9ca3af;
}

.char-counter {
    font-size: 11px;
    color: #9ca3af;
    text-align: right;
    padding: 4px 16px 0;
}

/* 上传预览优化 - 支持视频 */
.upload-preview {
    padding: 8px 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.upload-preview-item {
    position: relative;
    display: inline-block;
}

.upload-preview-item img,
.upload-preview-item video {
    max-width: 80px;
    max-height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.upload-preview-item .video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.upload-preview-item .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .model-tabs-container {
        flex-wrap: wrap;
    }
    
    .model-type-tab {
        flex: 1 1 30%;
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .model-type-tab .tab-icon {
        font-size: 14px;
    }
    
    .model-groups-container {
        max-height: 300px;
    }
    
    .model-item {
        padding: 12px;
    }
    
    .side-menu {
        width: 100%;
        max-width: 100%;
    }
    
    .loading-card {
        padding: 16px;
    }
    
    .loading-card-icon {
        font-size: 24px;
    }
    
    .message-actions {
        opacity: 1;
    }
    
    .media-actions {
        opacity: 1;
    }
}

/* 当前模型显示 */
.current-models {
    padding: 8px 16px;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 12px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

/* 修改账号密码区域 */
.account-modify-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.modify-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.modify-input-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.modify-btn {
    width: 100%;
    padding: 12px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.modify-btn:hover {
    background: #1f2937;
}
