:root {
    --primary-color: #8e44ad;
    --primary-light: #9b59b6;
    --primary-dark: #7d3c98;
    --secondary-color: #3498db;
    --secondary-light: #5dade2;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --background-light: rgba(248, 249, 250, 0.95);
    --background-card: rgba(255, 255, 255, 0.95);
    --background-sidebar: rgba(245, 247, 250, 0.95);
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-light: #95a5a6;
    --border-color: rgba(236, 240, 241, 0.5);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 36px rgba(0, 0, 0, 0.14), 0 4px 10px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 50px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 300px;
    --sidebar-collapsed: 70px;
}

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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #5c6bc0 0%, #7b2fbe 50%, #6a1b9a 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* ===== 侧边栏样式 ===== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(160deg, rgba(158, 58, 196, 0.97) 0%, rgba(118, 45, 168, 0.97) 50%, rgba(100, 35, 148, 0.97) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-normal);
    z-index: 100;
    position: relative;
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18), 2px 0 8px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 22px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.08);
}

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

.logo-icon {
    width: 46px;
    height: 46px;
    background: #ffffff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.logo-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
    border-radius: 10px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.sidebar.collapsed .logo-text {
    display: none;
}

/* 导航链接 */
.nav-links {
    padding: 0 16px;
    margin-bottom: 25px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.06);
    width: 100%;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.14);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.link-text {
    flex: 1;
    font-size: 14px;
}

.sidebar.collapsed .link-text {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

/* 用户指南下拉导航 */
.nav-group {
    position: relative;
    margin-bottom: 6px;
}

.nav-group-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.06);
    width: 100%;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    box-sizing: border-box;
}

.nav-group-btn:hover,
.nav-group.open .nav-group-btn {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.14);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateX(4px);
}

.nav-group-btn .nav-arrow {
    margin-left: auto;
    font-size: 11px;
    transition: transform 0.25s ease;
    opacity: 0.7;
}

.nav-group.open .nav-group-btn .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 4px 12px;
    margin-top: 2px;
}

.nav-group.open .nav-submenu {
    display: flex;
}

.nav-sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.nav-sublink:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.nav-sublink i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    opacity: 0.85;
}

.sidebar.collapsed .nav-group-btn .link-text,
.sidebar.collapsed .nav-group-btn .nav-arrow,
.sidebar.collapsed .nav-submenu {
    display: none;
}

.sidebar.collapsed .nav-group-btn {
    justify-content: center;
    padding: 12px;
}

/* 新建对话按钮 */
.new-chat-container {
    padding: 0 16px;
    margin-bottom: 25px;
}

.new-chat-btn {
    width: 100%;
    padding: 13px 14px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.92), rgba(93, 173, 226, 0.88));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    letter-spacing: 0.5px;
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.98), rgba(93, 173, 226, 0.95));
}

.sidebar.collapsed .new-chat-btn {
    padding: 14px;
    border-radius: var(--radius-full);
    width: 42px;
    height: 42px;
}

.sidebar.collapsed .new-chat-btn span {
    display: none;
}

/* 历史记录 */
.history-section {
    flex: 1;
    padding: 0 16px;
    overflow-y: auto;
    min-height: 200px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.8;
}

.clear-history-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.clear-history-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .section-title,
.sidebar.collapsed .clear-history-btn {
    display: none;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-item {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.history-item.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.history-content {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.history-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.history-item:hover .history-actions {
    opacity: 1;
}

.history-delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 12px;
}

.history-delete-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.sidebar.collapsed .history-content,
.sidebar.collapsed .history-actions,
.sidebar.collapsed .history-delete {
    display: none;
}

.sidebar.collapsed .history-item {
    padding: 10px;
    justify-content: center;
}

/* 用户信息 + 免责声明 */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 500;
    font-size: 13px;
}

.user-role {
    font-size: 11px;
    opacity: 0.8;
}

.sidebar.collapsed .user-info {
    display: none;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
}

/* 免责声明链接 */
.disclaimer-link-container {
    margin-top: 12px;
    text-align: center;
}

.disclaimer-link {
    display: inline-block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    transition: all var(--transition-fast);
}

.disclaimer-link:hover {
    color: white;
    background: rgba(231, 76, 60, 0.5);
}

.sidebar.collapsed .disclaimer-link-container {
    display: none;
}

/* ===== 主内容区域 ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* 顶部导航 */
.navbar {
    height: 64px;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    z-index: 10;
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toggle-sidebar {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    font-size: 18px;
    padding: 0;
}

.toggle-sidebar:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.nav-title {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

.nav-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.nav-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 16px;
    position: relative;
    padding: 0;
}

.nav-btn:hover {
    color: var(--primary-color);
    background: rgba(142, 68, 173, 0.08);
    transform: scale(1.05);
    border-radius: var(--radius-sm);
}

.nav-btn.active {
    color: var(--primary-color);
    background: rgba(142, 68, 173, 0.08);
}

.nav-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent-color);
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== 关键词导航 ===== */
.keywords-section {
    padding: 10px 16px 0 16px;
    background: rgba(255, 255, 255, 0.97);
    position: relative;
    z-index: 9;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.keywords-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}

.keywords-nav::-webkit-scrollbar {
    height: 4px;
}

.keywords-nav::-webkit-scrollbar-track {
    background: transparent;
}

.keywords-nav::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 2px;
}

.keyword-btn {
    padding: 9px 16px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    letter-spacing: 0.2px;
}

.keyword-btn:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(142, 68, 173, 0.28);
    border-color: transparent;
}

.keyword-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(142, 68, 173, 0.35);
}

.keyword-btn i {
    font-size: 13px;
}

/* 子导航菜单 */
.sub-nav-container {
    padding: 0 16px 12px 16px;
    background: rgba(255, 255, 255, 0.97);
    position: relative;
    z-index: 8;
    display: none;
    animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

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

.sub-nav-container.active {
    display: block;
}

.sub-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}

.sub-nav::-webkit-scrollbar {
    height: 4px;
}

.sub-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sub-nav::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 2px;
}

.sub-nav-btn {
    padding: 7px 14px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.sub-nav-btn:hover {
    background: var(--primary-light);
    color: white;
    transform: translateY(-1px);
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(142, 68, 173, 0.25);
}

.sub-nav-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: transparent;
}

.sub-nav-btn i {
    font-size: 11px;
}

/* ===== 聊天区域 ===== */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

.welcome-section {
    text-align: center;
    padding: 50px 20px;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease;
}

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

.welcome-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
    opacity: 0.8;
}

.welcome-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

/* 消息样式 */
.chat-message {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

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

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 14px;
}

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

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

.message-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    max-width: 84%;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chat-message.user .message-content {
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.11), rgba(52, 152, 219, 0.11));
    border-top-right-radius: 4px;
    border-color: rgba(142, 68, 173, 0.1);
}

.chat-message.ai .message-content {
    border-top-left-radius: 4px;
}

.message-text {
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 生成图片显示 */
.generated-image-container {
    margin: 16px 0;
    text-align: center;
}

.generated-image {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    border-radius: var(--radius-md);
    margin: 12px auto;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

.generated-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.image-load-error {
    padding: 20px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px dashed var(--accent-color);
    border-radius: var(--radius-md);
    color: var(--accent-color);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.download-btn {
    margin-left: 10px;
    padding: 4px 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
}

.download-btn:hover {
    background: var(--primary-dark);
}

/* ===== 多模态内容展示 ===== */

/* AI回答中的外部链接 */
.external-link {
    color: var(--secondary-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--secondary-color);
    transition: all 0.2s;
    word-break: break-all;
}
.external-link:hover {
    color: var(--primary-color);
    border-bottom-style: solid;
}

/* AI回答中的内嵌图片 */
.inline-image-container {
    display: block;
    margin: 12px 0;
    text-align: center;
}
.inline-image-container img {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border-color);
    transition: all 0.3s ease;
}
.inline-image-container img:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

/* 图片骨架加载动画 */
.image-skeleton {
    min-width: 120px;
    min-height: 80px;
    background: linear-gradient(90deg, rgba(52,152,219,0.05) 25%, rgba(52,152,219,0.12) 50%, rgba(52,152,219,0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.dark-theme .image-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
}

/* AI回答中的内嵌音频 */
.inline-audio-container {
    display: block;
    margin: 8px 0;
}
.inline-audio-container audio {
    border-radius: 8px;
    background: var(--background-sidebar);
    outline: none;
}
.inline-audio-container audio::-webkit-media-controls-panel {
    background: var(--background-sidebar);
}

/* AI回答中的内嵌视频 */
.inline-video-container {
    display: block;
    margin: 12px 0;
}
.inline-video-container video {
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    background: #000;
}

/* 视频平台嵌入iframe容器 */
.inline-video-container iframe {
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

/* ===== 搜索参考链接（DeepSeek风格）===== */

/* 引用区块整体 */
.search-ref-block {
    margin-top: 20px;
    border: 1px solid rgba(52, 152, 219, 0.18);
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.02), rgba(142, 68, 173, 0.02));
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.03);
    animation: refFadeIn 0.35s ease;
}
@keyframes refFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 引用分区 */
.ref-section {
    border-bottom: 1px solid rgba(52, 152, 219, 0.08);
}
.ref-section:last-of-type {
    border-bottom: none;
}
.ref-section.collapsed .ref-section-body {
    display: none;
}
.ref-section.collapsed .ref-section-toggle i {
    transform: rotate(180deg);
}

/* 分区头部 */
.ref-section-hd {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(52, 152, 219, 0.04);
    cursor: default;
    user-select: none;
}
.ref-section-search .ref-section-hd {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.07), rgba(52, 152, 219, 0.02));
}
.ref-section-cite .ref-section-hd {
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.06), rgba(142, 68, 173, 0.01));
}

.ref-section-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.ref-section-icon-search {
    background: linear-gradient(135deg, #3498db, #5dade2);
    color: #fff;
}
.ref-section-icon-cite {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: #fff;
}

.ref-section-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}
.ref-section-count {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
    margin-left: auto;
    margin-right: 6px;
}
.ref-section-count-search {
    background: rgba(52, 152, 219, 0.12);
    color: #3498db;
}
.ref-section-count-cite {
    background: rgba(142, 68, 173, 0.12);
    color: #8e44ad;
}

.ref-section-toggle {
    width: 26px; height: 26px;
    border: none;
    background: rgba(52, 152, 219, 0.08);
    color: var(--text-light);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.ref-section-toggle:hover {
    background: rgba(52, 152, 219, 0.18);
    color: var(--secondary-color);
}
.ref-section-toggle i {
    transition: transform 0.25s ease;
}

/* 分区内容区 */
.ref-section-body {
    padding: 6px 12px 10px;
    max-height: 360px;
    overflow-y: auto;
    scroll-behavior: smooth;
}
.ref-section-body::-webkit-scrollbar { width: 4px; }
.ref-section-body::-webkit-scrollbar-thumb { background: rgba(52, 152, 219, 0.18); border-radius: 4px; }
.ref-section-body::-webkit-scrollbar-track { background: transparent; }

/* 引用卡片链接 */
.ref-card-link {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 11px 14px !important;
    margin: 5px 0 !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    color: inherit !important;
    background: rgba(255, 255, 255, 0.55) !important;
    border: 1px solid rgba(52, 152, 219, 0.08) !important;
    transition: all 0.22s ease !important;
    cursor: pointer !important;
    position: relative;
}
.ref-card-link:hover {
    background: rgba(52, 152, 219, 0.08) !important;
    border-color: rgba(52, 152, 219, 0.25) !important;
    transform: translateX(3px);
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.1);
}
.ref-card-link:active {
    transform: translateX(3px) scale(0.985);
}

/* 引用序号 */
.ref-num-badge {
    min-width: 24px; height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(142, 68, 173, 0.2);
    transition: transform 0.2s;
}
.ref-card-link:hover .ref-num-badge {
    transform: scale(1.12);
}

/* 卡片主体 */
.ref-card-body {
    flex: 1; min-width: 0;
}

/* 卡片标题 */
.ref-card-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 5px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.ref-card-link:hover .ref-card-title {
    color: var(--secondary-color);
}
.ref-favicon {
    flex-shrink: 0;
    border-radius: 2px;
    margin-top: 2px;
}

/* 域名行 */
.ref-card-domain {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    flex-wrap: wrap;
}
.ref-domain-text {
    color: var(--text-light);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ref-visit-hint {
    color: var(--secondary-color);
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 3px;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s;
}
.ref-card-link:hover .ref-visit-hint {
    opacity: 1;
    transform: translateX(0);
}

/* 摘要文本 */
.ref-snippet-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-top: 6px;
    padding: 8px 10px;
    background: rgba(52, 152, 219, 0.04);
    border-radius: 6px;
    border-left: 2px solid rgba(52, 152, 219, 0.18);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 底部免责 */
.ref-block-footer {
    font-size: 10px;
    color: var(--text-light);
    padding: 8px 16px;
    border-top: 1px solid rgba(52, 152, 219, 0.08);
    text-align: right;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

/* ===== 内联引用标记 ===== */
.inline-citation {
    display: inline-block;
    vertical-align: super;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 10px;
    padding: 1px 6px;
    background: rgba(52, 152, 219, 0.12);
    border-radius: 10px;
    margin: 0 1px;
    transition: all 0.2s ease;
    user-select: none;
}
.inline-citation-alt {
    color: var(--primary-color);
    background: rgba(142, 68, 173, 0.12);
}
.inline-citation:hover {
    background: rgba(52, 152, 219, 0.28) !important;
    transform: translateY(-2px);
    box-shadow: 0 1px 4px rgba(52, 152, 219, 0.2);
}
.inline-citation-alt:hover {
    background: rgba(142, 68, 173, 0.28) !important;
    box-shadow: 0 1px 4px rgba(142, 68, 173, 0.2);
}
.inline-citation:active {
    transform: translateY(-2px) scale(0.9);
}

/* ===== 深色主题：引用区块 ===== */
.dark-theme .search-ref-block {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.03), rgba(142, 68, 173, 0.02));
    border-color: rgba(52, 152, 219, 0.12);
}
.dark-theme .ref-section-hd {
    background: rgba(255, 255, 255, 0.03);
}
.dark-theme .ref-card-link {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(52, 152, 219, 0.06) !important;
}
.dark-theme .ref-card-link:hover {
    background: rgba(52, 152, 219, 0.12) !important;
    border-color: rgba(52, 152, 219, 0.2) !important;
}
.dark-theme .ref-snippet-text {
    background: rgba(255, 255, 255, 0.03);
}
.dark-theme .ref-block-footer {
    background: rgba(255, 255, 255, 0.03);
}
.dark-theme .inline-citation {
    background: rgba(52, 152, 219, 0.18);
    color: #5dade2;
}
.dark-theme .inline-citation-alt {
    background: rgba(142, 68, 173, 0.18);
    color: #9b59b6;
}
.dark-theme .inline-citation:hover {
    background: rgba(52, 152, 219, 0.35) !important;
}
.dark-theme .inline-citation-alt:hover {
    background: rgba(142, 68, 173, 0.35) !important;
}

/* ===== Lightbox 图片查看器 ===== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.lightbox-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    cursor: pointer;
}
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.95);
    transition: transform 0.25s ease;
    z-index: 1;
}
.lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}
.lightbox-close:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: scale(1.1);
}
.lightbox-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}
.lightbox-image {
    max-width: 85vw;
    max-height: 75vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}
.lightbox-loading {
    position: absolute;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lightbox-caption {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
    max-width: 80vw;
    line-height: 1.5;
}
.lightbox-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}
.lightbox-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.lightbox-action-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

/* ===== 图片放大提示 ===== */
.inline-image-wrapper:hover .image-zoom-hint {
    opacity: 1 !important;
}
.inline-image-wrapper:hover img {
    filter: brightness(0.95);
}

/* 深色主题下多媒体控件适配 */
.dark-theme .inline-audio-container audio::-webkit-media-controls-panel {
    background: #2c3e50;
}
.dark-theme .inline-video-container video {
    background: #1a1a2e;
}

/* 流式光标 */
.streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: var(--primary-color);
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

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

/* 打字指示器 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    width: fit-content;
    margin-left: 48px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(5px);
}

/* 带搜索状态的打字指示器 */
.typing-with-status {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 220px;
}
.typing-dots-row {
    display: flex;
    gap: 6px;
}
.typing-status-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--secondary-color);
    font-weight: 500;
}
.typing-status-text i {
    font-size: 11px;
}

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

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

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

@keyframes typingAnimation {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 消息操作按钮 */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(245, 247, 250, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

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

/* ===== 输入区域 ===== */
.input-container {
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.97);
    position: relative;
    z-index: 7;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

.input-wrapper {
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.99);
    transition: all var(--transition-fast);
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 124px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(142, 68, 173, 0.1), 0 4px 20px rgba(0, 0, 0, 0.08);
}

.text-input {
    flex: 1;
    min-height: 124px;
    max-height: 260px;
    padding: 16px 18px 14px 18px;
    border: none;
    background: none;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
    outline: none;
}

.input-actions {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    gap: 6px;
    align-items: center;
    background: transparent;
}

.input-right-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.action-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    background: rgba(248, 250, 252, 0.95);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.action-icon-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    transform: scale(1.08);
    border-color: transparent;
    box-shadow: 0 3px 12px rgba(142, 68, 173, 0.35);
}

.action-icon-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.3);
}

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

.send-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
    border-radius: 12px;
    width: 42px;
    height: 42px;
    box-shadow: 0 2px 10px rgba(142, 68, 173, 0.4);
}

.send-btn:not(:disabled):hover {
    transform: scale(1.1);
    box-shadow: 0 4px 18px rgba(142, 68, 173, 0.5);
}

.send-btn:disabled {
    background: rgba(245, 247, 250, 0.9);
    color: var(--text-light);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 文件上传区域 */
.file-upload-area {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
    clear: both;
}

.uploaded-file {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 247, 250, 0.9);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    max-width: 200px;
}

.file-icon {
    color: var(--primary-color);
    font-size: 12px;
}

.file-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-remove {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 10px;
}

.file-remove:hover {
    background: var(--accent-color);
    color: white;
}

/* ===== Markdown 渲染优化 ===== */
.message-text h1,
.message-text h2,
.message-text h3 {
    margin: 1.2em 0 0.5em;
    color: var(--primary-color);
    font-weight: 600;
}

.message-text h1 {
    font-size: 18px;
}

.message-text h2 {
    font-size: 16px;
}

.message-text h3 {
    font-size: 15px;
}

.message-text p {
    margin: 0.8em 0;
}

.message-text ul,
.message-text ol {
    margin: 0.8em 0;
    padding-left: 1.5em;
}

.message-text li {
    margin: 0.4em 0;
}

.message-text blockquote {
    border-left: 3px solid var(--primary-light);
    padding-left: 16px;
    margin: 1em 0;
    color: var(--text-secondary);
    background: rgba(245, 247, 250, 0.9);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 12px;
}

.message-text code {
    background: rgba(245, 247, 250, 0.9);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Consolas', monospace;
    font-size: 13px;
    color: var(--text-primary);
}

.message-text pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 1em 0;
    font-family: 'Consolas', monospace;
    font-size: 13px;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin: 1em 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-container th {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
}

.table-container td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
}

.table-container tr:nth-child(even) {
    background: rgba(245, 247, 250, 0.5);
}

/* ===== 模态框 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px;
    animation: modalFadeIn 0.25s ease;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.99);
    border-radius: 22px;
    padding: 28px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: modalSlideUp 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(245, 247, 250, 0.9);
    color: var(--primary-color);
}

.modal-body {
    margin-bottom: 24px;
}

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

.modal-btn {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.35);
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(142, 68, 173, 0.45);
}

.modal-btn.secondary {
    background: rgba(245, 247, 250, 0.9);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* ===== 情绪日记专用样式 ===== */
.rating-stars i {
    font-size: 28px;
    margin-right: 8px;
    cursor: pointer;
    color: #e0e0e0;
    transition: color 0.2s;
}

.rating-stars i:hover,
.rating-stars i.fas {
    color: #f39c12;
}

.diary-entry {
    transition: all 0.2s;
}

.diary-entry:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 260px;
        --sidebar-collapsed: 60px;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 100;
        width: 260px;
        box-shadow: var(--shadow-lg);
    }

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

    .navbar {
        height: 56px;
        padding: 0 12px;
    }

    .toggle-sidebar {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .nav-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .nav-title {
        font-size: 16px;
    }

    .keywords-section {
        padding: 10px 12px 0 12px;
    }

    .keyword-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .sub-nav-container {
        padding: 0 12px 10px 12px;
    }

    .sub-nav-btn {
        padding: 7px 12px;
        font-size: 11px;
    }

    .chat-container {
        padding: 12px;
        gap: 16px;
    }

    .message-content {
        max-width: 90%;
        padding: 14px;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .typing-indicator {
        margin-left: 44px;
    }

    .input-container {
        padding: 14px 16px;
    }

    .input-wrapper {
        min-height: 100px;
        border-radius: 16px;
    }

    .text-input {
        min-height: 100px;
        padding: 12px 14px 12px 14px;
        font-size: 14px;
    }

    .action-icon-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
        border-radius: 9px;
    }

    .send-btn {
        width: 38px;
        height: 38px;
    }

    .modal-content {
        padding: 20px;
    }

    .welcome-title {
        font-size: 22px;
    }

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

@media (max-width: 480px) {
    .keyword-btn {
        padding: 7px 12px;
        font-size: 11px;
    }

    .sub-nav-btn {
        padding: 6px 10px;
        font-size: 10px;
    }

    .action-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .input-wrapper {
        min-height: 88px;
        border-radius: 14px;
    }

    .text-input {
        min-height: 88px;
        font-size: 14px;
    }
}

/* 语音控制条 */
.voice-control-bar {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1001;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
}

@keyframes slideUp {
    from {
        bottom: 50px;
        opacity: 0;
    }
    to {
        bottom: 80px;
        opacity: 1;
    }
}

.voice-status {
    font-size: 13px;
    color: var(--text-primary);
}

.voice-control-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.voice-control-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* 吐司通知 */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1002;
    font-size: 13px;
    white-space: nowrap;
    animation: toastIn 0.3s ease-out;
    backdrop-filter: blur(20px);
}

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

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

/* 记忆标记 */
.memory-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: 8px;
    vertical-align: middle;
}

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

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

/* ===== 思维链容器 ===== */
.chain-of-thought {
    margin: 12px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(245, 247, 250, 0.9), rgba(230, 240, 250, 0.9));
    transition: all 0.3s ease;
}

.chain-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--secondary-light), var(--secondary-color));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease;
}

.chain-header:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
}

.chain-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.chain-toggle {
    transition: transform 0.3s ease;
    font-size: 14px;
}

.chain-toggle.expanded {
    transform: rotate(180deg);
}

.chain-content {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    border-top: 1px solid var(--border-color);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
}

.chain-content.collapsed {
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
    border-top: none;
}

.chain-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 10px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 12px;
    margin: 8px 0;
}

/* ===== 搜索结果引用 ===== */
.search-reference {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08), rgba(52, 152, 219, 0.08));
    border-radius: var(--radius-md);
    border-left: 4px solid var(--success-color);
    box-shadow: var(--shadow-sm);
}

.reference-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.reference-list {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 8px;
}

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

.reference-list::-webkit-scrollbar-track {
    background: rgba(245, 247, 250, 0.5);
    border-radius: 3px;
}

.reference-list::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

.reference-item {
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--secondary-color);
}

.reference-item:before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.reference-link {
    color: var(--secondary-color);
    text-decoration: none;
    word-break: break-all;
}

.reference-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ===== 模式状态显示 ===== */
.mode-status {
    display: none;
    margin-top: 8px;
    font-size: 12px;
    color: var(--primary-color);
    padding: 4px 8px;
    background: rgba(245, 247, 250, 0.9);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.mode-status span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
}

.mode-status i {
    font-size: 11px;
}

/* ===== 拍照上传按钮 ===== */
.camera-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.camera-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ===== 独立页面通用样式 ===== */
.static-page {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}

.static-page h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.static-page h2 {
    font-size: 22px;
    margin: 30px 0 15px;
    color: var(--secondary-color);
}

.static-page p {
    margin: 16px 0;
    line-height: 1.8;
}

.static-page ul,
.static-page ol {
    margin: 16px 0;
    padding-left: 24px;
}

.static-page li {
    margin: 8px 0;
}

.static-page a {
    color: var(--primary-color);
    text-decoration: none;
}

.static-page a:hover {
    text-decoration: underline;
}

/* ===== 黑暗主题 ===== */
.dark-theme {
    --primary-color: #9b59b6;
    --primary-light: #8e44ad;
    --primary-dark: #7d3c98;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --warning-color: #f39c12;
    --background-light: rgba(44, 62, 80, 0.95);
    --background-card: rgba(52, 73, 94, 0.95);
    --background-sidebar: rgba(44, 62, 80, 0.95);
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --text-light: #95a5a6;
    --border-color: rgba(74, 98, 120, 0.5);
}

.dark-theme .app-container {
    background: rgba(0, 0, 0, 0.35);
}

.dark-theme .message-content {
    background: var(--background-card);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.15);
}

.dark-theme .chat-message.user .message-content {
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.22), rgba(52, 152, 219, 0.22));
}

.dark-theme .input-wrapper {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(142, 68, 173, 0.35);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.dark-theme .input-wrapper:focus-within {
    border-color: rgba(155, 89, 182, 0.7);
    box-shadow: 0 0 0 4px rgba(142, 68, 173, 0.15), 0 4px 20px rgba(0, 0, 0, 0.2);
}

.dark-theme .text-input {
    background: transparent;
    color: var(--text-primary);
}

.dark-theme .text-input::placeholder {
    color: var(--text-light);
}

.dark-theme .input-container {
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.15), rgba(52, 152, 219, 0.1));
    border-top-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.dark-theme .action-icon-btn {
    background: var(--background-sidebar);
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-theme .action-icon-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-color: transparent;
}

.dark-theme .navbar {
    background: rgba(40, 56, 72, 0.97);
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.dark-theme .keywords-section {
    background: rgba(44, 62, 80, 0.97);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.dark-theme .keyword-btn {
    background: var(--background-sidebar);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-theme .sub-nav-container {
    background: rgba(44, 62, 80, 0.97);
    border-color: rgba(255, 255, 255, 0.06);
}

.dark-theme .sub-nav-btn {
    background: var(--background-sidebar);
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.07);
}

.dark-theme .uploaded-file {
    background: var(--background-sidebar);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.dark-theme .modal-content {
    background: var(--background-card);
    color: var(--text-primary);
}

.dark-theme input,
.dark-theme select,
.dark-theme textarea {
    background: var(--background-sidebar);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.dark-theme .typing-indicator {
    background: var(--background-card);
    border-color: var(--border-color);
}
.dark-theme .typing-status-text {
    color: #5dade2;
}

.dark-theme .action-btn {
    background: var(--background-sidebar);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.dark-theme .nav-link {
    color: white;
}

.dark-theme .history-item {
    color: white;
}

.dark-theme .chain-of-thought {
    background: var(--background-sidebar);
    border-color: var(--border-color);
}

.dark-theme .chain-content {
    color: var(--text-primary);
    border-top-color: var(--border-color);
}

.dark-theme .search-reference {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(52, 152, 219, 0.1));
    border-left-color: var(--success-color);
}

.dark-theme .mode-status {
    background: var(--background-sidebar);
    border-color: var(--border-color);
}

.dark-theme .camera-btn {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.8), rgba(46, 204, 113, 0.8));
}

.dark-theme .static-page {
    background: var(--background-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* ===== 关怀模式 ===== */
.care-mode {
    font-size: 1.2em;
}

.care-mode .nav-title,
.care-mode .nav-btn,
.care-mode .keyword-btn,
.care-mode .sub-nav-btn,
.care-mode .action-btn,
.care-mode .message-text,
.care-mode .welcome-title,
.care-mode .welcome-subtitle,
.care-mode .history-title,
.care-mode .history-time,
.care-mode .user-name,
.care-mode .user-role,
.care-mode .disclaimer-link,
.care-mode .modal-title,
.care-mode .modal-body,
.care-mode .breadcrumb,
.care-mode .info-row,
.care-mode .card-header,
.care-mode .invite-box input,
.care-mode .badge,
.care-mode .btn {
    font-size: 1.1em;
}

/* 强制增大所有标题（蓝色小标题） */
.care-mode h1,
.care-mode h2,
.care-mode h3,
.care-mode h4,
.care-mode h5,
.care-mode h6,
.care-mode .message-text h1,
.care-mode .message-text h2,
.care-mode .message-text h3,
.care-mode .card-header,
.care-mode .nav-title,
.care-mode .modal-title {
    font-size: 1.4em !important;
}

.care-mode .chat-message .message-content {
    font-size: 1.4em;
    line-height: 1.8;
}

.care-mode .nav-btn i,
.care-mode .keyword-btn i,
.care-mode .action-btn i {
    filter: contrast(1.5);
}

.care-mode .keyword-btn {
    padding: 12px 18px;
}

.care-mode .message-avatar {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.care-mode .action-btn {
    font-size: 1.1em;
    padding: 8px 16px;
    white-space: nowrap;
}

.care-mode .message-actions {
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 768px) {
    .care-mode .keyword-btn {
        padding: 10px 14px;
        font-size: 1em;
    }
    .care-mode .action-btn {
        padding: 6px 12px;
        font-size: 1em;
    }
    .care-mode .message-avatar {
        width: 36px;
        height: 36px;
    }
    .care-mode .chat-message .message-content {
        font-size: 1.3em;
    }
}

/* 为兼容旧类名，保留 caring-mode */
body.caring-mode {
    font-size: 1.2em;
}

body.caring-mode .chat-message .message-text {
    font-size: 1.4em !important;
}

body.caring-mode .action-btn,
body.caring-mode .keyword-btn,
body.caring-mode .nav-btn {
    filter: contrast(1.5);
}

/* ===== 超小屏幕优化 (max-width: 380px) ===== */
@media (max-width: 380px) {
    .keyword-btn {
        padding: 6px 10px;
        font-size: 10px;
    }
    .sub-nav-btn {
        padding: 5px 8px;
        font-size: 9px;
    }
    .message-content {
        max-width: 95%;
        padding: 10px 12px;
    }
    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .action-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
    .action-icon-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
        border-radius: 8px;
    }
    .send-btn {
        width: 34px;
        height: 34px;
    }
    .text-input {
        font-size: 13px;
        min-height: 80px;
    }
    .input-wrapper {
        min-height: 80px;
        border-radius: 14px;
    }
    .nav-title {
        font-size: 14px;
    }
    .navbar {
        height: 54px;
    }
}

.share-btn {
    background: var(--background-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.share-btn:hover {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}
/* 实名认证与私信样式 */
.verification-status { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.status-verified { background: #27ae60; color: white; }
.status-pending { background: #f39c12; color: white; }
.status-rejected { background: #e74c3c; color: white; }
.status-none { background: #95a5a6; color: white; }
.privacy-select { padding: 6px 12px; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--background-card); color: var(--text-primary); font-size: 14px; }
.private-message-item { background: var(--background-card); border-radius: var(--radius-md); margin-bottom: 12px; padding: 16px; border: 1px solid var(--border-color); transition: all 0.2s; }
.private-message-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.message-subject { font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.message-meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.message-content-preview { font-size: 13px; color: var(--text-primary); margin-bottom: 12px; line-height: 1.5; }
.message-actions { display: flex; gap: 8px; justify-content: flex-end; }
.unread-badge { background: var(--accent-color); color: white; border-radius: 20px; padding: 2px 8px; font-size: 11px; margin-left: 8px; }
.message-list-container { max-height: 500px; overflow-y: auto; }
.modal .modal-body textarea, .modal .modal-body input { width: 100%; padding: 10px; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--background-card); color: var(--text-primary); margin-bottom: 12px; font-family: inherit; }
.dark-theme .private-message-item { background: var(--background-card); border-color: var(--border-color); }
@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr !important; }
    .message-meta { flex-direction: column; gap: 4px; }

    /* 移动端多模态引用优化 */
    .search-ref-block {
        margin-top: 14px;
        border-radius: 12px;
    }
    .ref-section-hd {
        padding: 10px 12px;
        gap: 8px;
    }
    .ref-section-icon {
        width: 26px; height: 26px;
        font-size: 12px;
        border-radius: 6px;
    }
    .ref-section-label {
        font-size: 12px;
    }
    .ref-section-count {
        font-size: 10px;
        padding: 1px 7px;
    }
    .ref-section-toggle {
        width: 22px; height: 22px;
        font-size: 10px;
    }
    .ref-section-body {
        padding: 4px 8px 8px;
        max-height: 260px;
    }
    .ref-card-link {
        padding: 10px 11px !important;
        gap: 8px !important;
    }
    .ref-num-badge {
        min-width: 20px; height: 20px;
        font-size: 10px;
    }
    .ref-card-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    .ref-snippet-text {
        font-size: 10px;
        padding: 6px 8px;
        -webkit-line-clamp: 2;
    }
    .ref-domain-text {
        max-width: 120px;
    }
    .ref-block-footer {
        font-size: 9px;
        padding: 6px 12px;
    }

    /* 搜索状态指示器移动端 */
    .typing-with-status {
        min-width: 180px;
        padding: 12px;
    }
    .typing-status-text {
        font-size: 11px;
    }

    /* 移动端Lightbox优化 */
    .lightbox-content {
        max-width: 95vw;
        max-height: 85vh;
    }
    .lightbox-image {
        max-width: 95vw;
        max-height: 65vh;
    }
    .lightbox-close {
        top: -38px;
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
    .lightbox-caption {
        font-size: 12px;
    }
    .lightbox-action-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* 移动端内嵌多媒体 */
    .inline-image-container img {
        max-height: 300px;
    }
    .inline-video-container video,
    .inline-video-container iframe {
        max-width: 100%;
    }
    .inline-audio-container audio {
        max-width: 100%;
    }

    /* 移动端内联引用标记 */
    .inline-citation {
        font-size: 10px !important;
        padding: 0px 4px !important;
    }
}