/* ======== 全局美化 ======== */
* { -webkit-font-smoothing: antialiased; }

html, body { height: 100%; }
body {
    background:
      radial-gradient(1200px 600px at -10% -20%, rgba(99,102,241,.08), transparent 60%),
      radial-gradient(900px 500px at 110% 10%, rgba(6,182,212,.07), transparent 60%),
      #f8fafc;
    min-height: 100vh;
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 渐变按钮 */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #06b6d4 100%);
    color: white; font-weight: 500; letter-spacing: .2px;
    padding: 8px 16px; border-radius: 10px;
    box-shadow: 0 6px 20px -6px rgba(99,102,241,.55);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 10px 28px -8px rgba(99,102,241,.6); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
    background: white; color: #334155; border: 1px solid #e2e8f0;
    padding: 7px 14px; border-radius: 10px; font-weight: 500;
    transition: all .15s ease; display: inline-flex; align-items: center; gap: 6px;
}
.btn-ghost:hover { border-color: #a5b4fc; color: #4f46e5; background:#eef2ff; }

.btn-danger-ghost {
    background: white; color: #b91c1c; border: 1px solid #fecaca;
    padding: 7px 14px; border-radius: 10px; font-weight: 500;
    transition: all .15s ease; display: inline-flex; align-items: center; gap: 6px;
}
.btn-danger-ghost:hover { background:#fef2f2; }

/* 卡片 */
.card {
    background: white; border: 1px solid rgba(226,232,240,.8);
    border-radius: 16px; box-shadow: 0 2px 8px -2px rgba(15,23,42,.06), 0 4px 16px -4px rgba(15,23,42,.05);
}

/* 渐变文字 */
.text-gradient {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}

/* 侧边栏项 */
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 10px; color: #cbd5e1;
    font-size: 14px; cursor: pointer; transition: all .15s ease;
    position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active {
    background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(6,182,212,.18));
    color: white;
}
.nav-item.active::before {
    content:''; position:absolute; left:-14px; top:8px; bottom:8px; width:3px;
    background: linear-gradient(180deg,#818cf8,#22d3ee); border-radius: 3px;
}

/* 标签（状态） */
.tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 500;
    padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.tag-blue   { background: #e0f2fe; color:#0369a1; }
.tag-violet { background: #ede9fe; color:#6d28d9; }
.tag-amber  { background: #fef3c7; color:#b45309; }
.tag-green  { background: #dcfce7; color:#166534; }
.tag-rose   { background: #ffe4e6; color:#be123c; }
.tag-gray   { background: #f1f5f9; color:#475569; }
.tag-cyan   { background: #cffafe; color:#0e7490; }

/* 输入框 */
.input {
    background: white; border:1px solid #e2e8f0; border-radius: 10px;
    padding: 8px 12px; font-size:14px; width: 100%;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
textarea.input { line-height: 1.6; min-height: 80px; }

/* Markdown 预览样式 */
.md-body { color:#1e293b; line-height: 1.75; font-size: 14.5px; }
.md-body h1 { font-size: 22px; font-weight: 700; margin: 16px 0 12px; padding-bottom:6px; border-bottom: 2px solid #e2e8f0; }
.md-body h2 { font-size: 18px; font-weight: 600; margin: 14px 0 8px; color:#4338ca; }
.md-body h3 { font-size: 15.5px; font-weight: 600; margin: 10px 0 6px; color:#334155; }
.md-body p { margin: 6px 0; }
.md-body ul, .md-body ol { margin: 6px 0 6px 22px; }
.md-body ul { list-style: disc; } .md-body ol { list-style: decimal; }
.md-body li { margin: 2px 0; }
.md-body table { border-collapse: collapse; margin: 10px 0; width:100%; font-size:13.5px; }
.md-body th, .md-body td { border:1px solid #e2e8f0; padding:6px 10px; }
.md-body th { background:#f8fafc; font-weight:600; }
.md-body code { background:#f1f5f9; padding:2px 5px; border-radius:4px; font-size:13px; color:#be123c; }
.md-body pre { background:#0f172a; color:#e2e8f0; padding:12px 14px; border-radius:10px; overflow-x:auto; font-size:13px; }
.md-body blockquote { border-left:4px solid #a5b4fc; padding:4px 12px; color:#475569; background:#f8fafc; margin:8px 0; }

/* 悬浮聊天球 */
.chat-fab {
    position: fixed; right: 28px; bottom: 28px; z-index: 60;
    width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #06b6d4 100%);
    color: white; display:flex; align-items:center; justify-content:center;
    box-shadow: 0 10px 30px -8px rgba(99,102,241,.6); cursor: pointer;
    transition: transform .2s ease;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab .ring {
    position:absolute; inset:0; border-radius:50%;
    background: rgba(99,102,241,.45);
}

/* 抽屉 & 遮罩 */
.overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.45);
    backdrop-filter: blur(4px); z-index: 70; animation: fadeIn .2s ease-out;
}
.drawer-right {
    position: fixed; top:0; right:0; bottom:0;
    background: #f8fafc; z-index: 80; box-shadow: -20px 0 40px -10px rgba(15,23,42,.25);
    animation: slideInRight .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideInRight { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 网格背景小图标 */
.bg-dots {
    background-image: radial-gradient(rgba(148,163,184,.22) 1px, transparent 1px);
    background-size: 14px 14px;
}

/* Hover 抬升 */
.hover-lift { transition: transform .18s ease, box-shadow .18s ease; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -10px rgba(15,23,42,.18); }

/* 进度环 */
.progress-ring { transform: rotate(-90deg); }

/* 登录背景 */
.login-hero {
    background:
      radial-gradient(600px 400px at 20% 30%, rgba(99,102,241,.35), transparent 60%),
      radial-gradient(500px 400px at 80% 70%, rgba(6,182,212,.35), transparent 60%),
      linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
}

/* 打印隐藏 */
@media print {
    .no-print { display: none !important; }
}

/* ======== AI 流式组价动画 ======== */
@keyframes indeterminate {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(150%); }
    100% { transform: translateX(350%); }
}
.animate-indeterminate {
    animation: indeterminate 1.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
