/* ============================================================
   Sozeer AI Platform - 全局样式
   风格: 简洁现代 (Vercel/Linear inspired)
   ============================================================ */

/* 基础 */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

/* 暗色模式 */
.dark body, .dark { background: #0a0a0f; color: #e5e5e5; }
.dark .card { background: #141420; border-color: #2a2a3a; }
.dark .input-field { background: #1a1a2a; border-color: #2a2a3a; color: #e5e5e5; }
.dark .input-field:focus { border-color: #6366f1; }

/* 卡片 */
.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.dark .card {
    background: #141420;
    border-color: #2a2a3a;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dark .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 按钮 */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: #4f46e5;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid #4f46e5;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.dark .btn-outline {
    color: #818cf8;
    border-color: #818cf8;
}

.btn-outline:hover {
    background: rgba(79, 70, 229, 0.05);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: #374151;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.875rem;
}

.dark .btn-ghost { color: #d1d5db; }

.btn-ghost:hover {
    background: #f3f4f6;
}

.dark .btn-ghost:hover { background: #1f2937; }

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ef4444;
    color: white;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

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

/* 输入框 */
.input-field {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
    outline: none;
}

.input-field:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-field::placeholder {
    color: #9ca3af;
}

/* 导航链接 */
.nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    transition: all 0.15s;
}

.dark .nav-link { color: #9ca3af; }

.nav-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.dark .nav-link:hover {
    background: #1f2937;
    color: #f3f4f6;
}

.nav-link.active {
    background: #eef2ff;
    color: #4f46e5;
}

.dark .nav-link.active {
    background: rgba(79, 70, 229, 0.15);
    color: #818cf8;
}

/* 聊天界面专用 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.chat-input-area {
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    background: white;
}

.dark .chat-input-area {
    border-color: #2a2a3a;
    background: #141420;
}

.chat-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.chat-bubble.user {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.dark .chat-bubble.assistant {
    background: #1f2937;
    color: #e5e5e5;
}

/* 进度条 */
.progress-bar {
    height: 8px;
    border-radius: 4px;
    background: #e5e7eb;
    overflow: hidden;
}

.dark .progress-bar { background: #2a2a3a; }

.progress-bar .progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    transition: width 0.5s ease;
}

/* 标签 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-yellow { background: #fef3c7; color: #92400e; }
.tag-red { background: #fee2e2; color: #991b1b; }
.tag-purple { background: #ede9fe; color: #6d28d9; }

.dark .tag-blue { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.dark .tag-green { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.dark .tag-yellow { background: rgba(234, 179, 8, 0.15); color: #fde047; }
.dark .tag-red { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.dark .tag-purple { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; }

/* 上传区域 */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover, .upload-zone.drag-over {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.03);
}

.dark .upload-zone { border-color: #3a3a4a; }
.dark .upload-zone:hover, .dark .upload-zone.drag-over {
    border-color: #818cf8;
    background: rgba(129, 140, 248, 0.05);
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.typing-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    animation: pulse-dot 1.2s infinite;
}

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

/* Toast 提示 */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    animation: fadeIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.toast-success { background: #dcfce7; color: #15803d; }
.toast-error { background: #fee2e2; color: #991b1b; }
.toast-info { background: #dbeafe; color: #1d4ed8; }

/* 响应式 */
@media (max-width: 640px) {
    .chat-bubble { max-width: 90%; }
}
