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

/* 默认浅色主题 - DeepSeek风格 */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-secondary-light: #fafafa;
    --bg-tertiary: #ebebeb;
    --bg-hover: #f0f0f0;
    --bg-tooltip: #1f2937;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.1);
    --border: #e5e7eb;
    --border-light: #d1d5db;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    /* DeepSeek风格消息颜色 */
    --user-msg-bg: #e8f4fd;
    --user-msg-text: #111827;
    --ai-msg-text: #111827;
    /* 侧边栏尺寸 */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 60px;
    /* 图标尺寸（可统一调小） */
    --brand-logo-size: 36px;     /* 左侧侧边栏 Logo */
    --float-logo-size: 32px;     /* 收缩后悬浮 Logo */
    --chat-avatar-size: 36px;    /* 聊天区头像（用户/AI） */
}

/* 深色主题 - DeepSeek风格 */
html {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-secondary-light: #f3f4f6;
    --bg-tertiary: #e5e7eb;
    --bg-hover: #d1d5db;
    --bg-tooltip: #1f2937;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-light: rgba(99, 102, 241, 0.1);
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
    --user-msg-bg: #6366f1;
    --user-msg-text: #ffffff;
    --ai-msg-text: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    transition: all 0.2s;
}

input, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* 认证页样式见 static/css/auth.css，此处不再重复 */

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
}

.btn-primary:disabled {
    background: var(--bg-hover);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-danger {
    background: var(--error);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    white-space: nowrap;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-block {
    width: 100%;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.forgot-link {
    color: var(--text-secondary);
    font-size: 13px;
}

.forgot-link:hover {
    color: var(--accent);
}

.social-btn.wechat {
    color: #22c55e;
}

.link {
    color: var(--accent);
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.mobile-menu-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--text-primary);
    display: none;
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
}

.mobile-menu-btn.active {
    background: var(--accent);
}

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: none;
    display: flex;
    flex-direction: column;
    position: relative;
    flex-shrink: 0;
    transition: width 0.3s ease;
    min-height: 100vh;
    z-index: 10;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

.sidebar-footer {
    margin-top: auto;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 0;
    min-height: 100vh;
    overflow: hidden;
    opacity: 0;
}

/* 侧边栏收缩时的悬浮框 - 精致设计 */
.sidebar-float-menu {
    position: fixed;
    top: 12px;
    left: 40px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-primary);
    border: none;
    border-radius: 20px;
    padding: 4px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.sidebar-float-menu:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.float-menu-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    position: relative;
    overflow: visible;
}

/* 悬浮菜单按钮需要显示 tooltip（伪元素会超出按钮边界） */
.float-menu-btn[data-tooltip] {
    overflow: visible;
}

.float-menu-btn img.avatar-img {
    width: var(--float-logo-size);
    height: var(--float-logo-size);
    object-fit: contain;
    border-radius: 50%;
}

.sidebar-brand img.avatar-img {
    width: var(--brand-logo-size);
    height: var(--brand-logo-size);
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
}

.float-menu-btn:hover {
    background: rgba(77, 107, 254, 0.1);
    color: var(--accent);
    transform: scale(1.05);
}

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

.float-menu-btn img,
.float-menu-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.float-menu-btn svg {
    stroke-width: 2;
}

/* 深色主题下的悬浮框 */
html.dark-theme .sidebar-float-menu {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
}

html.dark-theme .sidebar-float-menu:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

html.dark-theme .float-menu-btn {
    color: var(--text-muted);
}

html.dark-theme .float-menu-btn:hover {
    background: rgba(77, 107, 254, 0.1);
    color: var(--accent);
}

.sidebar.collapsed .sidebar-footer {
    margin-top: auto;
}

.sidebar.collapsed .sidebar-content {
    display: none;
}

/* 侧边栏顶部 - 名称和切换按钮 */
.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.3px;
}

.sidebar-brand .logo-view-btn {
    transition: transform 0.2s ease;
}

.sidebar-brand .logo-view-btn:hover {
    transform: scale(1.1);
}

/* 侧边栏切换按钮 */
.sidebar-toggle {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

/* 收起状态隐藏品牌名称 */
.sidebar.collapsed .sidebar-brand {
    display: none;
}

/* 收起状态下隐藏文字 */
.sidebar.collapsed .sidebar-header span,
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .conversation-title {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.sidebar.collapsed .user-name,
.sidebar.collapsed .chevron {
    display: none !important;
}

.sidebar .user-name,
.sidebar .chevron {
    opacity: 1;
    visibility: visible;
    width: auto;
    transition: all 0.3s ease;
}

/* 收起状态下隐藏整个对话列表区域 */
.sidebar.collapsed .sidebar-content {
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: all 0.3s ease;
    flex: 0 0 0;
    height: 0;
}

.sidebar .sidebar-content {
    opacity: 1;
    visibility: visible;
    width: auto;
    height: auto;
    transition: all 0.3s ease;
    flex: 1;
}

.sidebar.collapsed .btn-block {
    padding: 10px !important;
    width: 100% !important;
    height: 36px !important;
    border-radius: 12px !important;
    min-width: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .btn-block svg {
    margin: 0 !important;
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
}

.sidebar.collapsed .btn-block span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar .btn-block span {
    opacity: 1;
    width: auto;
    transition: all 0.3s ease;
}

.sidebar.collapsed .user-menu {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
}

.sidebar.collapsed .user-menu-btn {
    padding: 0 !important;
    background: transparent;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    transition: all 0.3s ease;
    flex-shrink: 0 !important;
    border: none !important;
    gap: 0 !important;
}

.sidebar.collapsed .user-menu-btn:hover {
    background: rgba(77, 107, 254, 0.1);
    color: var(--accent);
    transform: none;
}

.sidebar.collapsed .user-avatar {
    margin: 0 !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
}

.sidebar.collapsed .avatar-img {
    display: block !important;
    width: 32px !important;
    height: 32px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.sidebar.collapsed .user-dropdown {
    left: 60px;
    bottom: 0;
    top: auto;
    right: auto;
    min-width: 120px;
}

.sidebar.collapsed .user-menu.open .user-dropdown {
    display: block;
}

/* 收起状态下调整布局 */
.sidebar.collapsed {
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed .sidebar-top {
    order: 1;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-toggle {
    width: 32px;
    height: 32px;
}

.sidebar.collapsed .sidebar-header {
    order: 2;
    padding: 8px 12px 12px !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100%;
    flex-shrink: 0;
}

.sidebar.collapsed .btn-block {
    padding: 0 !important;
    width: 100% !important;
    height: 36px !important;
    border-radius: 12px !important;
    min-width: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    gap: 0 !important;
    transition: all 0.3s ease !important;
}

.sidebar.collapsed .sidebar-footer {
    order: 3;
    padding: 12px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 8px 12px 12px;
}

.sidebar-header .btn-primary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: none;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 14px;
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header .btn-primary:hover {
    background: rgba(77, 107, 254, 0.1);
    border-color: var(--border);
    color: var(--accent);
}

.sidebar-header .btn-primary:active {
    background: rgba(77, 107, 254, 0.1);
    border-color: var(--border);
    color: var(--accent);
}

.sidebar-header .btn-primary svg {
    transition: transform 0.2s ease;
    width: 16px;
    height: 16px;
}

.sidebar-header .btn-primary:hover svg {
    transform: rotate(90deg);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
}

.sidebar-footer {
    padding: 12px;
}

.sidebar-title {
    padding: 8px 12px 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
    opacity: 1;
    visibility: visible;
    width: auto;
    height: auto;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.conversation-list {
    list-style: none;
    opacity: 1;
    visibility: visible;
    width: auto;
    height: auto;
    transition: all 0.3s ease;
}

.sidebar.collapsed .conversation-list {
    opacity: 0;
    visibility: hidden;
    width: 0;
    height: 0;
    transition: all 0.3s ease;
}

.conversation-group {
    margin-bottom: 24px;
}

.conversation-group:last-child {
    margin-bottom: 0;
}

.conversation-group-header {
    padding: 16px 12px 4px 12px;
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    user-select: none;
}

.conversation-group-header:first-child {
    margin-top: 0;
    padding-top: 8px;
}

.sidebar.collapsed .conversation-group-header {
    display: none;
}

.conversation-item {
    padding: 6px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    opacity: 1;
    visibility: visible;
    width: auto;
    height: auto;
}

.sidebar.collapsed .conversation-item {
    opacity: 0;
    visibility: hidden;
    width: 0;
    height: 0;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
}

.conversation-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

html.dark-theme .conversation-item:hover {
    background: rgba(99, 102, 241, 0.12);
}

.conversation-item:hover .conversation-menu {
    opacity: 1;
    visibility: visible;
}

.conversation-item:hover .conversation-title {
    color: var(--accent);
}

.conversation-item.active {
    background: rgba(99, 102, 241, 0.1);
}

html.dark-theme .conversation-item.active {
    background: rgba(99, 102, 241, 0.14);
}

.conversation-item.active .conversation-menu {
    opacity: 1;
    visibility: visible;
}

.conversation-title {
    color: var(--text-primary);
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 350;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 1;
    visibility: visible;
    width: auto;
    height: auto;
    transition: all 0.3s ease;
    line-height: 1.2;
}

.conversation-item.active .conversation-title {
    color: var(--accent);
}

.conversation-time {
    color: var(--text-muted);
    font-size: 11px;
}

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

/* 对话菜单样式 */
.conversation-menu {
    position: relative;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.menu-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.menu-btn:hover {
    background: rgba(77, 107, 254, 0.1);
    color: var(--accent);
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    z-index: 10000;
    overflow: hidden;
    padding: 4px;
}

.menu-item {
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    text-align: left;
    border-radius: 4px;
}

.menu-item:hover {
    background: var(--bg-hover);
}

.menu-item svg {
    flex-shrink: 0;
}

/* 删除确认弹窗样式 */
.delete-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.delete-confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.delete-confirm-dialog {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.delete-confirm-overlay.show .delete-confirm-dialog {
    transform: scale(1);
}

.delete-confirm-header {
    margin-bottom: 20px;
}

.delete-confirm-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 16px;
    color: var(--text-primary);
}

.delete-confirm-content {
    margin-bottom: 24px;
}

.delete-confirm-content p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.delete-warning {
    color: #ef4444 !important;
    font-size: 13px;
}

.delete-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.delete-confirm-actions .btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

/* 重命名对话框样式 */
.rename-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.rename-dialog {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.rename-overlay.show .rename-dialog {
    transform: scale(1);
}

.rename-header {
    margin-bottom: 16px;
}

.rename-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.rename-content {
    margin-bottom: 20px;
}

.rename-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.rename-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.rename-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.rename-actions .btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.delete-confirm-actions .btn-outline {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.delete-confirm-actions .btn-outline:hover {
    background: var(--bg-hover);
}

.delete-confirm-actions .btn-danger {
    background: #ef4444;
    color: white;
}

.delete-confirm-actions .btn-danger:hover {
    background: #dc2626;
    margin-top: 4px;
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 44px;
    padding: 6px 8px;
    background: transparent;
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.15s ease;
    border: none;
    cursor: pointer;
}

.user-menu-btn:hover {
    background: rgba(77, 107, 254, 0.1);
    color: var(--accent);
}

.user-menu-btn:active {
    background: rgba(77, 107, 254, 0.1);
    color: var(--accent);
}

/* 默认头像/SVG 常有透明区域：勿用主题色渐变作底，否则会透出紫色像「染色」 */
.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-name {
    flex: 1;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chevron {
    color: var(--text-muted);
}

.user-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    display: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.user-menu.open .user-dropdown {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    border-radius: 6px;
    margin: 2px 0;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

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

/* 首页语言选择器 */
.main-language-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    z-index: 100;
}

.main-language-selector .language-selector {
    position: relative;
}

.main-language-selector .language-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.main-language-selector .language-btn:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.main-language-selector .language-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.main-language-selector .language-btn.active .language-arrow {
    transform: rotate(180deg);
}

.main-language-selector .language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 100%;
    min-width: 110px;
    max-width: 140px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: none;
    animation: fadeIn 0.2s ease;
}

.main-language-selector .language-dropdown.show {
    display: block;
}

.main-language-selector .language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #333;
    font-size: 14px;
}

.main-language-selector .language-option:hover {
    background: rgba(99, 102, 241, 0.1);
}

.main-language-selector .language-option.selected {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    font-weight: 500;
}

html.dark-theme .main-language-selector .language-btn {
    background: rgba(30, 30, 30, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

html.dark-theme .main-language-selector .language-btn:hover {
    background: rgba(40, 40, 40, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html.dark-theme .main-language-selector .language-dropdown {
    background: #2a2a2a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

html.dark-theme .main-language-selector .language-option {
    color: rgba(255, 255, 255, 0.9);
}

html.dark-theme .main-language-selector .language-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

html.dark-theme .main-language-selector .language-option.selected {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.chat-container {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px 0;
    position: relative;
    z-index: 1;
}

.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.welcome-content {
    text-align: center;
    max-width: 600px;
}

.welcome-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.welcome-subtitle {
    color: var(--accent);
    font-size: 16px;
    margin-bottom: 40px;
    font-weight: 500;
}

.login-prompt {
    text-align: center;
    margin-top: 40px;
}

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

.login-prompt .btn {
    margin: 8px;
    padding: 12px 32px;
}

/* 未登录用户的操作按钮 */
.guest-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
}

.guest-actions .btn-primary,
.guest-actions .btn-secondary {
    padding: 12px 32px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.guest-actions .btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
}

.guest-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.guest-actions .btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.guest-actions .btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.suggestions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.suggestion-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    transition: all 0.25s ease;
    cursor: pointer;
}

.suggestion-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.suggestion-btn svg {
    color: var(--accent);
    flex-shrink: 0;
}

/* 聊天容器 */
.chat-container {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.messages-container {
    max-width: 800px;
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.conversation-header {
    padding: 16px 0;
    margin-bottom: 16px;
    text-align: center;
    border-bottom: none;
}

.conversation-header .conversation-title {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    margin: 0 0 4px 0;
}

.conversation-meta {
    display: flex;
    justify-content: center;
    font-size: 12px;
    color: var(--text-muted);
}

.conversation-created {
    display: inline;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 40px;
}

.message {
    display: flex;
    align-items: flex-start;
    padding: 0;
    margin: 0;
}

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

.message.user .message-avatar {
    margin-left: 12px;
}

.message.assistant .message-avatar {
    margin-right: 12px;
}

.message-avatar {
    width: var(--chat-avatar-size);
    height: var(--chat-avatar-size);
    flex-shrink: 0;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    color: var(--text-secondary, #666);
    overflow: visible;
}

.message-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.message-header {
    margin-bottom: 8px;
}

.message-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary, #666);
}

.message.user .message-avatar {
    background: transparent;
    color: var(--text-secondary);
}

.message.assistant .message-avatar {
    background: transparent;
    color: var(--text-secondary);
}

.message-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.message.user .message-content {
    align-items: flex-end;
    max-width: 100%;
}

.message.assistant .message-content {
    align-items: flex-start;
    max-width: 100%;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.6;
    font-size: 14px;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: var(--user-msg-bg);
    color: var(--user-msg-text);
    border: none;
    border-radius: 12px;
    max-width: 80%;
    align-self: flex-end;
}

.message.assistant .message-bubble {
    background: transparent;
    color: var(--ai-msg-text);
    border: none;
    border-radius: 0;
    max-width: 80%;
    margin-top: 12px;
    padding-left: 0;
}

.message-bubble p {
    margin-bottom: 8px;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble pre {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid var(--border-light);
}

.message-bubble code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
}

.message-bubble ul,
.message-bubble ol {
    padding-left: 20px;
    margin: 8px 0;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

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

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

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

/* 消息时间样式 */
.message-time {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* AI 生成内容免责声明（独立于按钮行，始终显示） */
.message.assistant .ai-disclaimer {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.85;
    font-style: italic;
    margin-top: 4px;
    margin-bottom: 0;
    line-height: 1.4;
    padding-left: 2px;
    visibility: visible;
    max-width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    display: block;
}

/* AI：操作区为「免责声明 + 一行按钮」纵向排列 */
.message.assistant .message-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
}

.message-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* 消息功能按钮样式 */
.message-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

/* 最新消息一直显示功能按钮 */
.message:last-child .message-actions {
    opacity: 1 !important;
    visibility: visible !important;
}

/* AI消息加载中时隐藏按钮行和免责声明 */
.message.assistant.loading .message-actions {
    opacity: 0 !important;
    visibility: hidden !important;
}

.message.assistant.loading .ai-disclaimer {
    display: none;
}

/* 鼠标悬停时显示功能按钮 */
.message:hover .message-actions {
    opacity: 1 !important;
    visibility: visible !important;
}

.message.user .message-actions {
    justify-content: flex-end;
}

/* 无思考区时单独一行展示联网搜索图标 */
.assistant-meta-toolbar {
    margin: 0;
    padding: 0;
    line-height: 0;
}

/* 含思考或曾联网的助手消息：仅当为最后一条消息时才显示操作栏，否则需悬停显示 */
.message.assistant.message-persist-meta:last-child .message-actions {
    opacity: 1 !important;
    visibility: visible !important;
}

/* 思考过程样式 */
.reasoning-section {
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    line-height: 0;
}

/* 思考过程与正文之间的间距 */
.reasoning-section + .message-bubble {
    margin-top: 12px !important;
    padding-top: 0 !important;
}

/* 确保 reasoning-section 内部元素不影响布局 */
.reasoning-section > * {
    margin-top: 0;
    margin-bottom: 0;
}

/* 思考图标与联网搜索图标同一行 */
.reasoning-header-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    line-height: 0;
    vertical-align: top;
}

/* 联网搜索触发：与 .reasoning-header 同形（圆环、描边、悬停），仅内层为搜索图标 */
button.reasoning-header.reasoning-header--search {
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
    margin: 0;
    outline: none;
}

.reasoning-header--search.collapsed .reasoning-icon,
.reasoning-header--search.expanded .reasoning-icon {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.reasoning-header--search.expanded .reasoning-icon {
    transform: rotate(180deg);
}

.message-actions-left .reasoning-header--search {
    flex-shrink: 0;
}

.reasoning-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    user-select: none;
    border-radius: 20px;
    height: 28px;
}

.reasoning-header:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.reasoning-header.collapsed {
    width: 28px;
    padding: 0;
    justify-content: center;
}

.reasoning-header.collapsed .reasoning-icon {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.reasoning-header.expanded {
    width: 28px;
    height: 28px;
    padding: 0;
    justify-content: center;
}

.reasoning-header.expanded .reasoning-icon {
    width: 18px;
    height: 18px;
    color: var(--accent);
    transform: rotate(180deg);
}

.reasoning-section.reasoning-streaming .reasoning-header {
    background: rgba(77, 107, 254, 0.1);
    color: var(--accent);
}

.reasoning-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: var(--accent);
}

.reasoning-icon.spinning {
    animation: spin 1s linear infinite;
}

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

.reasoning-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.reasoning-header-row:has(.reasoning-header:not(.reasoning-header--search).expanded) + .reasoning-content,
.reasoning-section.reasoning-streaming .reasoning-content {
    max-height: 150px;
    overflow-y: scroll;
    margin-top: 2px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.reasoning-header-row:has(.reasoning-header:not(.reasoning-header--search).expanded) + .reasoning-content::-webkit-scrollbar,
.reasoning-section.reasoning-streaming .reasoning-content::-webkit-scrollbar {
    width: 6px;
}

.reasoning-header-row:has(.reasoning-header:not(.reasoning-header--search).expanded) + .reasoning-content::-webkit-scrollbar-track,
.reasoning-section.reasoning-streaming .reasoning-content::-webkit-scrollbar-track {
    background: transparent;
}

.reasoning-header-row:has(.reasoning-header:not(.reasoning-header--search).expanded) + .reasoning-content::-webkit-scrollbar-thumb,
.reasoning-section.reasoning-streaming .reasoning-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* 非 streaming 时收起态强制折叠，避免 .reasoning-streaming 未移除时出现大片白底占位 */
.reasoning-section:not(.reasoning-streaming) .reasoning-header-row:has(.reasoning-header:not(.reasoning-header--search).collapsed) + .reasoning-content {
    max-height: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    overflow: hidden !important;
}

/* 流式已结束：收起时用 display:none 彻底消除占位（覆盖 max-height 过渡与残留 class） */
.reasoning-section.reasoning-settled .reasoning-header-row:has(.reasoning-header:not(.reasoning-header--search).collapsed) + .reasoning-content {
    display: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    overflow: hidden !important;
}

/* 思考区域收起时完全消除上下间距 */
.reasoning-section.reasoning-settled:has(.reasoning-header:not(.reasoning-header--search).collapsed) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    line-height: 0 !important;
}

/* 确保思考区域内部的空白也被消除 */
.reasoning-section.reasoning-settled:has(.reasoning-header:not(.reasoning-header--search).collapsed) > * {
    line-height: normal;
}

/* 当思考区域收起时，与正文之间保持间距 */
.reasoning-section.reasoning-settled:has(.reasoning-header:not(.reasoning-header--search).collapsed) + .message-bubble {
    margin-top: 12px !important;
}

.reasoning-section.reasoning-settled .reasoning-header-row:has(.reasoning-header:not(.reasoning-header--search).expanded) + .reasoning-content {
    display: block;
}

.reasoning-text {
    padding: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.reasoning-text p {
    margin: 0 0 8px 0;
}

.reasoning-text p:last-child {
    margin-bottom: 0;
}

.reasoning-text code {
    background: var(--bg-tertiary);
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 4px 0;
    border: 1px solid var(--border-light);
}

.reasoning-content code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
}

/* 新的思考过程样式 - 参考Trae设计 */
.reasoning-container {
    margin-bottom: 4px;
}

/* 思考中状态 - 展开的思考框 */
.reasoning-expanded {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.reasoning-expanded-header {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reasoning-collapse-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.reasoning-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.reasoning-status-done {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.reasoning-status-done:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.reasoning-pulse {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: reasoning-pulse 1.5s ease-in-out infinite;
}

@keyframes reasoning-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.reasoning-expanded-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    transition: max-height 0.3s ease;
}

.reasoning-text {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.reasoning-text pre {
    background: var(--bg-tertiary);
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 4px 0;
    border: 1px solid var(--border-light);
}

.reasoning-text code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
}

/* Markdown 样式 */
.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble h4,
.message-bubble h5,
.message-bubble h6 {
    margin: 16px 0 8px 0;
    font-weight: 600;
    line-height: 1.4;
}

.message-bubble h1 { font-size: 1.5em; }
.message-bubble h2 { font-size: 1.3em; }
.message-bubble h3 { font-size: 1.15em; }
.message-bubble h4 { font-size: 1.1em; }
.message-bubble h5 { font-size: 1em; }
.message-bubble h6 { font-size: 0.9em; }

.message-bubble pre {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid var(--border-light);
}

.message-bubble pre code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: transparent;
    padding: 0;
}

.message-bubble code.inline-code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    color: var(--accent);
}

.message-bubble blockquote {
    border-left: 4px solid var(--accent);
    margin: 8px 0;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
}

.message-bubble .blockquote-wrapper blockquote {
    margin: 0;
}

.message-bubble .blockquote-wrapper blockquote + blockquote {
    margin-top: 4px;
}

.message-bubble ul.markdown-list,
.message-bubble ol.markdown-list {
    margin: 8px 0;
    padding-left: 24px;
}

.message-bubble ul.markdown-list {
    list-style-type: disc;
}

.message-bubble ol.markdown-list {
    list-style-type: decimal;
}

.message-bubble li {
    margin: 4px 0;
    line-height: 1.6;
}

.message-bubble li.list-level-1 { margin-left: 16px; }
.message-bubble li.list-level-2 { margin-left: 32px; }
.message-bubble li.list-level-3 { margin-left: 48px; }

.message-bubble a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.message-bubble a:hover {
    border-bottom-color: var(--accent);
}

.message-bubble img.markdown-image {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

.message-bubble del {
    text-decoration: line-through;
    color: var(--text-muted);
}

.message-bubble hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

.message-bubble table.markdown-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 14px;
}

.message-bubble table.markdown-table th,
.message-bubble table.markdown-table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.message-bubble table.markdown-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.message-bubble table.markdown-table tr:nth-child(even) {
    background: var(--bg-secondary);
}

.message-bubble strong {
    font-weight: 600;
}

.message-bubble em {
    font-style: italic;
}

/* Markdown 段落样式 */
.message-bubble p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

/* 思考完成状态 - 收起的小图标 */
.reasoning-collapsed {
    display: flex;
    align-items: center;
}

.reasoning-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reasoning-toggle-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.reasoning-toggle-btn svg {
    color: var(--accent);
}

/* 加载动画 - 三个点闪烁 */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 0;
    min-height: 24px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: loading-bounce 1.4s infinite ease-in-out both;
}

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

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

.loading-dot:nth-child(3) {
    animation-delay: 0s;
}

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

.message-actions-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-cost-display {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 4px;
    color: var(--accent, #3b82f6);
    font-weight: 600;
    white-space: nowrap;
    transition: none;
}

.message-cost-number {
    font-size: 13px;
    color: var(--accent, #3b82f6);
    transition: none;
}

.message-cost-icon {
    color: var(--accent, #3b82f6);
}

.message-actions-left .message-time {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 4px;
}

.message-actions-right {
    display: flex;
    align-items: center;
}

.action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

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

.action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.action-btn.active {
    color: var(--accent);
}

.action-btn.active:hover {
    background: var(--accent-light);
}

/* 复制成功状态 */
.action-btn.copied {
    color: #10b981;
}

.action-btn.copied:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* 继续生成按钮样式 */
.action-btn.continue-btn {
    width: auto;
    padding: 4px 12px;
    gap: 6px;
    background: var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.action-btn.continue-btn:hover {
    background: var(--accent-hover);
    color: white;
}

.action-btn.continue-btn .btn-text {
    font-size: 13px;
}

.input-area {
    padding: 20px;
    background: var(--bg-primary);
    position: relative;
    z-index: 1;
}

/* 新的聊天输入框容器 */
.chat-input-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-input-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 0;
}

.char-counter span {
    font-weight: 500;
}

.chat-input {
    width: 100%;
    min-height: 24px;
    max-height: 200px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

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

/* 工具栏 */
.chat-input-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

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

/* 联网搜索按钮 */
.web-search-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    width: auto;
    padding: 0 10px;
    font-size: 13px;
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.web-search-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.web-search-btn.active {
    background: rgba(77, 107, 254, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

.web-search-btn.active:hover {
    background: rgba(77, 107, 254, 0.15);
}

.web-search-text {
    font-size: 13px;
    font-weight: 500;
}

/* 深色主题下的联网搜索按钮 */
html.dark-theme .web-search-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent);
}

/* 工具栏下拉选择器 - 窄宽度样式 */
.toolbar-select {
    width: auto;
    min-width: 80px;
    max-width: 120px;
    padding: 6px 28px 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.2s, box-shadow 0.2s, color 0.2s, background-color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toolbar-select:hover {
    border-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.toolbar-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

/* 增强工具栏按钮样式 */
.enhanced-toolbar-btn {
    padding: 8px 12px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.enhanced-toolbar-btn:hover {
    background: rgba(77, 107, 254, 0.1);
    border-color: rgba(77, 107, 254, 0.2);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(77, 107, 254, 0.1);
}

.enhanced-toolbar-btn.active {
    background: rgba(77, 107, 254, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* 增强工具栏选择框样式 */
.enhanced-toolbar-select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-width: 100px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    appearance: none;
}

.enhanced-toolbar-select:hover {
    border-color: rgba(77, 107, 254, 0.2);
    background: rgba(77, 107, 254, 0.05);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(77, 107, 254, 0.1);
}

.enhanced-toolbar-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(77, 107, 254, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .enhanced-toolbar-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .enhanced-toolbar-select {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 80px;
    }
}

/* 语言选择器 */
.language-selector {
    position: relative;
}

.language-select {
    padding: 6px 28px 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    appearance: none;
    text-align: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.2s, box-shadow 0.2s, color 0.2s, background-color 0.2s;
}

.language-select:hover {
    border-color: var(--accent);
}

.language-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

/* 模型选择器 */
.model-selector {
    position: relative;
}

.model-select {
    padding: 6px 28px 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    appearance: none;
    text-align: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.2s, box-shadow 0.2s, color 0.2s, background-color 0.2s;
}

.model-select:hover {
    border-color: var(--accent);
}

.model-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

/* 自定义下拉菜单 - 解决覆盖和位置同步问题 */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 140px;
}

.custom-dropdown-trigger:hover {
    border-color: var(--accent);
}

.custom-dropdown-trigger:focus,
.custom-dropdown.open .custom-dropdown-trigger {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.custom-dropdown-trigger .dropdown-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.custom-dropdown-trigger .dropdown-arrow {
    flex-shrink: 0;
    transition: transform 0.2s;
    color: var(--text-muted);
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    min-width: 160px;
    max-width: 320px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s;
    margin-bottom: 4px;
}

.custom-dropdown.open .custom-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 设置面板中的模型下拉菜单 - 显示在下方 */
.settings-model-dropdown .custom-dropdown-menu {
    bottom: auto;
    top: 100%;
    margin-top: 4px;
    margin-bottom: 0;
}

.settings-model-dropdown.open .custom-dropdown-menu {
    transform: translateY(0);
}

.custom-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.15s;
    white-space: nowrap;
}

.custom-dropdown-item:hover {
    background: var(--bg-secondary);
}

.custom-dropdown-item.selected {
    background: var(--accent-light);
    color: var(--accent);
}

.custom-dropdown-item.selected::after {
    content: '✓';
    flex-shrink: 0;
    font-weight: bold;
}

/* 深色主题适配 */
html.dark-theme .custom-dropdown-menu {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

/* 新的发送按钮 */
.send-btn-new {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border: none;
    border-radius: 10px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.2s;
}

.send-btn-new:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.send-btn-new:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 停止生成按钮样式 */
.send-btn-new.stop-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    animation: pulse-stop 1.5s infinite;
}

.send-btn-new.stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-stop {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 2px 16px rgba(239, 68, 68, 0.5);
    }
}

/* 旧的样式兼容 */
.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    min-height: 48px;
    max-height: 200px;
    transition: all 0.2s;
}

.message-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

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

.send-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.2s;
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.send-btn:disabled {
    background: var(--bg-hover);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.input-footer {
    max-width: 800px;
    margin: 8px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

.input-hint {
    color: var(--text-muted);
    font-size: 12px;
    flex: 1;
    text-align: center;
}

.input-balance-display {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent, #3b82f6);
    font-weight: 600;
    white-space: nowrap;
}

.input-balance-number {
    font-size: 14px;
    color: var(--accent, #3b82f6);
}

/* Toast提示框 - 现代化设计 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    z-index: 99999; /* 确保 Toast 在最上层，高于所有弹窗 */
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 成功提示 - 绿色主题 */
.toast.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toast.success::before {
    content: '✓';
    font-size: 16px;
    font-weight: bold;
}

/* 错误提示 - 红色主题 */
.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toast.error::before {
    content: '✕';
    font-size: 16px;
    font-weight: bold;
}

/* 警告提示 - 橙色主题 */
.toast.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toast.warning::before {
    content: '⚠';
    font-size: 16px;
    font-weight: bold;
}

/* 信息提示 - 蓝色主题 */
.toast.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toast.info::before {
    content: 'ℹ';
    font-size: 16px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 100;
        transition: left 0.3s;
        width: 280px;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    /* 移动端禁用收缩功能 */
    .sidebar.collapsed {
        width: 280px;
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .suggestions {
        grid-template-columns:1fr;
    }
    
    .auth-container {
        padding: 24px;
        margin: 16px;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .form-group input {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .code-input-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .code-input-group input {
        width: 100%;
    }
    
    .send-code-btn {
        width: 100%;
        padding: 14px;
    }
    
    .btn {
        width: 100%;
        padding: 14px 24px;
        font-size: 16px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .welcome-title {
        font-size: 28px;
    }

    .welcome-subtitle {
        font-size: 14px;
    }

    .suggestions {
        grid-template-columns: 1fr;
    }
    
    .message-input {
        font-size: 16px;
    }
    
    .chat-input-container {
        padding: 12px;
        border-radius: 12px;
    }
    
    .chat-input {
        font-size: 16px;
    }
    
    .chat-input-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .toolbar-left {
        order: 2;
        width: 100%;
        justify-content: flex-start;
    }
    
    .toolbar-right {
        order: 1;
        width: 100%;
        justify-content: space-between;
    }
    
    .model-select {
        flex: 1;
        font-size: 14px;
    }
    
    .main-content {
        padding-left: 0;
    }
}

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

.loading span {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

/* 举报弹窗（紧凑、居中） */
.report-modal .report-modal-content {
    width: min(440px, calc(100vw - 32px));
    height: auto;
    min-height: unset;
    max-height: min(90vh, 640px);
    flex-direction: column;
    padding: 0;
    border-radius: 16px;
    overflow: visible;
}

.report-modal-inner {
    padding: 24px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}

.report-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
}

.report-modal .report-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.report-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.report-tag {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.report-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.report-tag.selected {
    border-color: var(--accent);
    background: var(--accent-light, rgba(77, 107, 254, 0.12));
    color: var(--accent);
    font-weight: 500;
}

.report-detail-input {
    width: 100%;
    min-height: 160px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.report-detail-input::placeholder {
    color: var(--text-muted);
}

.report-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* 默认纵向：标题/正文/按钮等多子元素上下排列。设置大窗的「侧栏 | 内容」由 .modal-body（flex-row）承担 */
.modal-content {
    position: relative;
    width: 750px;
    height: 550px;
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
}

/* 对话上限升级：小宽度、可滚动（尺寸与设置窗不同） */
#conversationUpgradeModal .modal-content {
    width: min(440px, calc(100vw - 32px));
    height: auto;
    min-height: unset;
    max-height: min(90vh, 640px);
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    transition: all 0.2s;
}

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

.modal-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.settings-sidebar {
    width: 220px;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.settings-title {
    padding: 20px 16px 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: left;
}

.settings-tab svg {
    flex-shrink: 0;
}

.menu-item:hover {
    background: rgba(77, 107, 254, 0.1);
    color: var(--accent);
}

.settings-tab.active {
    background: var(--accent);
    color: white;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
}

.panel-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* 积分余额显示样式 */
.credits-summary-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.credits-summary-item label {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
}

.credits-balance-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.credits-amount-large {
    font-size: 36px;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.credits-unit {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.credits-yuan {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 8px;
}

.credits-summary-item .setting-desc {
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
}

.setting-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.setting-select,
.setting-input {
    width: 100%;
    padding: 10px 14px;
    padding-right: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.setting-select:focus,
.setting-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.edit-btn {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--text-muted);
    background: transparent;
    transition: all 0.2s;
}

.edit-btn:hover {
    color: var(--accent);
    background: var(--bg-hover);
}

.setting-input:disabled + .edit-btn {
    cursor: pointer;
}

.setting-input:not(:disabled) + .edit-btn {
    display: none;
}

/* 圆形编辑按针 - 与头像编辑按钮一致 */
.edit-btn-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid white;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
}

.edit-btn-circle:hover {
    background: #2563eb;
    transform: scale(1.05);
}

/* 输入框内的编辑按钮 - 绝对定位 */
.setting-input-wrapper .edit-btn-circle {
    position: static;
    margin-left: 8px;
}

/* 自定义 Tooltip 样式 */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 500;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    border: 4px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* 启用 JS 智能 tooltip 后，关闭伪元素 tooltip，改为全局浮层 */
body.js-smart-tooltip-mounted [data-tooltip]::after,
body.js-smart-tooltip-mounted [data-tooltip]::before {
    display: none !important;
}

.smart-tooltip {
    position: fixed;
    z-index: 2600;
    max-width: min(420px, calc(100vw - 16px));
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.88);
    color: #ffffff;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    user-select: none;
    white-space: normal;
    word-break: break-word;
}

/* 输入框右下角「当前余额」tooltip：显示在上方，避免被底部边界挡住 */
#inputBalanceDisplay[data-tooltip]::after {
    top: auto;
    bottom: calc(100% + 6px);
}

#inputBalanceDisplay[data-tooltip]::before {
    top: auto;
    bottom: calc(100% + 2px);
    border-bottom-color: transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
}

.setting-input:not(:disabled) ~ .edit-btn-circle {
    display: none;
}

.setting-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.5;
}

.link {
    color: var(--accent);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

.btn-danger {
    background: var(--error);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}

/* 账户操作按钮样式 */
.account-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.account-action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.account-action-buttons .btn {
    flex: 0 0 auto;
    min-width: 100px;
    padding: 8px 16px;
    font-size: 13px;
}

/* 网络测试结果样式 */
.network-test-result {
    padding: 12px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.network-test-result.success {
    background: rgba(72, 187, 120, 0.1);
    border-color: #48bb78;
}

.network-test-result.error {
    background: rgba(229, 62, 62, 0.1);
    border-color: #e53e3e;
}

.network-test-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}

.network-test-item:last-child {
    border-bottom: none;
}

.network-test-status {
    font-size: 12px;
    font-weight: 500;
}

.network-test-status.connected {
    color: #48bb78;
}

.network-test-status.disconnected {
    color: #e53e3e;
}

.network-test-status.api_required {
    color: #ed8936;
}

.network-test-service-status {
    flex: 0 0 auto;
    width: 72px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
}

.network-test-service-status.service-enabled {
    color: #48bb78;
}

.network-test-service-status.service-disabled {
    color: #e53e3e;
}

/* 联网引用：[n] 内联可点，悬浮出卡片（正文与思考区一致） */
.citation-ref {
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent, #3b82f6);
    font: inherit;
    font-weight: 600;
    line-height: inherit;
    cursor: pointer;
    vertical-align: baseline;
    text-decoration: none;
}

.citation-ref:hover {
    text-decoration: underline;
}

/* 百度风格的引用提示框 */
.citation-tooltip {
    position: fixed;
    z-index: 2500;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 14px;
    max-width: 450px;
    width: 60vw;
    cursor: pointer;
    pointer-events: none;
    user-select: none;
    font-family: inherit;
}

/* 侧栏与引用浮层共用：第一行从左依次 序号、logo、网站名、|、日期（不靠右对齐） */
.search-result-row--meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
}

.search-result-row--meta .search-result-meta-sep {
    flex-shrink: 0;
    opacity: 0.45;
    user-select: none;
    color: var(--text-muted);
    font-weight: 300;
}

/* 右侧联网结果面板：与 .sidebar 同背景、同宽、同 0.3s ease 过渡（镜像滑入） */
.search-results-sidebar {
    width: 0;
    background: var(--bg-secondary);
    border-left: none;
    display: flex;
    flex-direction: column;
    position: relative;
    flex-shrink: 0;
    min-height: 100vh;
    overflow: hidden;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
    z-index: 10;
}

.search-results-sidebar.show {
    width: var(--sidebar-width);
    opacity: 1;
    overflow: visible;
}

/* 顶栏：与 .sidebar-top 一致（padding 12px、左对齐） */
.search-sidebar-top {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px;
    border-bottom: none;
    background: transparent;
}

/* 标题：与 .sidebar-brand 同字号与字重 */
.search-sidebar-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-sidebar-title svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* 关闭按钮沿用 .sidebar-toggle（与 #sidebarToggle 同款方角与悬停） */
.search-sidebar-top .sidebar-toggle {
    flex-shrink: 0;
    transition: transform 0.3s ease, background 0.2s, color 0.2s;
}

/* 面板展开时箭头转向（与左侧 .sidebar.collapsed .sidebar-toggle 旋转语义对称） */
.search-results-sidebar.show .search-sidebar-top .sidebar-toggle {
    transform: rotate(0deg);
}

.search-results-sidebar:not(.show) .search-sidebar-top .sidebar-toggle {
    transform: rotate(180deg);
}

.search-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 8px 12px;
    background: transparent;
    transition: all 0.3s ease;
}

.search-sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.search-sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.search-sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.search-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

.search-results-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 24px;
    color: var(--text-muted);
}

.search-results-loading .typing-indicator {
    margin-bottom: 12px;
}

.search-results-loading-text {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 列表项：与 .conversation-item 同款内边距与圆角 */
.search-result-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 2px;
    border-radius: 12px;
    border: none;
    background: transparent;
    transition: background 0.18s ease;
    overflow: hidden;
    cursor: pointer;
}

.search-result-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

html.dark-theme .search-result-item:hover {
    background: rgba(99, 102, 241, 0.12);
}

/* 流式首轮 meta 到达时卡片依次渐入 */
.search-result-item.search-result-item--stagger-in {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.32s ease, transform 0.32s ease;
}

.search-result-item.search-result-item--stagger-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.search-result-index {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--accent-light);
    color: var(--accent);
    text-align: center;
    line-height: 20px;
    font-size: 11px;
    font-weight: 600;
}

.search-result-row--meta .search-result-site-name {
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(13rem, 55%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-row--meta .search-result-date {
    white-space: nowrap;
}

.search-result-row--meta .search-result-brandmark {
    align-self: center;
}

/* 联网结果：logo 与 12px 网站名视觉同阶，避免侧栏/浮层里显得过高 */
.search-result-brandmark {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
    vertical-align: middle;
}

html.dark-theme .search-result-brandmark {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.search-result-brandmark--letter {
    background: var(--accent-light);
}

.search-result-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.search-result-letter {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.search-result-brandmark--letter .search-result-letter {
    text-transform: none;
}

.search-result-site-name {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.search-result-date {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.search-result-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-result-snippet {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-secondary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.search-results-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* 升级弹窗样式 */
.upgrade-package {
    background: var(--bg-primary, #ffffff);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border, #e5e7eb);
}

.package-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.package-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin-bottom: 8px;
}

.package-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent, #6366f1);
    background: var(--accent-light, #ede9fe);
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-block;
}

.package-note {
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 16px;
    line-height: 1.4;
    padding: 6px 12px;
    border-radius: 8px;
}

.package-note {
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 16px;
    line-height: 1.4;
}

.package-benefit {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
}

.benefit-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-light, #ede9fe);
    color: var(--accent, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.benefit-text {
    flex: 1;
    line-height: 1.4;
}

/* 升级按钮样式 */
#conversationLimitUpgradeBtn {
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-secondary, #6b7280);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#conversationLimitUpgradeBtn:hover:not(:disabled) {
    background: var(--bg-hover, #f3f4f6);
    color: var(--text-primary, #1f2937);
    border-color: var(--border-hover, #d1d5db);
}

#conversationLimitUpgradeBtn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .search-results-sidebar {
        width: 100%;
        max-width: 100%;
        transition: transform 0.3s ease, visibility 0s linear 0.3s;
    }

    .search-results-sidebar.show {
        transition: transform 0.3s ease, visibility 0s linear 0s;
    }

    body.search-sidebar-open .main-content {
        margin-right: 0;
    }

    .citation-tooltip {
        max-width: 90vw;
        width: 90vw;
    }
}

/* 网络设置容器样式 */
.network-settings-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 网络测试弹窗样式 */
.network-test-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.network-test-overlay.show {
    opacity: 1;
    visibility: visible;
}

.network-test-dialog {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    max-width: 560px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.network-test-overlay.show .network-test-dialog {
    transform: scale(1);
}

.network-test-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.network-test-body {
    margin-top: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.network-test-list {
    display: flex;
    flex-direction: column;
}

.network-test-engine-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    margin-right: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.network-test-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.confirm-network-test-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.network-select {
    flex: 1;
    min-width: 150px;
}

.test-network-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 13px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .network-settings-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .network-select,
    .test-network-btn {
        width: 100%;
    }
}

/* 注销账户确认弹窗样式 */
.delete-confirm-modal {
    width: 420px !important;
    height: auto !important;
    max-width: 90vw;
    padding: 32px;
    flex-direction: column !important;
    text-align: center;
}

.delete-confirm-modal .delete-confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
}

.delete-confirm-modal .delete-confirm-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.delete-confirm-modal .delete-confirm-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.delete-confirm-modal .delete-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.delete-confirm-modal .delete-confirm-actions .btn {
    min-width: 120px;
    padding: 10px 24px;
}

/* 解绑确认弹窗样式 */
.unbind-confirm-modal {
    width: 420px !important;
    height: auto !important;
    max-width: 90vw;
    padding: 32px;
    flex-direction: column !important;
    text-align: center;
}

.unbind-confirm-modal .unbind-confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 50%;
}

.unbind-confirm-modal .unbind-confirm-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.unbind-confirm-modal .unbind-confirm-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.unbind-confirm-modal .unbind-password-section {
    margin-bottom: 24px;
    text-align: left;
}

.unbind-confirm-modal .unbind-password-section label {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.unbind-confirm-modal .unbind-password-section input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
}

.unbind-confirm-modal .unbind-password-section input:focus {
    outline: none;
    border-color: var(--accent);
}

.unbind-confirm-modal .unbind-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.unbind-confirm-modal .unbind-confirm-actions .btn {
    min-width: 120px;
    padding: 10px 24px;
}

/* 解绑按钮样式 */
.unbind-btn {
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #dc2626 !important;
}

.unbind-btn:hover {
    background: #fecaca !important;
    border-color: #f87171 !important;
    color: #b91c1c !important;
}

/* 通用密码输入弹窗样式 */
.password-confirm-modal {
    width: 420px !important;
    height: auto !important;
    max-width: 90vw;
    padding: 32px;
    flex-direction: column !important;
    text-align: center;
}

.password-confirm-modal .password-confirm-header {
    margin-bottom: 24px;
}

.password-confirm-modal .password-confirm-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.password-confirm-modal .password-confirm-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.password-confirm-modal .password-confirm-section {
    margin-bottom: 24px;
    text-align: left;
}

.password-confirm-modal .password-confirm-section label {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.password-confirm-modal .password-confirm-section input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    font-size: 14px;
    box-sizing: border-box;
    height: 44px;
    display: block;
    min-height: 44px;
    line-height: 20px;
    visibility: visible;
    opacity: 1;
}

.password-confirm-modal .password-confirm-section input:focus {
    outline: none;
    border-color: var(--accent);
}

.password-confirm-modal .password-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.password-confirm-modal .password-confirm-actions .btn {
    min-width: 120px;
    padding: 10px 24px;
}

/* 通用二次确认弹窗样式（带红色警示） */
.danger-confirm-modal {
    width: 420px !important;
    height: auto !important;
    max-width: 90vw;
    padding: 32px;
    flex-direction: column !important;
    text-align: center;
}

.danger-confirm-modal .danger-confirm-header {
    margin-bottom: 24px;
}

.danger-confirm-modal .danger-confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
}

.danger-confirm-modal .danger-confirm-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.danger-confirm-modal .danger-confirm-desc {
    font-size: 14px;
    color: #ef4444;
    line-height: 1.6;
}

.danger-confirm-modal .danger-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.danger-confirm-modal .danger-confirm-actions .btn {
    min-width: 120px;
    padding: 10px 24px;
}

/* ==================== 统一密码输入框组件 ==================== */
/* 这是整个网站通用的密码输入框样式，修改这里会影响所有使用此组件的地方 */

/* 密码输入框容器 */
.unified-password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.unified-password-input .form-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.unified-password-input .form-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* 密码显示/隐藏按钮 */
.unified-password-input .password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    padding: 0;
    z-index: 10;
}

.unified-password-input .password-toggle-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.unified-password-input .password-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* 默认显示eye-off-icon(闭着的眼睛)，隐藏eye-icon(睁开的眼睛) */
.unified-password-input .password-toggle-btn .eye-icon {
    display: none;
}

/* 密码规则下拉菜单 - 绝对定位覆盖层 */
.unified-password-input .password-rules-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    animation: fadeIn 0.2s ease;
    text-align: left;
    z-index: 100;
}

.unified-password-input .password-rules-dropdown.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.unified-password-input .password-rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.unified-password-input .password-rule-item:first-child {
    padding-top: 0;
}

.unified-password-input .password-rule-item:last-child {
    padding-bottom: 0;
}

.unified-password-input .rule-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.unified-password-input .rule-icon svg {
    width: 14px;
    height: 14px;
}

/* 默认状态 - 显示叉号，灰色 */
.unified-password-input .password-rule-item .icon-check {
    display: none;
}

.unified-password-input .password-rule-item .icon-cross {
    display: block;
    color: #ef4444;
}

/* 有效状态 - 显示对勾，绿色 */
.unified-password-input .password-rule-item.valid .icon-check {
    display: block;
    color: #22c55e;
}

.unified-password-input .password-rule-item.valid .icon-cross {
    display: none;
}

.unified-password-input .password-rule-item.valid .rule-text {
    color: #22c55e;
}

/* ==================== 弹窗专用适配 ==================== */
.password-confirm-modal .unified-password-input {
    width: 100%;
}

/* 用户名编辑样式 */
.username-edit-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.username-edit-wrapper .setting-input {
    flex: 1;
}

.username-edit-actions {
    display: flex;
    gap: 8px;
}

.username-edit-actions .btn-sm {
    padding: 6px 16px;
    font-size: 13px;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        height: 100vh;
        max-width: none;
        max-height: none;
        border-radius: 0;
        flex-direction: column;
    }
    
    .modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
    }
    
    .settings-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 16px;
        -webkit-overflow-scrolling: touch;
    }
    
    .settings-tab {
        padding: 12px 16px;
        white-space: nowrap;
        font-size: 13px;
    }
    
    .settings-content {
        padding: 16px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .setting-item {
        margin-bottom: 20px;
    }
    
    .setting-input {
        font-size: 16px;
        padding: 12px;
    }
    
    .setting-select {
        font-size: 16px;
        padding: 12px;
    }
    
    .btn {
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* 头像上传样式 */
.avatar-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: visible;
    border: 2px solid var(--border);
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.current-avatar:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.avatar-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-upload-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.avatar-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* 深色主题适配 */
html.dark-theme .current-avatar {
    border-color: var(--border-light);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .avatar-upload-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .current-avatar {
        width: 60px;
        height: 60px;
    }
    
    /* 设置面板移动端优化 - 上面标签下面内容 */
    .modal-body {
        flex-direction: column;
    }
    
    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px 16px;
    }
    
    .settings-tabs {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
    }
    
    .settings-tab {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .settings-tab svg {
        width: 16px;
        height: 16px;
    }
    
    .settings-content {
        padding: 16px;
        overflow-y: auto;
        flex: 1;
    }
    
    .panel-header {
        font-size: 16px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .setting-item {
        margin-bottom: 16px;
    }
    
    .setting-input-wrapper {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .setting-input {
        padding: 12px 14px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .edit-btn-circle,
    .unbind-btn {
        width: 32px;
        height: 32px;
    }
    
    .username-edit-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
    
    .credits-amount-large {
        font-size: 28px;
    }
    
    .credits-summary-item {
        padding: 16px;
    }
    
    /* 按钮在移动端全宽 */
    .btn-block-mobile {
        width: 100%;
    }
}

/* ==================== 积分不足 / 负积分弹窗 ==================== */
.insufficient-points-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 20, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.28s ease;
    padding: 24px 16px;
    box-sizing: border-box;
}

.insufficient-points-overlay.show {
    opacity: 1;
}

.insufficient-points-dialog {
    position: relative;
    background: var(--bg-primary);
    border-radius: 18px;
    width: 420px;
    max-width: 90vw;
    padding: 0;
    border: 1px solid var(--border-color, var(--border, rgba(128, 128, 128, 0.2)));
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 24px 64px rgba(0, 0, 0, 0.18);
    transform: scale(0.94) translateY(16px);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.insufficient-points-dialog--negative .insufficient-points-top-accent {
    background: linear-gradient(90deg, #f97316, #ef4444, #a855f7);
}

.insufficient-points-dialog--negative {
    box-shadow:
        0 0 0 1px rgba(249, 115, 22, 0.12),
        0 4px 24px rgba(239, 68, 68, 0.08),
        0 24px 64px rgba(0, 0, 0, 0.2);
}

.insufficient-points-top-accent {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, var(--accent, #6366f1), #8b5cf6);
}

.insufficient-points-overlay.show .insufficient-points-dialog {
    transform: scale(1) translateY(0);
}

.insufficient-points-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.insufficient-points-icon-wrap--negative {
    background: linear-gradient(145deg, rgba(249, 115, 22, 0.18), rgba(239, 68, 68, 0.22));
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.insufficient-points-icon-wrap--caution {
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.2), rgba(234, 179, 8, 0.18));
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.insufficient-points-svg {
    width: 36px;
    height: 36px;
}

@media (prefers-color-scheme: dark) {
    .insufficient-points-icon-wrap--negative {
        color: #f87171;
        border-color: rgba(248, 113, 113, 0.4);
    }
    .insufficient-points-icon-wrap--caution {
        color: #fbbf24;
        border-color: rgba(251, 191, 36, 0.45);
    }
}

.insufficient-points-header {
    display: flex;
    justify-content: flex-end;
    padding: 16px 16px 0;
}

.insufficient-points-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.insufficient-points-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.insufficient-points-content {
    padding: 0 32px 24px;
    text-align: center;
}

.insufficient-points-icon {
    margin-bottom: 16px;
}

.insufficient-points-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.insufficient-points-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.insufficient-points-current {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 16px;
}

.insufficient-points-current .points-value {
    color: #ef4444;
    font-weight: 600;
    font-size: 16px;
}

.insufficient-points-actions {
    display: flex;
    gap: 12px;
    padding: 0 32px 32px;
    justify-content: center;
}

.insufficient-points-actions .btn {
    min-width: 120px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.insufficient-points-actions .btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.insufficient-points-actions .btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
}

.insufficient-points-actions .btn-primary {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: white;
}

.insufficient-points-actions .btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.insufficient-points-btn-recharge {
    border: none !important;
    background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%) !important;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.insufficient-points-btn-recharge:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

/* 移动端适配 */
@media (max-width: 480px) {
    .insufficient-points-dialog {
        width: 90vw;
        margin: 0 16px;
    }
    
    .insufficient-points-content {
        padding: 0 24px 20px;
    }
    
    .insufficient-points-actions {
        padding: 0 24px 24px;
        flex-direction: column;
    }
    
    .insufficient-points-actions .btn {
        width: 100%;
    }
}
/* ==================== DeepSeek风格背景样式 ==================== */

/* 背景装饰容器 - 应用到主内容区域 */
.main-content {
    position: relative;
    background: transparent;
}

/* 背景装饰 */
.ds-bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

/* 欢迎容器 */
.ds-welcome-container {
    position: relative;
    width: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
    overflow: hidden;
}

/* 背景圆圈 */
.ds-bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.08;
    animation: float 20s ease-in-out infinite;
}

.ds-bg-circle-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.ds-bg-circle-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
}

.ds-bg-circle-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    top: 50%;
    left: 10%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.05);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* 背景网格 */
.ds-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* 主内容区 */
.ds-welcome-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

/* Logo区域 */
.ds-logo-wrapper {
    margin-bottom: 24px;
}

.ds-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
    }
    50% {
        box-shadow: 0 8px 40px rgba(99, 102, 241, 0.25);
    }
}

.ds-logo svg {
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
}

/* 标题区域 */
.ds-title-section {
    margin-bottom: 32px;
}

.ds-main-title {
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 12px;
    letter-spacing: -1px;
}

.ds-title-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease-in-out infinite;
    background-size: 200% 200%;
}

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

.ds-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 400;
}

/* 登录/注册按钮 */
.ds-auth-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 48px;
}

.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
}

.ds-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.ds-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.ds-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.ds-btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* 功能卡片 */
.ds-feature-cards {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.ds-feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 100px;
}

.ds-feature-card:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}

.ds-feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
}

.ds-feature-icon svg {
    width: 20px;
    height: 20px;
}

.ds-feature-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* 提示词建议 */
.ds-suggestions {
    max-width: 500px;
    margin: 0 auto;
}

.ds-suggestions-label {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 16px;
    text-align: left;
}

.ds-suggestion-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ds-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.ds-suggestion-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1);
}

.ds-suggestion-item svg {
    color: var(--accent);
    flex-shrink: 0;
}

/* 深色主题适配 */
html.dark-theme .ds-bg-grid {
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
}

html.dark-theme .ds-feature-card {
    background: var(--bg-secondary);
}

html.dark-theme .ds-feature-card:hover {
    background: rgba(99, 102, 241, 0.12);
}

html.dark-theme .ds-suggestion-item {
    background: var(--bg-secondary);
    border-color: var(--border);
}

html.dark-theme .ds-suggestion-item:hover {
    background: rgba(99, 102, 241, 0.12);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .ds-welcome-container {
        padding: 30px 16px;
    }
    
    .ds-logo {
        width: 64px;
        height: 64px;
        border-radius: 20px;
    }
    
    .ds-main-title {
        font-size: 36px;
    }
    
    .ds-subtitle {
        font-size: 16px;
    }
    
    .ds-auth-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .ds-btn {
        width: 100%;
        max-width: 280px;
        padding: 14px 24px;
    }
    
    .ds-feature-cards {
        gap: 8px;
    }
    
    .ds-feature-card {
        padding: 12px 16px;
        min-width: 80px;
    }
    
    .ds-feature-icon {
        width: 32px;
        height: 32px;
    }
    
    .ds-feature-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .ds-feature-text {
        font-size: 12px;
    }
    
    .ds-suggestion-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .ds-suggestion-item {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* 未登录状态下的登录/注册按钮容器 */
.chat-input-container.guest-auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.guest-auth-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.guest-auth-actions .ds-btn {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
}

.guest-auth-actions .ds-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.guest-auth-actions .ds-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.guest-auth-actions .ds-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.guest-auth-actions .ds-btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* 移动端适配 - 未登录状态 */
@media (max-width: 768px) {
    .guest-auth-container {
        padding: 16px;
    }
    
    .guest-auth-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
    }
    
    .guest-auth-actions .ds-btn {
        width: 100%;
        max-width: 280px;
        padding: 14px 24px;
    }
}
