/* 南京工业大学智能助手 - 专业版样式 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主题颜色 */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #06b6d4;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* 背景颜色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    
    /* 文字颜色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #ffffff;
    
    /* 边框和阴影 */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* 边框圆角 */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
    --gradient-secondary: linear-gradient(135deg, var(--accent), var(--primary));
    --gradient-njtech: linear-gradient(135deg, #1e40af, #0ea5e9);
    
    /* 过渡动画 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 主容器 */
.main-container {
    display: flex;
    height: 100vh;
    position: relative;
}

/* 左侧面板 */
.left-panel {
    width: 320px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

/* 个人资料区域 */
.profile-section {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.avatar {
    position: relative;
    width: 80px;
    height: 80px;
}

.avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gradient-njtech);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.avatar-inner:hover {
    transform: scale(1.05);
}

.school-logo {
    font-size: 2rem;
    color: white;
    z-index: 2;
}

.avatar-border {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: var(--gradient-primary);
    animation: rotate 8s linear infinite;
    opacity: 0.7;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    background: var(--success);
    border: 3px solid var(--bg-card);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.assistant-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.assistant-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-item i {
    color: var(--primary);
    width: 16px;
}

/* 信息卡片 */
.info-cards {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.info-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.card-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
    font-size: 1.1rem;
}

.info-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.info-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 快速操作 */
.quick-actions {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.action-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.action-btn:last-child {
    margin-bottom: 0;
}

/* 右侧面板 */
.right-panel {
    flex: 1;
    margin-left: 320px;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 聊天容器 */
.chat-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
}

/* 聊天头部 */
.chat-header {
    display: flex;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--gradient-njtech);
    color: white;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.ai-avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
}

.ai-info {
    flex: 1;
}

.ai-info h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.ai-status {
    font-size: 0.9rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.mode-indicator {
    display: flex;
    gap: 0.5rem;
}

.mode-badge {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.mode-badge.active {
    background: rgba(255, 255, 255, 0.3);
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: var(--bg-secondary);
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 85%;
    animation: slideInMessage 0.5s ease-out;
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.ai-message .message-avatar {
    background: var(--gradient-njtech);
    color: white;
}

.user-message .message-avatar {
    background: var(--gradient-secondary);
    color: white;
}

.message-content {
    background: var(--bg-card);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-xl);
    position: relative;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.user-message .message-content {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.message-content p {
    margin: 0 0 0.75rem 0;
    line-height: 1.6;
}

.message-content p:last-of-type {
    margin-bottom: 0;
}

.message-content ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    display: block;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.welcome-message {
    max-width: 100%;
}

.welcome-message .message-content {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
    color: #92400e;
}

/* 输入区域 */
.chat-input-container {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.quick-questions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.quick-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.quick-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.quick-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

#chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-card);
}

.send-btn {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.1rem;
    box-shadow: var(--shadow-md);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.send-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* 打字指示器 */
.typing-indicator {
    opacity: 0.7;
}

.typing-indicator .message-content {
    background: var(--bg-hover);
    border-color: var(--border);
}

.typing-dots {
    display: inline-flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    z-index: 200;
    box-shadow: var(--shadow-lg);
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: var(--transition);
}

/* 动画效果 */
@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .left-panel {
        width: 280px;
    }
    
    .right-panel {
        margin-left: 280px;
    }
}

@media (max-width: 768px) {
    .left-panel {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .left-panel.active {
        transform: translateX(0);
    }
    
    .right-panel {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .chat-header {
        padding: 1rem 1.5rem;
    }
    
    .chat-messages {
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .chat-input-container {
        padding: 1rem 1.5rem;
    }
    
    .quick-questions {
        margin-bottom: 1rem;
    }
    
    .quick-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .message {
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: 1rem;
    }
    
    .chat-messages {
        padding: 1rem;
    }
    
    .chat-input-container {
        padding: 1rem;
    }
    
    .assistant-name {
        font-size: 1.25rem;
    }
    
    .quick-questions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quick-label {
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .quick-btn {
        justify-content: center;
    }
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar,
.info-cards::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.info-cards::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
.info-cards::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.info-cards::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
} 