/* ==================== 现代简约风格 - 用户主页 ==================== */

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

:root {
    /* 柔和的配色方案 */
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-lighter: #a5b4fc;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    
    /* 背景色 */
    --bg-main: #fafafa;
    --bg-elevated: #ffffff;
    --bg-hover: #f5f5f5;
    --bg-subtle: #f9fafb;
    
    /* 文字颜色 */
    --text-primary: #18181b;
    --text-secondary: #71717a;
    --text-tertiary: #a1a1aa;
    
    /* 边框 */
    --border-light: #e4e4e7;
    --border-medium: #d4d4d8;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* 过渡 */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: 280px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.logo h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo svg text {
    font-family: inherit;
}

.new-chat-btn {
    width: 100%;
    padding: 11px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.2);
}

.new-chat-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.new-chat-btn:active {
    transform: translateY(0);
}

/* 聊天历史 */
.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.history-section h3 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    margin: 12px 8px 8px;
    letter-spacing: 0.06em;
}

.history-item-wrapper {
    margin-bottom: 2px;
}

.history-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.history-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-delete-btn {
    display: none;
    padding: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: var(--transition-smooth);
    border-radius: 4px;
    flex-shrink: 0;
}

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

.history-item:hover .history-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.history-item.active {
    background: var(--bg-subtle);
    color: var(--primary-color);
    font-weight: 500;
}

.history-item.active .history-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: white;
    flex-shrink: 0;
}

.user-info span {
    color: var(--text-secondary);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invite-info {
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.invite-status {
    font-weight: 600;
    color: var(--text-primary);
}

.invite-status.expired {
    color: #ef4444;
}

.invite-countdown {
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    color: var(--text-secondary);
    font-size: 11px;
}

.invite-countdown.warning {
    color: #f59e0b;
}

.logout-btn {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.logout-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-main);
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 0 24px;
    height: 100%;
}

/* 聊天头部 */
.chat-header {
    padding: 32px 0 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-main);
}

.chat-header__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: var(--secondary-color);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.chat-header__title h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.chat-header__title p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.chat-header__features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-smooth);
}

.feature-chip:hover {
    background: var(--bg-subtle);
    border-color: var(--primary-lighter);
    color: var(--primary-color);
    transform: translateY(-1px);
}

/* 消息容器 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0;
}

/* 欢迎屏幕 */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 40px 0;
}

.welcome-content {
    text-align: center;
    max-width: 680px;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.welcome-icon {
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
}

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

.welcome-content h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.welcome-content > p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

/* 功能亮点卡片 */
.welcome-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.highlight-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: left;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.highlight-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-lighter);
}

.highlight-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.highlight-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 建议卡片 */
.suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.suggestion-card {
    padding: 16px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.suggestion-card:hover {
    background: var(--bg-subtle);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.suggestion-card:active {
    transform: translateY(0);
}

.suggestion-card svg {
    flex-shrink: 0;
    color: var(--primary-color);
}

.suggestion-card span {
    font-weight: 500;
}

/* ==================== 消息样式 ==================== */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.system-message {
    align-self: center;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    border: 1px solid var(--border-light);
    max-width: 90%;
    text-align: center;
    line-height: 1.5;
}

.system-message.warning {
    background: #fef3c7;
    border-color: #fde047;
    color: #a16207;
}

.system-message.danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.message.assistant .message-avatar {
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.message-content {
    flex: 1;
    line-height: 1.7;
    font-size: 15px;
    word-wrap: break-word;
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.message.assistant .message-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    opacity: 0;
    transform: translateY(8px);
}

.message.assistant .message-content.rendered {
    animation: assistantFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes assistantFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.assistant .message-content:hover {
    box-shadow: var(--shadow-md);
}

/* 消息内容样式 */
.assistant-heading {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin: 16px 0 8px;
}

.assistant-heading:first-child {
    margin-top: 0;
}

.assistant-paragraph {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.assistant-paragraph:last-child {
    margin-bottom: 0;
}

.assistant-list {
    margin: 12px 0;
    padding-left: 24px;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.assistant-list li {
    line-height: 1.7;
}

.assistant-list li::marker {
    color: var(--primary-color);
}

.assistant-code {
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px;
    overflow-x: auto;
    margin: 12px 0;
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    font-size: 13px;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    letter-spacing: 0.06em;
}

.code-copy-btn {
    border: none;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-light);
}

.code-copy-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.code-copy-btn.copied {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.assistant-inline-code {
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    background: var(--bg-subtle);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary-color);
    border: 1px solid var(--border-light);
}

.assistant-quote {
    border-left: 3px solid var(--primary-color);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.assistant-table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.assistant-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
    font-size: 14px;
}

.assistant-table thead {
    background: var(--bg-subtle);
}

.assistant-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.assistant-table td {
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    color: var(--text-primary);
}

.assistant-separator {
    border: none;
    height: 1px;
    margin: 20px 0;
    background: var(--border-light);
}

.message.assistant .message-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-lighter);
    transition: var(--transition-smooth);
}

.message.assistant .message-content a:hover {
    color: var(--primary-light);
    border-bottom-color: var(--primary-color);
}

/* 输入正在打字指示器 */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    animation: typingAnimation 1.4s infinite;
}

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

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

@keyframes typingAnimation {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* ==================== 输入区域 ==================== */
.input-container {
    padding: 24px 0 28px;
    border-top: 1px solid var(--border-light);
    background: linear-gradient(to top, var(--bg-main) 0%, rgba(250, 250, 250, 0.95) 100%);
    backdrop-filter: blur(8px);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-elevated);
    border: 2px solid var(--border-light);
    border-radius: 24px;
    padding: 14px 20px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    min-height: 56px;
}

.input-wrapper:hover {
    border-color: var(--primary-lighter);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 8px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

#messageInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 160px;
    line-height: 1.6;
    padding: 2px 0;
    min-height: 24px;
}

#messageInput::placeholder {
    color: var(--text-tertiary);
}

/* 停止按钮 */
.stop-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ff3b30, #dc2626);
    color: white;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    position: relative;
}

.stop-btn.active {
    display: flex;
}

.stop-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

.stop-btn:active {
    transform: translateY(0) scale(1);
}

.stop-btn::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 3px;
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-color));
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.send-btn:active:not(:disabled) {
    transform: translateY(0) scale(1);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--border-medium);
    box-shadow: none;
}

.input-footer {
    margin-top: 12px;
    text-align: center;
}

.hint {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ==================== 移动端适配 ==================== */
.mobile-menu-btn {
    display: none;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 100;
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        z-index: 99;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-menu-btn {
        display: flex;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 50;
        width: 44px;
        height: 44px;
        background: var(--bg-elevated);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--text-primary);
        transition: var(--transition-smooth);
        box-shadow: var(--shadow-md);
    }

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

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

    .main-content {
        padding-top: 76px;
    }

    .chat-container {
        padding: 0 16px;
    }

    .chat-header {
        padding: 20px 0 16px;
    }

    .chat-header__title h2 {
        font-size: 24px;
    }

    .welcome-content h2 {
        font-size: 28px;
    }

    .suggestions {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .chat-container {
        max-width: 700px;
    }
}

@media (min-width: 1440px) {
    .chat-container {
        max-width: 900px;
    }
}

/* ==================== 加载动画 ==================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== 退出登录弹窗 ==================== */
.logout-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.logout-modal.show {
    display: flex;
}

.logout-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.logout-modal-header {
    padding: 32px 32px 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.logout-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-icon svg {
    stroke: #dc2626;
    stroke-width: 2;
}

.logout-modal-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.logout-modal-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.logout-modal-body {
    padding: 24px 32px;
    background: var(--bg-elevated);
}

.logout-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
}

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

.logout-info-item svg {
    flex-shrink: 0;
    stroke: var(--primary-color);
    stroke-width: 2;
}

.logout-info-item span {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.logout-modal-footer {
    padding: 20px 32px 32px;
    display: flex;
    gap: 12px;
}

.logout-cancel-btn,
.logout-confirm-btn {
    flex: 1;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-cancel-btn {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.logout-cancel-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.logout-confirm-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.logout-confirm-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
    transform: translateY(-1px);
}

.logout-confirm-btn:active {
    transform: translateY(0);
}

.logout-confirm-btn svg {
    stroke-width: 2;
}

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

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

/* 响应式 - 退出登录弹窗 */
@media (max-width: 480px) {
    .logout-modal {
        padding: 16px;
    }

    .logout-modal-content {
        max-width: 100%;
    }

    .logout-modal-header {
        padding: 24px 20px 20px;
    }

    .logout-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 16px;
    }

    .logout-icon svg {
        width: 40px;
        height: 40px;
    }

    .logout-modal-header h3 {
        font-size: 20px;
    }

    .logout-modal-body {
        padding: 20px;
    }

    .logout-modal-footer {
        padding: 16px 20px 24px;
        flex-direction: column;
    }

    .logout-cancel-btn,
    .logout-confirm-btn {
        width: 100%;
    }
}

/* ==================== 优化触摸设备体验 ==================== */
@media (hover: none) and (pointer: coarse) {
    .suggestion-card,
    .history-item,
    .new-chat-btn,
    .send-btn {
        min-height: 44px;
    }
}

/* ==================== 每日使用量信息 ==================== */
.daily-usage-info {
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
}

.usage-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.usage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.usage-label {
    color: var(--text-secondary);
    font-size: 12px;
}

.usage-value {
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 11px;
}

.usage-countdown {
    background: #fef3c7;
    border: 1px solid #fde047;
    border-radius: var(--radius-sm);
    padding: 8px;
    color: #a16207;
    font-size: 11px;
    text-align: center;
    margin-top: 4px;
    font-weight: 500;
}

.usage-countdown span {
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    font-weight: 600;
}

/* ==================== 思考中指示器 ==================== */
.thinking-message {
    opacity: 1;
    animation: fadeIn 0.3s ease-in;
}

.thinking-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

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

.thinking-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.thinking-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: thinkingPulse 1.4s ease-in-out infinite;
}

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

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

@keyframes thinkingPulse {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    30% {
        transform: scale(1.3);
        opacity: 1;
    }
}

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

/* ==================== iOS风格丝滑淡入动画 ==================== */
.ios-fade-in {
    animation: iosFadeInScale 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes iosFadeInScale {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 优化滚动容器 */
.messages-container {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* 优化消息内容渲染性能 */
.message-content {
    will-change: contents;
    contain: layout style paint;
}

/* ==================== 滚动到底部按钮 ==================== */
.scroll-to-bottom-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: var(--transition-smooth);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    z-index: 100;
}

.scroll-to-bottom-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-to-bottom-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.scroll-to-bottom-btn:active {
    transform: translateY(0) scale(0.95);
}

.scroll-to-bottom-btn svg {
    transition: var(--transition-smooth);
}

.scroll-to-bottom-btn:hover svg {
    transform: translateY(2px);
}
