:root{--cs-bg:#f4f7fb;--cs-surface:#fff;--cs-surface-soft:#f8fafc;--cs-border:#e2e8f0;--cs-border-strong:#cbd5e1;--cs-text:#0f172a;--cs-muted:#64748b;--cs-faint:#94a3b8;--cs-primary:#2563eb;--cs-primary-dark:#1d4ed8;--cs-primary-soft:#eff6ff;--cs-success:#16a34a;--cs-success-soft:#dcfce7;--cs-danger:#dc2626;--cs-danger-soft:#fef2f2;--cs-warning:#c2410c;--cs-warning-soft:#fff7ed;--cs-shadow:0 10px 30px #0f172a14;--cs-font:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif}.cs-workspace,.cs-admin{background:var(--cs-bg);height:100dvh;min-height:0;color:var(--cs-text);font-family:var(--cs-font);overflow:hidden}.cs-workspace{grid-template-columns:360px minmax(0,1fr);min-height:0;display:grid}.cs-inbox{background:var(--cs-surface);border-right:1px solid var(--cs-border);flex-direction:column;min-width:0;min-height:0;display:flex}.cs-inbox-head{border-bottom:1px solid var(--cs-border);padding:20px}.cs-agent-row,.cs-chat-title-row,.cs-admin-brand{align-items:center;gap:12px;display:flex}.cs-agent-avatar,.cs-user-avatar,.cs-message-avatar,.cs-admin-logo,.cs-history-avatar{border-radius:8px;flex-shrink:0;place-items:center;font-weight:800;display:grid}.cs-agent-avatar{object-fit:cover;background:#eef2ff;border-radius:50%;width:44px;height:44px;display:block}.cs-agent-name{font-size:16px;font-weight:800;line-height:1.2}.cs-status-line,.cs-chat-status{color:var(--cs-muted);align-items:center;gap:7px;margin-top:5px;font-size:12px;display:flex}.cs-dot{border-radius:50%;width:8px;height:8px;display:inline-block}.cs-inbox-actions{gap:8px;margin-left:auto;display:flex}.cs-small-btn,.cs-ghost-btn,.cs-admin-refresh{border:1px solid var(--cs-border);color:var(--cs-muted);cursor:pointer;background:#fff;border-radius:8px;height:32px;padding:0 10px}.cs-inbox-stats{grid-template-columns:repeat(3,1fr);gap:10px;margin-top:18px;display:grid}.cs-stat{border:1px solid var(--cs-border);background:var(--cs-surface-soft);border-radius:8px;padding:11px 12px}.cs-stat strong{font-size:19px;line-height:1;display:block}.cs-stat span{color:var(--cs-muted);margin-top:6px;font-size:12px;display:block}.cs-list-bar{border-bottom:1px solid var(--cs-border);justify-content:space-between;align-items:center;height:46px;padding:0 18px;font-weight:800;display:flex}.cs-link-btn{color:var(--cs-primary);cursor:pointer;background:0 0;border:0}.cs-user-list{scrollbar-gutter:stable;flex:1;min-height:0;padding:12px 12px 24px;overflow-y:auto}.cs-user-card{text-align:left;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:8px;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;padding:12px;display:grid}.cs-user-card+.cs-user-card{margin-top:6px}.cs-user-card:hover,.cs-user-card.is-active{background:var(--cs-primary-soft);border-color:#bfdbfe}.cs-user-avatar,.cs-history-avatar{color:#1d4ed8;background:#dbeafe;width:40px;height:40px}img.cs-user-avatar,img.cs-history-avatar{object-fit:cover;background:#eef2ff;border-radius:50%;display:block}.cs-user-name-row{align-items:center;gap:8px;min-width:0;display:flex}.cs-user-name,.cs-history-name{text-overflow:ellipsis;white-space:nowrap;font-weight:800;overflow:hidden}.cs-last-message,.cs-history-preview{color:var(--cs-muted);text-overflow:ellipsis;white-space:nowrap;margin-top:5px;font-size:12px;display:block;overflow:hidden}.cs-online-pill,.cs-status-pill,.cs-muted-pill{white-space:nowrap;border-radius:999px;padding:3px 8px;font-size:11px}.cs-online-pill,.cs-status-pill.is-success{background:var(--cs-success-soft);color:#166534}.cs-muted-pill{color:#475569;background:#e2e8f0}.cs-status-pill.is-danger{background:var(--cs-danger-soft);color:var(--cs-danger)}.cs-unread{background:var(--cs-danger);color:#fff;border-radius:999px;place-items:center;min-width:20px;height:20px;padding:0 6px;font-size:11px;font-weight:800;display:grid}.cs-chat{background:#ededed;flex-direction:column;min-width:0;min-height:0;display:flex}.cs-chat-header{background:#ededed;border-bottom:1px solid #d9d9d9;align-items:center;height:56px;padding:0 20px;display:flex}.cs-chat-user{font-size:17px;font-weight:800}.cs-messages{scrollbar-gutter:stable;flex:1;min-height:0;padding:16px 20px;overflow-y:auto}.cs-message-row{align-items:flex-start;gap:10px;margin-bottom:20px;display:flex}.cs-message-row.is-agent{justify-content:flex-end}.cs-message-avatar{object-fit:cover;background:#e0e0e0;border-radius:4px;flex-shrink:0;width:38px;height:38px;display:block}.cs-bubble{word-break:break-word;overflow-wrap:anywhere;border-radius:4px 12px 12px;min-width:0;max-width:min(560px,62%);padding:10px 14px;font-size:15px;line-height:1.6;position:relative;overflow:visible}.cs-bubble.is-user{color:#1a1a1a;background:#fff}.cs-bubble.is-user:before{content:"";border-top:8px solid #0000;border-bottom:8px solid #0000;border-right:8px solid #fff;width:0;height:0;position:absolute;top:10px;left:-6px}.cs-bubble.is-agent{color:#000;background:#95ec69;border-radius:12px 4px 12px 12px}.cs-bubble.is-agent:after{content:"";border-top:8px solid #0000;border-bottom:8px solid #0000;border-left:8px solid #95ec69;width:0;height:0;position:absolute;top:10px;right:-6px}.cs-bubble-time{text-align:right;color:#b0b0b0;letter-spacing:.02em;margin-top:4px;font-size:11px}.cs-file-link{color:#2563eb;text-underline-offset:2px;text-decoration:underline}.cs-bubble img{object-fit:contain;border-radius:8px;width:auto;max-width:min(360px,100%);height:auto;max-height:280px;display:block}.cs-bubble a{color:#2563eb;overflow-wrap:anywhere;word-break:break-word}.cs-msg-image,.cs-history-image{cursor:pointer;object-fit:contain;border-radius:8px;max-width:100%;height:auto;max-height:300px;display:block}.cs-composer{background:#f7f7f7;border-top:1px solid #d9d9d9;grid-template-columns:auto minmax(0,1fr) auto;align-items:end;gap:10px;padding:10px 16px;display:grid}.cs-attach{color:#555;background:#f7f7f7;border:1px solid #d9d9d9;padding:0 14px}.cs-send{color:#fff;background:#07c160;border:0;padding:0 20px;font-weight:600}.cs-send,.cs-attach{cursor:pointer;border-radius:6px;height:38px;font-size:14px}.cs-composer textarea{resize:none;min-height:38px;max-height:112px;font:inherit;background:#fff;border:1px solid #d9d9d9;border-radius:6px;outline:none;padding:8px 12px;font-size:15px}.cs-composer textarea:focus{border-color:#07c160}.cs-empty{text-align:center;color:var(--cs-muted);flex:1;place-items:center;display:grid}.cs-empty-card{max-width:360px}.cs-empty-icon{width:58px;height:58px;color:var(--cs-primary);background:#dbeafe;border-radius:8px;place-items:center;margin:0 auto 16px;font-weight:900;display:grid}.cs-loading,.cs-empty-list{text-align:center;color:var(--cs-faint);padding:20px}.cs-modal-mask{z-index:100;background:#0f172a73;place-items:center;display:grid;position:fixed;inset:0}.cs-modal{background:#fff;border-radius:8px;width:min(430px,100vw - 32px);padding:22px;box-shadow:0 24px 70px #0f172a40}.cs-modal-head{justify-content:space-between;align-items:center;margin-bottom:18px;display:flex}.cs-modal h3{margin:0}.cs-close{color:var(--cs-muted);cursor:pointer;background:0 0;border:0;font-size:22px}.cs-field{color:var(--cs-muted);flex-direction:column;gap:7px;margin-bottom:14px;font-size:13px;font-weight:700;display:flex}.cs-input{border:1px solid var(--cs-border-strong);height:40px;font:inherit;border-radius:8px;outline:none;padding:0 12px}.cs-modal-actions{justify-content:flex-end;gap:10px;margin-top:20px;display:flex}.cs-secondary,.cs-primary{cursor:pointer;border-radius:8px;height:38px;padding:0 18px}.cs-secondary{border:1px solid var(--cs-border-strong);color:var(--cs-muted);background:#fff}.cs-admin{grid-template-columns:252px minmax(0,1fr);display:grid}.cs-admin-sidebar{border-right:1px solid var(--cs-border);background:#fff;flex-direction:column;padding:20px;display:flex}.cs-admin-logo{background:var(--cs-primary);color:#fff;width:42px;height:42px}.cs-admin-title{font-size:16px;font-weight:900}.cs-admin-sub{color:var(--cs-muted);margin-top:4px;font-size:12px}.cs-admin-nav{flex-direction:column;gap:8px;margin-top:24px;display:flex}.cs-admin-nav button{height:42px;color:var(--cs-muted);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:8px;padding:0 14px;font-weight:800}.cs-admin-nav button.is-active{background:var(--cs-primary-soft);color:var(--cs-primary)}.cs-admin-logout{background:var(--cs-danger-soft);height:40px;color:var(--cs-danger);cursor:pointer;border:1px solid #fecaca;border-radius:8px;margin-top:auto;font-weight:800}.cs-admin-main{min-width:0;overflow-y:auto}.cs-admin-top{border-bottom:1px solid var(--cs-border);z-index:2;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background:#ffffffe6;justify-content:space-between;align-items:center;height:88px;padding:0 30px;display:flex;position:sticky;top:0}.cs-admin-top h1{margin:0;font-size:23px}.cs-admin-top p{color:var(--cs-muted);margin:6px 0 0;font-size:13px}.cs-admin-metrics{grid-template-columns:repeat(4,minmax(150px,1fr));gap:14px;padding:20px 30px 0;display:grid}.cs-admin-metric{border:1px solid var(--cs-border);background:#fff;border-radius:8px;padding:17px;box-shadow:0 1px 2px #0f172a08}.cs-admin-metric b{font-size:25px;display:block}.cs-admin-metric span{color:var(--cs-muted);margin-top:5px;font-size:13px;display:block}.cs-panel{border:1px solid var(--cs-border);background:#fff;border-radius:8px;margin:20px 30px 30px;box-shadow:0 1px 2px #0f172a08}.cs-panel-head{border-bottom:1px solid var(--cs-border);justify-content:space-between;align-items:center;gap:16px;padding:20px;display:flex}.cs-panel-head h2{margin:0;font-size:17px}.cs-panel-head p{color:var(--cs-muted);margin:6px 0 0;font-size:13px}.cs-table-wrap{overflow-x:auto}.cs-table{border-collapse:collapse;width:100%}.cs-table th{text-align:left;color:var(--cs-muted);background:var(--cs-surface-soft);border-bottom:1px solid var(--cs-border);padding:13px 16px;font-size:12px}.cs-table td{border-bottom:1px solid #f1f5f9;padding:13px 16px;font-size:14px}.cs-actions{flex-wrap:wrap;align-items:center;gap:7px;display:flex}.cs-btn{cursor:pointer;border:1px solid var(--cs-border);height:30px;color:var(--cs-muted);background:#fff;border-radius:6px;padding:0 10px}.cs-btn.blue{background:var(--cs-primary-soft);color:var(--cs-primary-dark);border-color:#bfdbfe}.cs-btn.green{color:#15803d;background:#f0fdf4;border-color:#bbf7d0}.cs-btn.orange{background:var(--cs-warning-soft);color:var(--cs-warning);border-color:#fed7aa}.cs-btn.red{background:var(--cs-danger-soft);color:var(--cs-danger);border-color:#fecaca}.cs-inline-input{border:1px solid var(--cs-border-strong);border-radius:6px;outline:none;width:120px;height:30px;padding:0 8px}.cs-keyword-list{flex-wrap:wrap;gap:6px;max-width:460px;display:flex}.cs-keyword-list span{background:var(--cs-primary-soft);color:var(--cs-primary-dark);border-radius:999px;padding:4px 9px;font-size:12px;font-weight:700}.cs-settings-panel{max-width:900px;padding:22px}.cs-rule-modal{flex-direction:column;width:min(760px,100vw - 32px);max-height:85vh;padding:0;display:flex;overflow:hidden}.cs-rule-modal .cs-modal-head{border-bottom:1px solid var(--cs-border);flex-shrink:0;margin-bottom:0;padding:20px 22px}.cs-rule-modal-body{min-height:0;padding:18px 22px 4px;overflow-y:auto}.cs-rule-modal .cs-modal-actions{border-top:1px solid var(--cs-border);background:#fff;flex-shrink:0;margin-top:0;padding:14px 22px 18px}.cs-rule-grid{grid-template-columns:1fr 1fr;gap:14px;display:grid}.cs-keyword-input{resize:vertical;min-height:92px;padding-top:10px}.cs-rule-editor{min-height:150px}.cs-editor-block{margin-bottom:22px}.cs-editor-label{margin-bottom:8px;font-weight:800;display:block}.cs-toolbar{border:1px solid var(--cs-border-strong);background:var(--cs-surface-soft);border-bottom:0;border-radius:8px 8px 0 0;flex-wrap:wrap;align-items:center;gap:4px;padding:8px;display:flex}.cs-toolbar button{border:1px solid var(--cs-border-strong);cursor:pointer;background:#fff;border-radius:6px;min-width:30px;height:28px}.cs-toolbar button:disabled{cursor:not-allowed;color:var(--cs-faint);background:#f1f5f9}.cs-toolbar-divider{background:var(--cs-border-strong);width:1px;height:20px;margin:0 4px}.cs-editor{border:1px solid var(--cs-border-strong);background:#fff;border-top:0;border-radius:0 0 8px 8px;outline:none;min-height:124px;padding:14px;line-height:1.6}.cs-editor img{object-fit:contain;border-radius:8px;max-width:100%;max-height:360px;margin:8px 0;display:block}.cs-editor a{color:var(--cs-primary);text-underline-offset:2px;text-decoration:underline}.cs-upload-placeholder{background:var(--cs-primary-soft);color:var(--cs-primary-dark);border-radius:999px;padding:3px 10px;font-size:13px;font-weight:700;display:inline-block}.cs-saved{color:#166534;background:var(--cs-success-soft);border-radius:999px;padding:6px 10px;font-size:13px}.cs-history{grid-template-columns:330px minmax(0,1fr);gap:16px;height:calc(100vh - 210px);min-height:0;margin:20px 30px 30px;display:grid}.cs-history-list,.cs-history-chat{border:1px solid var(--cs-border);background:#fff;border-radius:8px;min-height:0;overflow:hidden}.cs-history-list{padding:12px;overflow-y:auto}.cs-history-list-title{padding:6px 6px 12px;font-weight:900}.cs-history-item{cursor:pointer;text-align:left;background:0 0;border:1px solid #0000;border-radius:8px;grid-template-columns:40px minmax(0,1fr);align-items:center;gap:10px;width:100%;padding:10px;display:grid}.cs-history-item.is-active,.cs-history-item:hover{background:var(--cs-primary-soft);border-color:#bfdbfe}.cs-history-chat{background:#ededed;flex-direction:column;display:flex}.cs-history-chat-head{border-bottom:1px solid var(--cs-border);background:#fff;align-items:center;gap:10px;height:58px;padding:0 18px;font-weight:900;display:flex}.cs-history-chat-head span{color:var(--cs-muted);font-size:12px;font-weight:700}.cs-history-messages{background:#ededed;flex:1;padding:16px 20px;overflow-y:auto}.cs-history-row{align-items:flex-start;gap:10px;margin-bottom:20px;display:flex}.cs-history-row.is-agent{justify-content:flex-end}.cs-history-bubble{word-break:break-word;overflow-wrap:anywhere;background:#fff;border-radius:4px 12px 12px;min-width:0;max-width:min(560px,62%);padding:10px 14px;font-size:15px;line-height:1.6;position:relative;overflow:visible}.cs-history-bubble:before{content:"";border-top:8px solid #0000;border-bottom:8px solid #0000;border-right:8px solid #fff;width:0;height:0;position:absolute;top:10px;left:-6px}.cs-history-row.is-agent .cs-history-bubble{color:#000;background:#95ec69;border-radius:12px 4px 12px 12px}.cs-history-row.is-agent .cs-history-bubble:before{content:none}.cs-history-row.is-agent .cs-history-bubble:after{content:"";border-top:8px solid #0000;border-bottom:8px solid #0000;border-left:8px solid #95ec69;width:0;height:0;position:absolute;top:10px;right:-6px}.cs-history-bubble img{object-fit:contain;border-radius:8px;width:auto;max-width:min(360px,100%);height:auto;max-height:280px;display:block}.cs-history-bubble a{color:#2563eb;overflow-wrap:anywhere;word-break:break-word}.cs-msg-role{color:#b0b0b0;margin-bottom:4px;font-size:11px}.cs-msg-time{color:#b0b0b0;text-align:right;letter-spacing:.02em;margin-top:4px;font-size:11px}.cs-history-empty{color:var(--cs-faint);flex:1;place-items:center;display:grid}@media (width<=980px){.cs-workspace{grid-template-columns:320px minmax(0,1fr)}.cs-inbox{display:flex}.cs-admin{grid-template-columns:1fr}.cs-admin-sidebar{display:none}.cs-admin-metrics{grid-template-columns:repeat(2,1fr)}}@media (width<=720px){.cs-workspace{grid-template-columns:minmax(260px,42vw) minmax(0,1fr)}.cs-inbox-head{padding:16px}.cs-inbox-actions{flex-direction:column;gap:6px}.cs-messages{padding:18px}.cs-bubble{max-width:82%}.cs-composer{padding:12px}}
