/* ==================== 清月学术 - 1:1复刻沁言学术视觉风格 ==================== */
/* CSS变量定义颜色系统 */
:root {
    /* 品牌主色 */
    --brand-primary: #6C5CE7;
    --brand-primary-light: #a29bfe;
    --brand-primary-dark: #5a4bd1;
    --brand-primary-bg: rgba(108, 92, 231, 0.08);

    /* 导航栏 */
    --sidebar-bg: #1E1E2E;
    --sidebar-hover: #2D2D3F;
    --sidebar-active: rgba(108, 92, 231, 0.15);
    --sidebar-text: #B8B8CC;
    --sidebar-text-active: #FFFFFF;
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 64px;

    /* 主内容区 */
    --content-bg: #FFFFFF;
    --content-bg-gray: #F5F5F7;
    --content-bg-card: #FAFAFA;

    /* 文字 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --text-placeholder: #CCCCCC;

    /* 边框 */
    --border-light: #EAEAEA;
    --border-medium: #DDDDDD;

    /* 功能图标色 */
    --func-red: #e74c3c;
    --func-cyan: #00b894;
    --func-blue: #0984e3;
    --func-purple: #6C5CE7;
    --func-orange: #e17055;
    --func-yellow: #F39C12;

    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 16px 50px rgba(0,0,0,0.18);

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ==================== 全局重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--content-bg);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* ==================== 登录页 ==================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.login-modal {
    display: flex;
    width: 860px;
    min-height: 520px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: modalFadeIn 0.35s ease;
}

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

/* 左侧品牌区 */
.login-left {
    flex: 0 0 380px;
    background: linear-gradient(135deg, #6C5CE7 0%, #4a3db5 40%, #3a2d9a 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 40px;
    overflow: hidden;
}

/* 点阵肌理背景 */
.login-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

/* 星光装饰 */
.star {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255,255,255,0.8), 0 0 24px rgba(255,255,255,0.4);
}

.star-1 { top: 30px; right: 80px; animation: twinkle 2s ease-in-out infinite; }
.star-2 { top: 50px; right: 140px; width: 6px; height: 6px; animation: twinkle 2.5s ease-in-out infinite 0.5s; }
.star-3 { top: 70px; right: 50px; width: 5px; height: 5px; animation: twinkle 3s ease-in-out infinite 1s; }

@keyframes twinkle {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* AI标识 */
.login-left-ai-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #4FC3F7;
    color: white;
    font-weight: 800;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.4);
}

.login-left-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.login-title {
    color: white;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
}

.login-title-brand {
    font-size: 34px;
    font-weight: 800;
    background: linear-gradient(90deg, #fff, #e0d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-desc {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.login-features {
    list-style: none;
    text-align: left;
    margin-bottom: 32px;
}

.login-features li {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    padding: 6px 0;
    line-height: 1.5;
}

.login-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 24px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition-normal);
    backdrop-filter: blur(4px);
}

.login-download-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 右侧登录区 */
.login-right {
    flex: 1;
    background: white;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
}

.login-header {
    text-align: center;
    margin-bottom: 8px;
}

.login-tab {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.login-tab.active {
    color: var(--brand-primary);
}

.login-tab:hover {
    color: var(--brand-primary-light);
}

.login-divider {
    color: var(--border-medium);
    font-size: 20px;
    margin: 0 12px;
    font-weight: 300;
}

.login-subtitle {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
    margin-bottom: 24px;
}

/* 登录方式Tab */
.login-method-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 24px;
}

.method-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-tertiary);
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

.method-tab.active {
    color: var(--brand-primary);
    font-weight: 600;
}

.method-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--brand-primary);
    border-radius: 1px;
}

.method-tab:hover {
    color: var(--brand-primary);
}

/* 登录方式内容 */
.login-method-content {
    display: none;
    flex: 1;
}

.login-method-content.active {
    display: flex;
    flex-direction: column;
}

/* 微信登录 */
.wechat-qr-area {
    display: flex;
    justify-content: center;
    padding: 24px 0 16px;
}

.wechat-qr-placeholder {
    width: 200px;
    height: 200px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--content-bg-gray);
}

.wechat-tip {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.brand-inline {
    color: var(--brand-primary);
    font-weight: 600;
}

.privacy-link {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--brand-primary);
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition-fast);
    background: white;
}

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

.form-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.sms-group {
    display: flex;
    gap: 10px;
}

.sms-input {
    flex: 1;
}

.sms-btn {
    flex-shrink: 0;
    padding: 0 16px;
    height: 44px;
    background: white;
    border: 1px solid var(--brand-primary);
    border-radius: var(--radius-md);
    color: var(--brand-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.sms-btn:hover {
    background: var(--brand-primary-bg);
}

.form-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

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

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border-medium);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

.checkbox-input:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 10px;
    font-weight: 700;
}

.privacy-link-inline {
    color: var(--brand-primary);
}

.login-submit-btn {
    width: 100%;
    height: 44px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.login-submit-btn:hover {
    background: linear-gradient(135deg, var(--brand-primary-light), var(--brand-primary));
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
}

.login-submit-btn:active {
    transform: scale(0.98);
}

/* ==================== 主界面 ==================== */
.main-app {
    display: flex;
    width: 100%;
    height: 100%;
}

/* 左侧导航栏 */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    overflow: hidden;
    flex-shrink: 0;
}

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

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-arrow {
    display: none;
}

.sidebar.collapsed .nav-item-content {
    justify-content: center;
    padding: 0;
}

.sidebar.collapsed .nav-icon {
    margin: 0;
}

.sidebar.collapsed .nav-children {
    display: none !important;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 0;
}

.sidebar.collapsed .logo-icon {
    margin: 0;
}

.sidebar-header {
    padding: 18px 16px 12px;
    display: flex;
    align-items: center;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

/* 导航项 */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-item-content {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--sidebar-text);
    gap: 10px;
}

.nav-item-content:hover {
    background: var(--sidebar-hover);
    color: #E0E0F0;
}

.nav-item.active > .nav-item-content {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.nav-item.active > .nav-item-content .nav-icon {
    color: var(--brand-primary-light);
}

.nav-icon {
    flex-shrink: 0;
    color: var(--sidebar-text);
    opacity: 0.7;
    transition: var(--transition-fast);
}

.nav-item-content:hover .nav-icon {
    opacity: 1;
}

.nav-item-content span {
    flex: 1;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-arrow {
    flex-shrink: 0;
    transition: transform var(--transition-fast);
    opacity: 0.5;
}

.nav-item.expanded > .nav-item-content .nav-arrow {
    transform: rotate(90deg);
    opacity: 0.8;
}

/* 子菜单 */
.nav-children {
    display: none;
    padding-left: 42px;
}

.nav-item.expanded > .nav-children {
    display: block;
}

.nav-child {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--sidebar-text);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    margin: 1px 0;
    opacity: 0.75;
}

.nav-child:hover {
    background: var(--sidebar-hover);
    color: #E0E0F0;
    opacity: 1;
}

.nav-child.active {
    color: var(--brand-primary-light);
    opacity: 1;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-collapse-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--sidebar-text);
    opacity: 0.5;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.sidebar-collapse-btn:hover {
    background: var(--sidebar-hover);
    opacity: 0.8;
}

.sidebar.collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: var(--content-bg);
}

.page {
    display: none;
    height: 100%;
    overflow-y: auto;
}

.page.active {
    display: block;
}

/* ==================== 学术超级智能体主页 ==================== */
.agent-home {
    max-width: 820px;
    margin: 0 auto;
    padding: 40px 32px 80px;
}

.agent-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.agent-icon {
    display: inline-block;
    margin-bottom: 12px;
}

.agent-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.agent-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.memory-capsule-btn {
    display: inline-block;
    padding: 6px 16px;
    background: var(--brand-primary-bg);
    color: var(--brand-primary);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.memory-capsule-btn:hover {
    background: rgba(108, 92, 231, 0.15);
    border-color: var(--brand-primary);
}

/* 输入框区域 */
.agent-input-area {
    margin-bottom: 28px;
}

.agent-input-box {
    background: white;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 0;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.agent-input-box:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.08), var(--shadow-md);
}

.agent-input {
    width: 100%;
    border: none;
    resize: none;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 24px;
    max-height: 120px;
    overflow-y: auto;
}

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

.agent-input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0;
    padding: 10px 12px;
    border-top: 1px solid var(--border-light);
}

.input-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--content-bg-gray);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.input-action-btn:hover {
    background: var(--brand-primary-bg);
    color: var(--brand-primary);
    border-color: rgba(108, 92, 231, 0.2);
}

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

.voice-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--content-bg-gray);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.voice-btn:hover {
    color: var(--brand-primary);
    background: var(--brand-primary-bg);
}

.send-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--brand-primary);
    color: white;
    cursor: pointer;
    transition: var(--transition-fast);
}

.send-btn:hover {
    background: var(--brand-primary-light);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

/* 功能圆形图标入口 */
.agent-quick-functions {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 36px;
}

.quick-func {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.quick-func:hover {
    transform: translateY(-3px);
}

.quick-func:hover .quick-func-icon {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.quick-func-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.quick-func-name {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 三大业务板块入口 */
.agent-business-entries {
    margin-bottom: 32px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    position: relative;
    padding-left: 10px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 3px;
    background: var(--brand-primary);
    border-radius: 2px;
}

.business-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.business-card {
    background: var(--content-bg-gray);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition-normal);
    border: 1px solid transparent;
}

.business-card:hover {
    background: white;
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.business-card-icon {
    flex-shrink: 0;
}

.business-card-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.business-card-info p {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 热门任务 */
.agent-hot-tasks {
    margin-bottom: 32px;
}

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

.hot-task-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--content-bg-gray);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    border: 1px solid transparent;
}

.hot-task-card:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    border-color: var(--border-light);
}

.hot-task-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hot-task-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.hot-task-info p {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* 可以从这里开始 */
.agent-start-section {
    margin-bottom: 20px;
}

.start-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.start-card {
    background: var(--content-bg-gray);
    border-radius: var(--radius-md);
    padding: 18px 16px;
}

.start-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.start-card-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.start-item {
    padding: 6px 14px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.start-item:hover {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    background: var(--brand-primary-bg);
}

/* ==================== 对话交互页面 ==================== */
.page-chat {
    height: 100%;
}

.chat-layout {
    display: flex;
    height: 100%;
}

/* 对话历史侧栏 */
.chat-history-sidebar {
    width: 240px;
    background: var(--content-bg-gray);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chat-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-light);
}

.chat-history-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.new-chat-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: white;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.new-chat-btn:hover {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

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

.chat-history-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.chat-history-item:hover {
    background: white;
}

.chat-history-item.active {
    background: white;
    box-shadow: var(--shadow-sm);
}

.history-item-title {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-time {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    margin-left: 8px;
}

/* 对话主区域 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.chat-welcome {
    text-align: center;
    padding: 60px 20px;
}

.chat-welcome-icon {
    margin-bottom: 16px;
}

.chat-welcome h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chat-welcome p {
    font-size: 14px;
    color: var(--text-tertiary);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 对话消息 */
.chat-message {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    animation: messageIn 0.3s ease;
}

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

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

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

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

.chat-message.user .message-avatar {
    background: var(--content-bg-gray);
    color: var(--text-tertiary);
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.7;
}

.chat-message.ai .message-content {
    background: var(--content-bg-gray);
    color: var(--text-primary);
    border-top-left-radius: 4px;
}

.chat-message.user .message-content {
    background: var(--brand-primary);
    color: white;
    border-top-right-radius: 4px;
}

/* 输入区域 */
.chat-input-area {
    padding: 0 24px 16px;
}

.chat-input-box {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 0;
    transition: var(--transition-fast);
}

.chat-input-box:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.08);
}

.chat-attach-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--content-bg-gray);
    color: var(--text-tertiary);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.chat-attach-btn:hover {
    color: var(--brand-primary);
    background: var(--brand-primary-bg);
}

.chat-input {
    flex: 1;
    border: none;
    resize: none;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    max-height: 120px;
    min-height: 24px;
}

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

.chat-send-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--brand-primary);
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.chat-send-btn:hover {
    background: var(--brand-primary-light);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.chat-input-hint {
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 8px;
    opacity: 0.7;
}

/* ==================== 辅助写作页面（三栏） ==================== */
.page-writing {
    height: 100%;
}

.writing-layout {
    display: flex;
    height: 100%;
}

/* 左栏：知识库 */
.writing-left-panel {
    width: 260px;
    background: var(--content-bg-gray);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

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

.panel-add-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: white;
    color: var(--text-tertiary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.panel-add-btn:hover {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.knowledge-list {
    padding: 8px 12px;
    flex: 1;
    overflow-y: auto;
}

.knowledge-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 2px;
}

.knowledge-item:hover {
    background: white;
}

.knowledge-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-tertiary);
    background: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.reference-section {
    border-top: 1px solid var(--border-light);
    padding: 12px;
}

.reference-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.reference-list {
    min-height: 60px;
}

.reference-empty {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
    padding: 20px 0;
}

/* 中栏：编辑器 */
.writing-center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: white;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--content-bg-gray);
}

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

.toolbar-btn {
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

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

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-light);
    margin: 0 4px;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 4px;
}

.editor-body {
    flex: 1;
    padding: 32px 48px;
    overflow-y: auto;
    outline: none;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.editor-body h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.editor-body:empty::before {
    content: '在此开始写作...';
    color: var(--text-placeholder);
}

.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-tertiary);
}

.auto-save {
    color: #27AE60;
}

/* 右栏：AI对话 */
.writing-right-panel {
    width: 320px;
    border-left: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: white;
}

.writing-chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.writing-chat-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.writing-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.writing-chat-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.writing-chat-placeholder p {
    margin-top: 12px;
    font-size: 13px;
}

.writing-chat-input-area {
    padding: 0;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.writing-chat-input {
    flex: 1;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    resize: none;
    font-size: 13px;
    color: var(--text-primary);
    min-height: 40px;
    max-height: 100px;
}

.writing-chat-input:focus {
    outline: none;
}

.writing-chat-send-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--brand-primary);
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.writing-chat-send-btn:hover {
    background: var(--brand-primary-light);
}

/* ==================== 业务板块页面 ==================== */
.biz-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 32px;
}

.biz-page-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 36px;
}

.biz-page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.biz-page-header p {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.biz-stages {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.biz-stage {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--content-bg-gray);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    cursor: pointer;
}

.biz-stage:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

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

.stage-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

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

.biz-start-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.biz-start-btn:hover {
    background: linear-gradient(135deg, var(--brand-primary-light), var(--brand-primary));
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
}

/* ==================== 通用页面 ==================== */
.generic-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 32px;
}

.generic-page h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.generic-desc {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 32px;
}

.generic-empty {
    text-align: center;
    padding: 40px 20px;
}

.generic-empty p {
    margin: 16px 0;
    color: var(--text-tertiary);
    font-size: 14px;
}

.generic-create-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.generic-create-btn:hover {
    background: var(--brand-primary-light);
}

/* 下载页面 */
.download-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 24px;
}

.download-card {
    background: var(--content-bg-gray);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: var(--transition-normal);
}

.download-card:hover {
    background: white;
    box-shadow: var(--shadow-sm);
}

.dl-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.download-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.download-card button {
    padding: 8px 24px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.download-card button:hover {
    background: var(--brand-primary-light);
}

/* ==================== 用户区域 ==================== */
.user-area {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 100;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--content-bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-tertiary);
    border: 2px solid var(--border-light);
}

.user-avatar:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 46px;
    right: 0;
    width: 260px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    padding: 16px;
    z-index: 200;
    animation: dropdownIn 0.2s ease;
}

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

.user-dropdown.show {
    display: block;
}

.user-info-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

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

.user-pro-badge {
    background: linear-gradient(135deg, #F39C12, #E67E22);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.user-invite {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--content-bg-gray);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 12px;
}

.invite-label {
    color: var(--text-tertiary);
}

.invite-code {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.copy-invite-btn {
    margin-left: auto;
    padding: 3px 10px;
    background: var(--brand-primary-bg);
    color: var(--brand-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.upgrade-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    transition: var(--transition-fast);
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, var(--brand-primary-light), var(--brand-primary));
}

.storage-section {
    margin-bottom: 12px;
}

.storage-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.storage-bar {
    height: 6px;
    background: var(--content-bg-gray);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.storage-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-light));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.user-menu-list {
    border-top: 1px solid var(--border-light);
    padding-top: 8px;
}

.user-menu-item {
    display: block;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.user-menu-item:hover {
    background: var(--content-bg-gray);
    color: var(--text-primary);
    text-decoration: none;
}

.user-menu-item.logout {
    color: #e74c3c;
}

.user-menu-item.logout:hover {
    background: #FFF5F5;
    color: #c0392b;
}

/* ==================== 机器人吉祥物 ==================== */
.robot-mascot {
    position: fixed;
    bottom: 100px;
    right: 28px;
    z-index: 50;
    cursor: pointer;
    transition: var(--transition-normal);
    user-select: none;
}

.robot-mascot:hover {
    transform: translateY(-5px);
}

.robot-body {
    position: relative;
    width: 64px;
    height: 72px;
}

.robot-hat {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.hat-top {
    width: 28px;
    height: 20px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
    border-radius: 4px 4px 0 0;
    margin: 0 auto;
    position: relative;
}

.hat-top::after {
    content: '';
    position: absolute;
    top: 2px;
    right: -3px;
    width: 8px;
    height: 8px;
    background: #F39C12;
    border-radius: 50%;
}

.hat-brim {
    width: 42px;
    height: 6px;
    background: var(--brand-primary-dark);
    border-radius: 2px;
}

.robot-face {
    width: 64px;
    height: 60px;
    background: linear-gradient(135deg, #a29bfe, #6C5CE7);
    border-radius: 50% 50% 45% 45%;
    position: absolute;
    top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.robot-eyes {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.robot-eye {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    position: relative;
}

.robot-eye::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    background: #333;
    border-radius: 50%;
    top: 2px;
    left: 2px;
}

.robot-eye.left {
    animation: blink 4s ease-in-out infinite;
}

.robot-eye.right {
    animation: blink 4s ease-in-out infinite 0.1s;
}

@keyframes blink {
    0%, 45%, 55%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}

.robot-mouth {
    width: 14px;
    height: 7px;
    border-bottom: 2.5px solid white;
    border-radius: 0 0 50% 50%;
    opacity: 0.8;
}

/* ==================== 响应式 ==================== */
@media (max-width: 1200px) {
    .writing-left-panel {
        width: 220px;
    }
    .writing-right-panel {
        width: 280px;
    }
}

@media (max-width: 1024px) {
    .login-modal {
        width: 90%;
        max-width: 760px;
    }
    .login-left {
        flex: 0 0 320px;
    }
    .agent-quick-functions {
        gap: 20px;
    }
    .business-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .login-modal {
        flex-direction: column;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    .login-left {
        flex: none;
        padding: 32px 24px;
    }
    .sidebar {
        display: none;
    }
    .agent-quick-functions {
        flex-wrap: wrap;
        gap: 16px;
    }
    .business-cards,
    .start-cards,
    .hot-task-cards {
        grid-template-columns: 1fr;
    }
    .chat-history-sidebar {
        display: none;
    }
    .writing-left-panel,
    .writing-right-panel {
        display: none;
    }
}

/* ==================== 过渡动画 ==================== */
.page {
    animation: pageIn 0.3s ease;
}

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

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* 加载动画 */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-primary-light);
    animation: typingDot 1.4s ease-in-out infinite;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* V3.1.3: 登录弹窗关闭按钮 */
.login-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0,0,0,0.06);
    color: #666;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    line-height: 1;
}
.login-close-btn:hover {
    background: rgba(0,0,0,0.12);
    color: #333;
}
/* V3.1.7: 游客登录提示条已删除（原guest-login-bar样式移除） */



/* ==================== V3.1.4: 发送按钮状态 ==================== */
.send-btn-disabled,
.chat-send-btn.send-btn-disabled,
.writing-chat-send-btn.send-btn-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #b2bec3;
    pointer-events: none;
}
.send-btn-active,
.chat-send-btn.send-btn-active,
.writing-chat-send-btn.send-btn-active {
    opacity: 1;
    cursor: pointer;
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    pointer-events: auto;
}

/* V3.1.4: 主页输入框上传附件按钮 */
.agent-attach-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #636e72;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    flex-shrink: 0;
}
.agent-attach-btn:hover {
    color: #6C5CE7;
}

/* V3.1.5: 文件标签容器和标签样式 */
.file-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px 0 10px;
    min-height: 0;
}
.file-chips-container:empty {
    padding: 0;
    display: none;
}
.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0eeff;
    color: #6C5CE7;
    font-size: 12px;
    padding: 3px 8px 3px 6px;
    border-radius: 12px;
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    animation: chipIn 0.2s ease;
}
@keyframes chipIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}
.file-chip-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.file-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-chip-size {
    color: #999;
    font-size: 11px;
    flex-shrink: 0;
}
.file-chip-remove {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: #999;
    flex-shrink: 0;
    transition: all 0.15s;
    margin-left: 2px;
}
.file-chip-remove:hover {
    color: #e74c3c;
    background: rgba(231,76,60,0.1);
}

/* V3.1.5: 输入行布局 */
.agent-input-row {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 8px 10px;
}
.chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 8px 10px;
}
.writing-chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 8px 10px;
}
.writing-attach-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--content-bg-gray);
    color: var(--text-tertiary);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-fast);
}
.writing-attach-btn:hover {
    color: var(--brand-primary);
    background: var(--brand-primary-bg);
}

/* V3.1.4: 机器人悬浮对话窗口 */
.robot-chat-window {
    position: fixed;
    bottom: 180px;
    right: 28px;
    width: 360px;
    max-height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: robotChatIn 0.25s ease-out;
}
@keyframes robotChatIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.robot-chat-header {
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.robot-chat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}
.robot-chat-close {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 2px;
}
.robot-chat-close:hover {
    opacity: 1;
}
.robot-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    max-height: 320px;
    background: #f8f9fa;
}
.robot-chat-bubble {
    margin-bottom: 12px;
    max-width: 85%;
}
.robot-bubble-ai {
    background: #fff;
    border-radius: 12px 12px 12px 4px;
    padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.robot-bubble-ai p {
    margin: 0;
    font-size: 13px;
    color: #2d3436;
    line-height: 1.6;
}
.robot-bubble-user {
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    border-radius: 12px 12px 4px 12px;
    padding: 10px 14px;
    margin-left: auto;
}
.robot-bubble-user p {
    margin: 0;
    font-size: 13px;
    color: #fff;
    line-height: 1.5;
}
.robot-chat-input-area {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    align-items: center;
    border-top: 1px solid #eee;
    background: #fff;
}
.robot-chat-input {
    flex: 1;
    border: 1px solid #dfe6e9;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.robot-chat-input:focus {
    border-color: #6C5CE7;
}
.robot-chat-send {
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.2s;
    flex-shrink: 0;
}
.robot-chat-send:hover {
    transform: scale(1.1);
}
/* ==================== 主题切换 ==================== */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--sidebar-text);
    opacity: 0.6;
    transition: var(--transition-fast);
    margin-bottom: 6px;
    user-select: none;
    font-size: 12px;
}

.theme-toggle:hover {
    background: var(--sidebar-hover);
    opacity: 0.9;
}

.theme-toggle-track {
    width: 36px;
    height: 18px;
    background: rgba(255,255,255,0.12);
    border-radius: 9px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.3s;
}

.theme-toggle-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 亮色模式 - thumb在左 */
.theme-toggle[data-theme="light"] .theme-toggle-thumb {
    transform: translateX(0);
}
.theme-toggle[data-theme="light"] .theme-toggle-track {
    background: rgba(255,255,255,0.12);
}

/* 暗色模式 - thumb在中 */
.theme-toggle[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(11px);
}
.theme-toggle[data-theme="dark"] .theme-toggle-track {
    background: rgba(124,106,224,0.4);
}

/* 系统模式 - thumb在右 */
.theme-toggle[data-theme="system"] .theme-toggle-thumb {
    transform: translateX(22px);
}
.theme-toggle[data-theme="system"] .theme-toggle-track {
    background: rgba(255,255,255,0.18);
}

.theme-icon {
    flex-shrink: 0;
    display: none;
}

.theme-toggle[data-theme="light"] .theme-icon-light { display: block; }
.theme-toggle[data-theme="dark"] .theme-icon-dark { display: block; }
.theme-toggle[data-theme="system"] .theme-icon-system { display: block; }

.theme-label {
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

/* ==================== 暗色模式 ==================== */
body[data-color-mode="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #1e1e36;
    --bg-input: #252545;
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b8;
    --text-tertiary: #7878a0;
    --border-color: rgba(255,255,255,0.08);
    --border-light: rgba(255,255,255,0.05);
    --hover-bg: rgba(255,255,255,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

body[data-color-mode="dark"] .main-content {
    background: var(--bg-primary);
}

body[data-color-mode="dark"] .page-agent,
body[data-color-mode="dark"] .page-chat,
body[data-color-mode="dark"] .page-writing,
body[data-color-mode="dark"] .page-knowledge,
body[data-color-mode="dark"] .page-agent-list,
body[data-color-mode="dark"] .page-files,
body[data-color-mode="dark"] .page-group,
body[data-color-mode="dark"] .page-history,
body[data-color-mode="dark"] .page-download {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body[data-color-mode="dark"] .agent-greeting h2,
body[data-color-mode="dark"] .section-title,
body[data-color-mode="dark"] .card-title {
    color: var(--text-primary);
}

body[data-color-mode="dark"] .agent-greeting p,
body[data-color-mode="dark"] .card-desc,
body[data-color-mode="dark"] .hot-task-desc {
    color: var(--text-secondary);
}

body[data-color-mode="dark"] .feature-card,
body[data-color-mode="dark"] .hot-task-card,
body[data-color-mode="dark"] .quick-action-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body[data-color-mode="dark"] .feature-card:hover,
body[data-color-mode="dark"] .hot-task-card:hover {
    background: rgba(124,106,224,0.08);
    border-color: rgba(124,106,224,0.3);
}

body[data-color-mode="dark"] .agent-input-box,
body[data-color-mode="dark"] .chat-input-box,
body[data-color-mode="dark"] .writing-chat-input-area {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body[data-color-mode="dark"] .agent-input textarea,
body[data-color-mode="dark"] .chat-input textarea,
body[data-color-mode="dark"] .writing-chat-input {
    color: var(--text-primary);
    background: transparent;
}

body[data-color-mode="dark"] .agent-input textarea::placeholder,
body[data-color-mode="dark"] .chat-input textarea::placeholder,
body[data-color-mode="dark"] .writing-chat-input::placeholder {
    color: var(--text-tertiary);
}

body[data-color-mode="dark"] .agent-input-actions button,
body[data-color-mode="dark"] .chat-input-actions button {
    color: var(--text-secondary);
    background: var(--bg-input);
    border-color: var(--border-color);
}

body[data-color-mode="dark"] .file-chip {
    background: rgba(124,106,224,0.12);
    color: var(--text-primary);
}

body[data-color-mode="dark"] .file-chip-remove {
    color: var(--text-tertiary);
}

/* 对话页暗色 */
body[data-color-mode="dark"] .chat-header {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body[data-color-mode="dark"] .chat-messages {
    background: var(--bg-primary);
}

body[data-color-mode="dark"] .message.user .message-content {
    background: var(--brand-primary);
    color: #fff;
}

body[data-color-mode="dark"] .message.assistant .message-content {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body[data-color-mode="dark"] .message.assistant .message-meta {
    color: var(--text-tertiary);
}

/* 写作页暗色 */
body[data-color-mode="dark"] .writing-panel {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body[data-color-mode="dark"] .writing-editor {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body[data-color-mode="dark"] .writing-panel-header {
    border-color: var(--border-color);
}

body[data-color-mode="dark"] .writing-step {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

body[data-color-mode="dark"] .writing-step.active {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    background: rgba(124,106,224,0.1);
}

/* 知识库暗色 */
body[data-color-mode="dark"] .knowledge-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* Agent列表暗色 */
body[data-color-mode="dark"] .agent-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

body[data-color-mode="dark"] .agent-card:hover {
    border-color: rgba(124,106,224,0.4);
}

/* 文件管理暗色 */
body[data-color-mode="dark"] .file-item {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* 群组暗色 */
body[data-color-mode="dark"] .group-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* 历史记录暗色 */
body[data-color-mode="dark"] .history-item {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body[data-color-mode="dark"] .history-item:hover {
    border-color: rgba(124,106,224,0.3);
}

/* 下载页暗色 */
body[data-color-mode="dark"] .download-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* 登录弹窗暗色 */
body[data-color-mode="dark"] .login-modal-content {
    background: var(--bg-card);
    color: var(--text-primary);
}

body[data-color-mode="dark"] .login-modal-content input {
    background: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* 侧边栏折叠态下主题切换 */
.sidebar.collapsed .theme-toggle {
    padding: 6px;
    justify-content: center;
}

.sidebar.collapsed .theme-label,
.sidebar.collapsed .theme-toggle-track {
    display: none;
}

.sidebar.collapsed .theme-icon {
    display: block !important;
}

.sidebar.collapsed .theme-toggle[data-theme="light"] .theme-icon-dark,
.sidebar.collapsed .theme-toggle[data-theme="dark"] .theme-icon-system,
.sidebar.collapsed .theme-toggle[data-theme="system"] .theme-icon-light {
    display: block !important;
}

.sidebar.collapsed .theme-toggle[data-theme="light"] .theme-icon-light,
.sidebar.collapsed .theme-toggle[data-theme="dark"] .theme-icon-dark,
.sidebar.collapsed .theme-toggle[data-theme="system"] .theme-icon-system {
    display: none !important;
}

/* ==================== V3.1.7 新增样式 ==================== */

/* V3.1.7: 右上角"立即登录"按钮 */
.login-btn-top {
    padding: 7px 18px;
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}
.login-btn-top:hover {
    background: linear-gradient(135deg, #5a4bd1, #6C5CE7);
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.4);
    transform: translateY(-1px);
}
.login-btn-top:active {
    transform: translateY(0);
}

/* V3.1.7: 侧边栏"新建对话"按钮 */
.new-chat-nav-item {
    margin-bottom: 6px;
}
.new-chat-nav-item .nav-item-content {
    background: rgba(108, 92, 231, 0.12);
    color: var(--brand-primary-light);
    border-radius: 8px;
    font-weight: 500;
}
.new-chat-nav-item .nav-item-content:hover {
    background: rgba(108, 92, 231, 0.22);
}
.new-chat-nav-item .nav-icon {
    opacity: 0.9;
}

/* V3.1.7: 注册tab内容样式 */
.register-content {
    flex: 1;
    flex-direction: column;
}
.register-content.active {
    display: flex;
}
.register-tip {
    text-align: center;
    color: var(--brand-primary);
    font-size: 13px;
    margin-bottom: 20px;
    padding: 8px 12px;
    background: var(--brand-primary-bg);
    border-radius: 8px;
}

/* V3.1.7: 对话头像可点击样式 */
.message-avatar {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.message-avatar:hover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}
.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* V3.1.7: 默认AI头像SVG样式 */
.message-avatar.ai-avatar {
    background: linear-gradient(135deg, #6C5CE7, #a29bfe);
}
.message-avatar.ai-avatar svg {
    width: 20px;
    height: 20px;
}

/* V3.1.7: 默认用户头像SVG样式 */
.message-avatar.user-default-avatar {
    background: #ccc;
}

/* V3.1.7: 侧边栏折叠态隐藏新建对话文字 */
.sidebar.collapsed .new-chat-nav-item .nav-item-content span {
    display: none;
}
.sidebar.collapsed .new-chat-nav-item .nav-item-content {
    justify-content: center;
    padding: 10px 0;
}
