*{box-sizing:border-box;margin:0;padding:0}
body{font-family:system-ui,-apple-system,"Microsoft YaHei",sans-serif;background:#f5f7fa;color:#1e293b;font-size:14px}
a{cursor:pointer;text-decoration:none}

/* 登录 */
.login-wrap{display:flex;align-items:center;justify-content:center;height:100vh;background:linear-gradient(135deg,#1e293b,#0f172a)}
.login-box{background:#fff;padding:40px;border-radius:14px;width:380px;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.login-box h1{font-size:22px;margin-bottom:24px;text-align:center}
.login-box input{width:100%;padding:13px;margin-bottom:14px;border:1px solid #e2e8f0;border-radius:8px;font-size:15px}
.login-box button{width:100%;padding:13px;background:#2563eb;color:#fff;border:none;border-radius:8px;font-size:16px;cursor:pointer;font-weight:600}
.err{color:#dc2626;margin-top:12px;text-align:center;font-size:14px}

/* 顶栏 */
.topbar{display:flex;align-items:center;background:#fff;padding:0 24px;height:60px;box-shadow:0 1px 6px rgba(0,0,0,.06);position:sticky;top:0;z-index:100}
.brand{font-weight:700;font-size:17px;margin-right:40px}
.tabs{display:flex;gap:6px;flex:1}
.tabs a{padding:8px 18px;border-radius:8px;color:#64748b;font-size:14px;font-weight:500}
.tabs a.active,.tabs a:hover{background:#eff6ff;color:#2563eb}
.user{font-size:14px;color:#64748b}
.user a{margin-left:12px;color:#2563eb}

main{padding:24px;max-width:1700px;margin:0 auto}

/* 卡片 */
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:20px}
.card{background:#fff;padding:22px;border-radius:12px;box-shadow:0 1px 4px rgba(0,0,0,.05)}
.card .num{font-size:26px;font-weight:700;color:#2563eb}
.card .label{color:#94a3b8;font-size:13px;margin-top:6px}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media(max-width:900px){.two-col{grid-template-columns:1fr}}
.panel{background:#fff;padding:20px;border-radius:12px;box-shadow:0 1px 4px rgba(0,0,0,.05);margin-bottom:20px}
.panel h3{font-size:15px;margin-bottom:14px;color:#334155}
.bars{display:flex;flex-direction:column;gap:10px}
.bar-row{display:flex;align-items:center;gap:12px;font-size:13px}
.bar-label{width:110px;color:#475569}
.bar-fill{height:22px;background:linear-gradient(90deg,#3b82f6,#2563eb);border-radius:6px;min-width:6px;transition:width .3s}

/* 工具栏 */
.toolbar{display:flex;gap:8px;margin-bottom:16px;flex-wrap:wrap;align-items:center}
.toolbar input,.toolbar select{padding:9px 13px;border:1px solid #e2e8f0;border-radius:8px;font-size:14px;background:#fff;color:#1e293b}
.toolbar button{padding:9px 18px;background:#2563eb;color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:14px;font-weight:500;transition:background .2s}
.toolbar button:hover{background:#1d4ed8}
.toolbar button.ghost{background:#fff;color:#2563eb;border:1px solid #2563eb}
.toolbar button.ghost:hover{background:#eff6ff}
.select-mini{padding:9px 13px;border:1px solid #e2e8f0;border-radius:8px;background:#fff}

/* 表格 */
.table-wrap{background:#fff;border-radius:12px;overflow:auto;box-shadow:0 1px 4px rgba(0,0,0,.05);max-width:100%}
.grid{width:100%;border-collapse:collapse;min-width:1500px}
.grid th,.grid td{padding:12px 14px;text-align:left;border-bottom:1px solid #f1f5f9;font-size:13px;vertical-align:top}
.grid th{background:#f8fafc;font-weight:600;color:#475569;position:sticky;top:0;z-index:2;white-space:nowrap}
.grid tr:hover{background:#f8fafc}

.grid td.col-name{white-space:normal;word-break:break-word;line-height:1.5;max-width:280px;min-width:180px}
.grid td.col-partno{white-space:nowrap;font-weight:600}
.grid td.col-num{white-space:nowrap}

.col-actions{position:sticky;right:0;background:#f8fafc !important;box-shadow:-6px 0 10px rgba(0,0,0,.05);z-index:3;min-width:180px;width:180px;white-space:nowrap}
.grid td.actions{position:sticky;right:0;background:#fff;box-shadow:-6px 0 10px rgba(0,0,0,.05);z-index:2;min-width:180px;width:180px;white-space:nowrap}
.grid tr:hover td.actions{background:#f8fafc}

.thumb{width:48px;height:48px;object-fit:cover;border-radius:6px;cursor:pointer;border:1px solid #e2e8f0;display:block}
.thumb-empty{width:48px;height:48px;background:#f1f5f9;border-radius:6px;display:flex;align-items:center;justify-content:center;color:#94a3b8;font-size:11px}

/* 标签 */
.tag{display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;margin-right:4px;white-space:nowrap}
.tag-hot{background:#fef3c7;color:#b45309}
.tag-up{background:#dcfce7;color:#166534}
.tag-down{background:#fee2e2;color:#991b1b}
.tag-stable{background:#e0e7ff;color:#3730a3}

/* 状态徽章 */
.status-badge{display:inline-block;padding:3px 10px;border-radius:12px;font-size:12px;font-weight:500;white-space:nowrap}
.status-instock{background:#dcfce7;color:#166534}
.status-sold{background:#f1f5f9;color:#64748b}
.status-empty{background:#fee2e2;color:#991b1b}
.status-draft{background:#fef3c7;color:#b45309}

/* 渠道比价 */
.price-mini{display:flex;align-items:center;gap:6px;font-size:11.5px;line-height:1.9;margin:1px 0}
.price-mini .pm-plat{display:inline-block;min-width:40px;color:#64748b;font-weight:500}
.price-mini .pm-val{color:#2563eb;font-weight:600}
.price-mini.my-quote{margin-top:5px;padding-top:5px;border-top:1px dashed #e2e8f0}
.price-mini.my-quote .pm-plat{color:#7c3aed;font-weight:600}
.price-mini.my-quote .pm-val{color:#dc2626}
.price-mini .pm-time{color:#94a3b8;font-size:10px}
.jump-btn{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:5px;background:#f1f5f9;color:#2563eb !important;font-size:11px;font-weight:700;text-decoration:none !important;transition:all .15s;margin-left:2px;flex-shrink:0}
.jump-btn:hover{background:#2563eb;color:#fff !important;transform:scale(1.1)}
.jump-btn.empty{background:transparent;color:#cbd5e1 !important;cursor:not-allowed;pointer-events:none}

.actions a{color:#2563eb;margin-right:10px;font-size:12px;font-weight:500}
.actions a.del{color:#dc2626}
.actions a:hover{text-decoration:underline}

.pager{margin-top:16px;display:flex;gap:6px;justify-content:center;flex-wrap:wrap}
.pager a{padding:7px 13px;background:#fff;border:1px solid #e2e8f0;border-radius:6px;color:#334155;font-size:13px}
.pager a.active{background:#2563eb;color:#fff;border-color:#2563eb}
.pager a:hover{background:#eff6ff;color:#2563eb}

/* 弹窗 */
.modal{display:none;position:fixed;inset:0;background:rgba(15,23,42,.5);z-index:1000;align-items:center;justify-content:center;padding:20px}
.modal.open{display:flex}
.modal-box{background:#fff;border-radius:14px;max-width:600px;width:100%;max-height:92vh;display:flex;flex-direction:column;overflow:hidden}
.modal-box.wide{max-width:960px}
.modal-head{display:flex;justify-content:space-between;padding:18px 24px;border-bottom:1px solid #f1f5f9}
.modal-head h3{font-size:16px}
.modal-head a{color:#94a3b8;font-size:20px}
.modal-body{padding:24px;overflow-y:auto}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.form-grid label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#475569}
.form-grid input,.form-grid select,.form-grid textarea{padding:9px 12px;border:1px solid #e2e8f0;border-radius:8px;font-size:14px;font-family:inherit}
.form-grid .full{grid-column:1/-1}
.img-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:10px;margin-top:10px}
.img-item{position:relative;aspect-ratio:1;border-radius:8px;overflow:hidden;cursor:pointer;border:1px solid #e2e8f0}
.img-item img{width:100%;height:100%;object-fit:cover}
.img-item .del{position:absolute;top:4px;right:4px;background:rgba(220,38,38,.9);color:#fff;width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:14px;cursor:pointer}
.price-section{margin-top:20px;padding:16px;background:#f8fafc;border-radius:10px}
.plat-row{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid #e2e8f0;font-size:13px;gap:10px;flex-wrap:wrap}
.plat-row:last-child{border-bottom:none}
.plat-name{font-weight:600;color:#334155;min-width:70px}
.plat-price{font-weight:700;color:#2563eb}
.plat-link{font-size:12px;color:#2563eb;margin-left:6px}
.btn-row{display:flex;gap:10px;margin-top:20px;flex-wrap:wrap}
.btn-primary{padding:11px 24px;background:#2563eb;color:#fff;border:none;border-radius:8px;cursor:pointer;font-weight:500;font-size:14px}
.btn-ai{padding:11px 24px;background:linear-gradient(135deg,#8b5cf6,#6366f1);color:#fff;border:none;border-radius:8px;cursor:pointer;font-weight:500;font-size:14px}
.btn-sell{padding:11px 24px;background:#16a34a;color:#fff;border:none;border-radius:8px;cursor:pointer;font-weight:500;font-size:14px}

/* 进度条 */
.progress-wrap{margin-top:16px}
.progress-bar{height:26px;background:#e2e8f0;border-radius:14px;overflow:hidden;position:relative}
.progress-fill{height:100%;background:linear-gradient(90deg,#3b82f6,#2563eb);width:0;transition:width .3s;display:flex;align-items:center;justify-content:flex-end;padding-right:10px;color:#fff;font-size:12px;font-weight:600}
.progress-text{margin-top:8px;font-size:13px;color:#475569}

/* 图片查看器 */
.lightbox{display:none;position:fixed;inset:0;background:rgba(0,0,0,.92);z-index:2000;align-items:center;justify-content:center}
.lightbox.open{display:flex}
.lightbox img{max-width:85vw;max-height:85vh;border-radius:8px}
.lb-prev,.lb-next{position:absolute;top:50%;transform:translateY(-50%);font-size:60px;color:#fff;user-select:none;padding:20px;opacity:.7}
.lb-prev{left:20px} .lb-next{right:20px}
.lb-prev:hover,.lb-next:hover{opacity:1}
.lb-close{position:absolute;top:20px;right:30px;font-size:32px;color:#fff;cursor:pointer}
.lb-info{position:absolute;bottom:30px;color:#fff;font-size:14px}

/* 热门布局 */
.hot-layout{display:grid;grid-template-columns:1.4fr 1fr;gap:16px;align-items:start}
@media(max-width:1100px){.hot-layout{grid-template-columns:1fr}}
.hint{color:#94a3b8;font-size:13px;margin-bottom:12px;line-height:1.6}
.status-line{font-size:13px;color:#64748b;min-height:20px;margin-top:8px;line-height:1.6}
.count-label{color:#64748b;font-weight:400;font-size:13px}

.hot-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}
.hot-card{background:#fff;border:1px solid #e2e8f0;border-radius:12px;overflow:hidden;display:flex;flex-direction:column;transition:all .2s}
.hot-card:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.08);border-color:#bfdbfe}
.hot-card .imgbox{width:100%;aspect-ratio:1;background:#f1f5f9;display:flex;align-items:center;justify-content:center;color:#94a3b8;font-size:12px;overflow:hidden}
.hot-card .imgbox img{width:100%;height:100%;object-fit:cover;transition:transform .3s}
.hot-card:hover .imgbox img{transform:scale(1.05)}
.hot-card .info{padding:12px;flex:1;display:flex;flex-direction:column;gap:6px}
.hot-card .title{font-size:13px;font-weight:500;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:36px}
.hot-card .price{color:#dc2626;font-weight:700;font-size:15px}
.hot-card .actions{margin-top:auto;display:flex;gap:6px}
.hot-card button{flex:1;padding:8px;border:none;border-radius:6px;cursor:pointer;font-size:12px;background:#2563eb;color:#fff;transition:background .2s}
.hot-card button:hover{background:#1d4ed8}
.hot-card button.sell{background:#16a34a}
.hot-card button.sell:hover{background:#15803d}
.hot-card a.src-link{flex:1;text-align:center;padding:8px;background:#f1f5f9;border-radius:6px;color:#334155;font-size:12px;text-decoration:none;transition:all .2s}
.hot-card a.src-link:hover{background:#e2e8f0}

/* 排行榜 */
.rank-list{display:flex;flex-direction:column;gap:8px}
.rank-item{display:flex;align-items:center;gap:12px;padding:12px;background:#fff;border:1px solid #e2e8f0;border-radius:10px;transition:all .2s}
.rank-item:hover{box-shadow:0 4px 12px rgba(0,0,0,.06);border-color:#bfdbfe;background:#f8fafc}
.rank-no{width:40px;height:40px;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:700;background:#f1f5f9;border-radius:50%;color:#64748b}
.rank-item:nth-child(1) .rank-no{background:linear-gradient(135deg,#fef3c7,#fde68a);color:#b45309}
.rank-item:nth-child(2) .rank-no{background:linear-gradient(135deg,#e5e7eb,#d1d5db);color:#374151}
.rank-item:nth-child(3) .rank-no{background:linear-gradient(135deg,#fed7aa,#fdba74);color:#c2410c}
.rank-thumb{width:48px;height:48px;flex-shrink:0;border-radius:8px;overflow:hidden;background:#f1f5f9;display:flex;align-items:center;justify-content:center;color:#94a3b8;font-size:10px}
.rank-thumb img{width:100%;height:100%;object-fit:cover}
.rank-main{flex:1;min-width:0}
.rank-title{font-size:14px;font-weight:500;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rank-meta{font-size:12px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rank-score{text-align:center;flex-shrink:0;min-width:56px}
.rank-score .score-num{font-size:22px;font-weight:700}
.rank-score .score-label{font-size:10px;color:#94a3b8}

/* 关键词比价 AI 分析 */
.ai-analysis-box{margin:14px 0;padding:16px 20px;background:linear-gradient(135deg,#f0f9ff,#e0f2fe);border:1px solid #bae6fd;border-radius:12px}
.ai-analysis-box h4{font-size:14px;color:#0369a1;margin-bottom:12px}
.price-compare{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:12px}
@media(max-width:700px){.price-compare{grid-template-columns:1fr}}
.price-compare-item{background:#fff;padding:12px;border-radius:8px;text-align:center;border:1px solid #e0f2fe}
.pc-platform{font-size:13px;font-weight:600;color:#0c4a6e;margin-bottom:6px}
.pc-price{font-size:14px;color:#0369a1;font-weight:500}
.pc-avg{font-size:12px;color:#64748b;margin-top:4px}
.pc-avg b{color:#dc2626;font-size:15px}
.pc-comment{font-size:11px;color:#94a3b8;margin-top:6px;line-height:1.4}
.ai-analysis-text{background:#fff;padding:12px;border-radius:8px;font-size:13px;color:#334155;line-height:1.7;border-left:3px solid #8b5cf6}

/* AI 助手 */
.ai-layout{display:grid;grid-template-columns:260px 1fr;gap:16px;align-items:start}
@media(max-width:900px){.ai-layout{grid-template-columns:1fr}}
.ai-sidebar{background:#fff;border-radius:12px;padding:16px;box-shadow:0 1px 4px rgba(0,0,0,.05);max-height:calc(100vh - 160px);overflow-y:auto}
.ai-sidebar-head{font-size:13px;font-weight:600;color:#334155;margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid #f1f5f9}
.kb-list{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.kb-item{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:10px;transition:all .2s}
.kb-item:hover{border-color:#bfdbfe;background:#f0f9ff}
.kb-item-title{font-size:13px;font-weight:600;color:#334155;margin-bottom:4px;display:flex;justify-content:space-between;align-items:center;gap:6px}
.kb-item-actions{display:flex;gap:4px;flex-shrink:0}
.kb-item-actions a{font-size:11px;padding:2px 6px;border-radius:4px;background:#e2e8f0;color:#475569;transition:all .15s}
.kb-item-actions a:hover{background:#2563eb;color:#fff}
.kb-item-actions a.danger:hover{background:#dc2626}
.kb-item-content{font-size:12px;color:#64748b;line-height:1.5;cursor:pointer;max-height:60px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}
.kb-add,.kb-clear{width:100%;padding:9px;border:none;border-radius:8px;font-size:13px;cursor:pointer;margin-bottom:8px}
.kb-add{background:#2563eb;color:#fff}
.kb-add:hover{background:#1d4ed8}
.kb-clear{background:#f1f5f9;color:#64748b}
.kb-clear:hover{background:#e2e8f0}

.ai-main{display:flex;flex-direction:column;gap:14px}
.ai-toolbar{background:#fff;padding:12px;border-radius:10px;box-shadow:0 1px 4px rgba(0,0,0,.05);margin-bottom:0}
.chat{height:calc(100vh - 400px);min-height:400px;overflow-y:auto;background:#fff;border-radius:14px;padding:24px;box-shadow:0 1px 4px rgba(0,0,0,.05);scroll-behavior:smooth}
.msg-row{display:flex;margin-bottom:20px;gap:12px;align-items:flex-start}
.msg-row.user{flex-direction:row-reverse}
.msg-avatar{width:38px;height:38px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:18px;box-shadow:0 2px 6px rgba(0,0,0,.1)}
.msg-row.user .msg-avatar{background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff}
.msg-row.ai .msg-avatar{background:linear-gradient(135deg,#8b5cf6,#6366f1);color:#fff}
.msg-bubble{max-width:78%;padding:13px 17px;border-radius:16px;line-height:1.7;font-size:14px;word-wrap:break-word;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.msg-row.user .msg-bubble{background:#2563eb;color:#fff;border-top-right-radius:4px}
.msg-row.ai .msg-bubble{background:#f8fafc;color:#1e293b;border-top-left-radius:4px;border:1px solid #e2e8f0}
.msg-bubble p{margin:6px 0}
.msg-bubble pre{background:#0f172a;color:#e2e8f0;padding:12px;border-radius:8px;overflow-x:auto;margin:10px 0;font-size:13px;line-height:1.5}
.msg-bubble code{background:rgba(99,102,241,.12);color:#4f46e5;padding:2px 6px;border-radius:4px;font-family:ui-monospace,Consolas,monospace;font-size:13px}
.msg-bubble pre code{background:none;color:inherit;padding:0}
.msg-bubble h2,.msg-bubble h3,.msg-bubble h4,.msg-bubble h5{margin:12px 0 6px;font-size:15px;color:#1e293b;font-weight:600}
.msg-bubble h2{font-size:17px}
.msg-bubble ul,.msg-bubble ol{margin:8px 0;padding-left:22px}
.msg-bubble li{margin:5px 0}
.msg-bubble strong{font-weight:600;color:#1e293b}
.msg-row.user .msg-bubble strong{color:#fff}
.typing{display:inline-flex;gap:5px;padding:4px 0}
.typing span{width:7px;height:7px;border-radius:50%;background:#94a3b8;animation:typing 1.4s infinite}
.typing span:nth-child(2){animation-delay:.2s}
.typing span:nth-child(3){animation-delay:.4s}
@keyframes typing{0%,60%,100%{transform:translateY(0);opacity:.4}30%{transform:translateY(-6px);opacity:1}}
.quick-asks{display:flex;gap:8px;flex-wrap:wrap}
.quick-asks button{padding:8px 14px;background:#f1f5f9;color:#334155;border:1px solid #e2e8f0;border-radius:20px;cursor:pointer;font-size:13px;transition:all .2s}
.quick-asks button:hover{background:#eff6ff;color:#2563eb;border-color:#bfdbfe}

/* 通用弹窗 */
.ui-modal{display:none;position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:3000;align-items:center;justify-content:center;padding:20px}
.ui-modal.open{display:flex}
.ui-modal-box{background:#fff;border-radius:14px;max-width:480px;width:100%;max-height:92vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 24px 60px rgba(0,0,0,.25);animation:uiPop .25s ease}
@keyframes uiPop{from{transform:scale(.92);opacity:0}to{transform:scale(1);opacity:1}}
.ui-modal-head{display:flex;justify-content:space-between;align-items:center;padding:16px 22px;border-bottom:1px solid #f1f5f9}
.ui-modal-head h3{font-size:15px;font-weight:600;color:#1e293b}
.ui-modal-head a{color:#94a3b8;font-size:20px;line-height:1}
.ui-modal-head a:hover{color:#475569}
.ui-modal-body{padding:22px;overflow-y:auto;font-size:14px;color:#334155;line-height:1.7}
.ui-modal-body input[type=text],.ui-modal-body input[type=number],.ui-modal-body textarea{width:100%;padding:10px 12px;border:1px solid #e2e8f0;border-radius:8px;font-size:14px;font-family:inherit;margin-top:8px}
.ui-modal-body input:focus,.ui-modal-body textarea:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.1)}
.ui-modal-foot{padding:14px 22px;display:flex;justify-content:flex-end;gap:10px;border-top:1px solid #f1f5f9;background:#f8fafc}
.ui-modal-foot button{padding:10px 22px;border-radius:8px;border:none;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s}
.ui-modal-foot button.ui-cancel{background:#fff;color:#475569;border:1px solid #e2e8f0}
.ui-modal-foot button.ui-cancel:hover{background:#f8fafc}
.ui-modal-foot button.ui-ok{background:#2563eb;color:#fff}
.ui-modal-foot button.ui-ok:hover{background:#1d4ed8}
.ui-modal-foot button.ui-danger{background:#dc2626;color:#fff}
.ui-modal-foot button.ui-danger:hover{background:#b91c1c}

.ui-modal-icon{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:50%;font-size:22px;margin-right:14px;flex-shrink:0;vertical-align:middle}
.ui-modal-icon.warn{background:#fef3c7;color:#d97706}
.ui-modal-icon.info{background:#dbeafe;color:#2563eb}
.ui-modal-icon.success{background:#dcfce7;color:#16a34a}
.ui-modal-icon.error{background:#fee2e2;color:#dc2626}

.ui-modal-fields{display:flex;flex-direction:column;gap:14px}
.ui-modal-fields label{display:flex;flex-direction:column;gap:6px;font-size:13px;color:#475569;font-weight:500}
.ui-modal-fields input,.ui-modal-fields textarea{padding:10px 12px;border:1px solid #e2e8f0;border-radius:8px;font-size:14px;font-family:inherit;transition:all .15s}
.ui-modal-fields input:focus,.ui-modal-fields textarea:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.1)}
.ui-modal-fields textarea{resize:vertical;min-height:100px;line-height:1.6}

/* Toast */
.toast{position:fixed;top:80px;left:50%;transform:translateX(-50%) translateY(-30px);background:#1e293b;color:#fff;padding:12px 22px;border-radius:10px;font-size:14px;z-index:4000;opacity:0;transition:all .3s;pointer-events:none;box-shadow:0 8px 24px rgba(0,0,0,.2);max-width:90vw}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.success{background:#16a34a}
.toast.error{background:#dc2626}
.toast.warn{background:#d97706}
.toast.info{background:#2563eb}

/* AI 比价 Loading */
.ai-loading{position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:5000;display:flex;align-items:center;justify-content:center;animation:fadeIn .2s}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.ai-loading-box{background:#fff;padding:32px 44px;border-radius:16px;box-shadow:0 24px 60px rgba(0,0,0,.3);text-align:center;min-width:320px;animation:uiPop .25s}
.ai-loading-spinner{width:48px;height:48px;border:4px solid #e0e7ff;border-top-color:#6366f1;border-radius:50%;margin:0 auto 18px;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.ai-loading-title{font-size:16px;font-weight:600;color:#1e293b;margin-bottom:8px}
.ai-loading-sub{font-size:13px;color:#94a3b8;line-height:1.6}
.ai-loading-progress{margin-top:16px;height:6px;background:#e2e8f0;border-radius:3px;overflow:hidden}
.ai-loading-bar{height:100%;background:linear-gradient(90deg,#8b5cf6,#6366f1);width:0;animation:aiProgress 6s ease-out forwards}
@keyframes aiProgress{0%{width:0}50%{width:70%}100%{width:95%}}
/* ========== AI 比价 Loading 增强版 ========== */
.ai-loading{position:fixed;inset:0;background:rgba(15,23,42,.6);z-index:5000;display:flex;align-items:center;justify-content:center;animation:fadeIn .25s}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.ai-loading-box{background:#fff;padding:32px 40px;border-radius:16px;box-shadow:0 24px 60px rgba(0,0,0,.35);min-width:380px;max-width:520px;animation:uiPop .25s}
.ai-loading-spinner{width:52px;height:52px;border:4px solid #e0e7ff;border-top-color:#6366f1;border-radius:50%;margin:0 auto 18px;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.ai-loading-title{font-size:16px;font-weight:600;color:#1e293b;margin-bottom:6px;text-align:center}
.ai-loading-sub{font-size:13px;color:#94a3b8;line-height:1.6;text-align:center;margin-bottom:18px}
.ai-loading-steps{display:flex;flex-direction:column;gap:8px;margin-bottom:18px}
.ai-step{display:flex;align-items:center;gap:10px;font-size:13px;color:#64748b;padding:6px 10px;border-radius:6px;transition:all .3s}
.ai-step .dot{width:10px;height:10px;border-radius:50%;background:#cbd5e1;flex-shrink:0;transition:all .3s}
.ai-step.active{background:#eff6ff;color:#2563eb;font-weight:500}
.ai-step.active .dot{background:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.15)}
.ai-step.done{color:#16a34a}
.ai-step.done .dot{background:#16a34a}
.ai-loading-progress{height:6px;background:#e2e8f0;border-radius:3px;overflow:hidden;margin-bottom:12px}
.ai-loading-bar{height:100%;background:linear-gradient(90deg,#8b5cf6,#6366f1);width:0;animation:aiProgress 9s ease-out forwards;border-radius:3px}
@keyframes aiProgress{0%{width:5%}20%{width:25%}40%{width:50%}60%{width:70%}80%{width:85%}100%{width:95%}}
.ai-loading-tip{text-align:center;font-size:12px;color:#94a3b8}

/* ========== 知识库美化 ========== */
.kb-item{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:10px;transition:all .2s}
.kb-item:hover{border-color:#bfdbfe;background:#f0f9ff}
.kb-item-title{font-size:13px;font-weight:600;color:#334155;margin-bottom:4px;display:flex;justify-content:space-between;align-items:center;gap:6px}
.kb-item-actions{display:flex;gap:4px;flex-shrink:0}
.kb-item-actions a{font-size:11px;padding:2px 6px;border-radius:4px;background:#e2e8f0;color:#475569;transition:all .15s}
.kb-item-actions a:hover{background:#2563eb;color:#fff}
.kb-item-actions a.danger:hover{background:#dc2626}
.kb-item-content{font-size:12px;color:#64748b;line-height:1.5;cursor:pointer;max-height:60px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;word-break:break-word}

/* ========== 表单弹窗字段美化 ========== */
.ui-modal-fields{display:flex;flex-direction:column;gap:16px}
.ui-modal-fields label{display:flex;flex-direction:column;gap:8px;font-size:13px;color:#475569;font-weight:600}
.ui-modal-fields input,.ui-modal-fields textarea{padding:11px 13px;border:1px solid #e2e8f0;border-radius:8px;font-size:14px;font-family:inherit;transition:all .15s;font-weight:400}
.ui-modal-fields input:focus,.ui-modal-fields textarea:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.1)}
.ui-modal-fields textarea{resize:vertical;min-height:120px;line-height:1.6}
/* ========== 行内 AI 比价 Loading ========== */
.inline-loading{display:flex;align-items:center;gap:8px;padding:8px 0}
.inline-spinner{width:16px;height:16px;border:2px solid #e0e7ff;border-top-color:#6366f1;border-radius:50%;animation:inlineSpin .9s linear infinite;flex-shrink:0}
@keyframes inlineSpin{to{transform:rotate(360deg)}}
.inline-text{font-size:12px;color:#6366f1;font-weight:500}

/* AI 比价遮罩（编辑弹窗触发时用） */
.ai-loading{position:fixed;inset:0;background:rgba(15,23,42,.6);z-index:5000;display:flex;align-items:center;justify-content:center}
.ai-loading-box{background:#fff;padding:32px 40px;border-radius:16px;box-shadow:0 24px 60px rgba(0,0,0,.35);min-width:340px;text-align:center}
.ai-loading-spinner{width:52px;height:52px;border:4px solid #e0e7ff;border-top-color:#6366f1;border-radius:50%;margin:0 auto 18px;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.ai-loading-title{font-size:16px;font-weight:600;color:#1e293b;margin-bottom:6px}
.ai-loading-sub{font-size:13px;color:#94a3b8;line-height:1.6;margin-bottom:18px}
.ai-loading-progress{height:6px;background:#e2e8f0;border-radius:3px;overflow:hidden}
.ai-loading-bar{height:100%;background:linear-gradient(90deg,#8b5cf6,#6366f1);width:0;animation:aiProgress 9s ease-out forwards}
@keyframes aiProgress{0%{width:5%}20%{width:25%}40%{width:50%}60%{width:70%}80%{width:85%}100%{width:95%}}