:root{--ink:#253745;--muted:#596b78;--line:#dbe1e4;--ground:#f5f6f6;--rail:#eeeFec;--paper:#fff;--accent:#233c55;--accent-hover:#142d43;--selected:#e5edf3;--good:#24705a;--good-bg:#eaf5f0;--warning:#795115;--warning-bg:#fff6e2;--error:#a33838;--error-bg:#fff0ee;--radius:12px;--focus:#597d9d;font-family:"Microsoft YaHei UI","Microsoft YaHei",system-ui,-apple-system,sans-serif;color:var(--ink);font-size:14px;line-height:1.6;font-variant-numeric:tabular-nums}
*{box-sizing:border-box}body{margin:0;background:var(--ground)}button,input,textarea,select{font:inherit}button,a,input,textarea,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}a{color:var(--accent);text-underline-offset:3px}button,.button{border:1px solid var(--line);background:white;color:var(--ink);border-radius:7px;padding:8px 14px;display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;text-decoration:none;line-height:1.5;min-height:38px;transition:background .15s}button:hover,.button:hover{background:#f0f3f5}button.primary,.button.primary{background:var(--accent);color:white;border-color:var(--accent)}button.primary:hover{background:var(--accent-hover)}button.ghost{border-color:transparent;background:transparent}button.danger{color:var(--error)}button.small{padding:5px 10px;min-height:32px;font-size:13px}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid var(--focus);outline-offset:2px}::selection{color:white;background:var(--accent)}input,select,textarea{width:100%;color:var(--ink);background:white;border:1px solid #bcc8cf;border-radius:7px;min-height:40px;padding:9px 11px;caret-color:var(--accent)}input::placeholder,textarea::placeholder{color:#647582}textarea{resize:vertical;line-height:1.7;min-height:95px}label{display:block;font-size:13px;font-weight:600;margin:0 0 6px}h1,h2,h3,p{margin:0}h1{font-size:21px;font-weight:650;letter-spacing:-.02em;line-height:1.5}h2{font-size:17px;font-weight:650;line-height:1.6}h3{font-size:14px;font-weight:650}small,.muted{color:var(--muted)}small{font-size:12px}.muted{font-size:13px}.icon{width:19px;height:19px;flex-shrink:0;vertical-align:middle;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.row{display:flex;align-items:center;gap:10px}.between{justify-content:space-between}.wrap{flex-wrap:wrap}.grow{flex:1;min-width:0}.stack{display:grid;gap:16px}.field{min-width:0}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.full{grid-column:1/-1}.section-gap{margin-top:28px}.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:20px}.helper{font-size:12px;color:var(--muted);margin-top:6px}.badge{font-size:12px;padding:3px 8px;background:#edf1f3;border-radius:5px;color:#485e70;white-space:nowrap;display:inline-block}.badge.good{color:var(--good);background:var(--good-bg)}.badge.warn{color:var(--warning);background:var(--warning-bg)}.notice{background:var(--warning-bg);color:var(--warning);padding:12px 15px;border-radius:8px;font-size:13px;line-height:1.7}.notice.good{background:var(--good-bg);color:var(--good)}.notice.error{background:var(--error-bg);color:var(--error)}.error-text{color:var(--error);font-size:13px;margin-top:10px;white-space:pre-wrap}.hidden{display:none!important}.boot{padding:64px;text-align:center;color:var(--muted)}.empty{padding:56px 24px;text-align:center;color:var(--muted)}.empty h2{color:var(--ink);margin:12px 0 8px}.empty p{max-width:45ch;margin:0 auto 20px;font-size:13px}.empty .icon{width:32px;height:32px;color:#6c8292}
.login-wrap{min-height:100dvh;display:grid;place-items:center;padding:28px;background:#eef1f2}.login{width:410px;max-width:100%;background:white;border:1px solid var(--line);border-radius:16px;padding:36px}.brand{display:flex;align-items:center;gap:10px;font-size:16px;font-weight:650}.brand-mark{width:34px;height:34px;display:grid;place-items:center;border-radius:9px;color:white;background:var(--accent)}.login h1{margin-top:32px;margin-bottom:7px}.login form{margin-top:28px}.login .field+.field{margin-top:18px}.login button{width:100%;margin-top:24px}.login-footer{border-top:1px solid var(--line);padding-top:18px;margin-top:24px;font-size:12px;color:var(--muted)}
.shell{display:grid;grid-template-columns:184px 1fr;height:100dvh;overflow:hidden}.sidebar{background:var(--rail);border-right:1px solid var(--line);display:flex;flex-direction:column;padding:25px 14px 15px}.sidebar .brand{padding:0 7px 25px;align-items:flex-start;gap:9px;font-size:15px;line-height:1.4}.brand small{display:block;font-weight:400;margin-top:3px}.nav{display:grid;gap:6px}.nav a{display:flex;gap:11px;align-items:center;min-height:44px;padding:10px 13px;border-radius:8px;text-decoration:none;color:#50616b;font-size:14px}.nav a:hover{background:#e2e7e8}.nav a.active{background:var(--accent);color:white}.sidebar-bottom{margin-top:auto;border-top:1px solid #cfd7d8;padding:16px 6px 0}.avatar{width:31px;height:31px;border-radius:50%;background:#dce4e7;display:grid;place-items:center;font-size:13px;color:var(--accent);font-weight:650}.user-name{font-size:13px;max-width:105px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-bottom button{margin-top:12px;padding:5px;min-height:30px;font-size:12px;color:var(--muted)}.workspace{display:flex;flex-direction:column;min-width:0;overflow:hidden}.topbar{min-height:74px;display:flex;align-items:center;justify-content:space-between;padding:17px 28px;background:white;border-bottom:1px solid var(--line);gap:12px}.topbar p{font-size:12px;color:var(--muted);margin-top:3px}.topbar .badge{font-size:12px}.dot{width:7px;height:7px;background:var(--good);border-radius:50%;display:inline-block;margin-right:6px}.dot.warn{background:#a87a2d}.content{flex:1;min-height:0;overflow:auto}.page{padding:28px;max-width:1450px;margin:auto}.page-title{margin-bottom:22px}.page-title p{color:var(--muted);font-size:13px;margin-top:4px}.panel{background:white;border:1px solid var(--line);border-radius:var(--radius);padding:24px}.panel h2{margin-bottom:18px}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:18px}.toolbar input{max-width:400px}.toolbar select{width:auto;max-width:210px}.toolbar .grow{min-width:180px}.table-wrap{overflow:auto;background:white;border:1px solid var(--line);border-radius:var(--radius)}table{border-collapse:collapse;width:100%;font-size:13px;white-space:nowrap}th{text-align:left;font-size:12px;color:var(--muted);background:#f4f6f7;font-weight:600}th,td{padding:14px 17px;border-bottom:1px solid var(--line)}tbody tr:last-child td{border-bottom:0}tbody tr:hover{background:#f8fafb}td.clip{white-space:normal;min-width:180px;max-width:380px;overflow-wrap:anywhere}.table-name{font-weight:600;display:block;color:var(--ink)}.table-sub{font-size:12px;color:var(--muted)}.pagination{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:16px;font-size:13px;color:var(--muted)}.split{display:grid;grid-template-columns:minmax(0,1fr) 390px;gap:24px}.settings{max-width:760px}.settings .panel{margin-bottom:20px}.guide{font-size:13px;color:var(--muted);line-height:1.9}.guide li+li{margin-top:7px}.guide strong{color:var(--ink)}.guide ol{margin:0;padding-left:22px}.inline-form{background:#f8fafb;padding:16px;border-radius:8px;margin-top:14px}.revision-list{padding:0;list-style:none}.revision-list li{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding:12px 0;gap:10px}.api-doc{font-size:13px;line-height:1.8}.mono{font-family:Consolas,monospace;font-size:12px;overflow-wrap:anywhere}.section-head{margin:26px 0 12px}.section-head:first-child{margin-top:0}
.chat-layout{display:grid;grid-template-columns:260px minmax(320px,1fr) 310px;height:100%;min-height:0}.customers{border-right:1px solid var(--line);background:#fafbfb;display:flex;flex-direction:column;min-height:0}.customer-tools{padding:18px 16px;border-bottom:1px solid var(--line)}.customer-tools h2{font-size:14px;margin-bottom:12px}.customer-tools .row{margin-bottom:12px}.customer-tools input{font-size:13px;background:white}.customer-tools button{padding:5px 10px;font-size:12px;min-height:32px}.customer-list{overflow:auto;flex:1}.customer-item{width:100%;border:0;border-bottom:1px solid #e6ebed;border-radius:0;text-align:left;display:block;white-space:normal;padding:16px 17px;background:transparent;min-height:90px}.customer-item:hover{background:#eff3f5}.customer-item.active{background:var(--selected)}.customer-item .name{font-size:14px;font-weight:650}.customer-item .time{color:var(--muted);font-size:11px}.customer-item .snippet{color:var(--muted);font-size:12px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:7px;overflow-wrap:anywhere}.customer-item small{display:block;font-size:11px;margin-top:2px}.customer-page{padding:9px;border-top:1px solid var(--line);justify-content:center;gap:8px}.customer-page span{font-size:12px;color:var(--muted)}.thread{min-width:0;display:flex;flex-direction:column;background:white;min-height:0}.thread-header{padding:17px 22px;border-bottom:1px solid var(--line);min-height:77px}.thread-header h2{font-size:16px}.thread-header small{display:block;font-size:12px}.thread-header select{width:112px;font-size:12px;min-height:32px;padding:5px}.messages{padding:20px 24px;flex:1;overflow:auto;scroll-behavior:smooth}.message{margin-bottom:22px;max-width:80ch}.message-label{font-size:11px;color:var(--muted);margin-bottom:7px;display:flex;align-items:center;gap:8px}.message-content{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8;padding:13px 16px;background:#f2f5f6;border-radius:0 10px 10px 10px;font-size:14px}.message.staff .message-content{background:#edf5f1}.message.assistant .message-content{background:#edf2f8}.message.note .message-content{background:var(--warning-bg);font-size:13px}.message-actions{display:flex;gap:6px;margin-top:8px}.message-actions button{font-size:12px;padding:4px 9px;min-height:29px}.message .evidence{margin-top:9px;border:1px solid var(--line);padding:10px 13px;border-radius:8px;font-size:12px}.evidence summary{cursor:pointer;color:#49617a;font-weight:600}.evidence p{margin-top:8px;color:var(--muted);line-height:1.8}.evidence ul{padding-left:18px;color:var(--warning);line-height:1.8;margin:8px 0}.evidence .source{margin-top:7px;color:var(--muted);line-height:1.7}.composer{border-top:1px solid var(--line);padding:15px 22px 18px;flex-shrink:0;background:white}.composer textarea{min-height:86px;max-height:210px;border:0;padding:0;outline:none;border-radius:0;font-size:14px}.composer textarea:focus-visible{outline:2px solid var(--focus);outline-offset:4px}.composer .row{gap:8px;margin-top:12px}.composer select{max-width:140px;min-height:34px;font-size:12px;padding:6px 8px}.composer .hint{font-size:11px;color:var(--muted);margin-right:auto}.composer button{font-size:13px}.context-pane{border-left:1px solid var(--line);background:#f8f9f9;padding:22px 18px;overflow:auto}.context-pane h2{font-size:14px;margin-bottom:15px}.context-block{padding-bottom:22px;border-bottom:1px solid var(--line);margin-bottom:22px}.context-block:last-child{border-bottom:0}.context-pane select,.context-pane input,.context-pane textarea{font-size:12px}.context-pane label{font-size:12px}.facts{margin:0}.facts dt{font-size:12px;color:var(--muted);margin-top:14px}.facts dd{margin:3px 0 0;font-size:13px;font-weight:600;overflow-wrap:anywhere}.facts .provenance{font-weight:400;font-size:11px;line-height:1.5;color:var(--muted);margin-top:4px}.context-pane .notice{padding:10px 12px;font-size:12px}.context-pane details{margin-top:15px;font-size:12px}.context-pane summary{cursor:pointer;color:var(--accent)}.context-pane .field{margin-top:12px}.context-pane textarea{min-height:76px}.chat-empty{grid-column:2/-1;display:grid;place-items:center;background:white}.chat-empty .empty{max-width:480px}.setup-strip{font-size:12px;color:var(--warning);background:var(--warning-bg);padding:9px 16px;border-bottom:1px solid #eee1c8}.back-mobile{display:none}mark{background:#fff1aa;color:inherit;border-radius:2px}dialog{border:1px solid var(--line);border-radius:14px;padding:26px;width:500px;max-width:calc(100vw - 32px);max-height:90dvh;overflow:auto;color:var(--ink)}dialog::backdrop{background:rgb(26 42 53 / .35)}dialog h2{margin-bottom:8px}dialog form{margin-top:22px}dialog .field{margin-bottom:16px}.dialog-head{display:flex;justify-content:space-between;align-items:center}#toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 40px);background:var(--ink);color:white;border-radius:8px;padding:12px 20px;z-index:30;display:none;font-size:13px;box-shadow:0 5px 20px #0002}#toast.visible{display:block}.busy-line{height:2px;background:var(--accent);animation:busy 1.2s ease-in-out infinite}@keyframes busy{50%{opacity:.3}}
@media(min-width:1500px){.chat-layout{grid-template-columns:280px minmax(400px,1fr) 350px}.messages{padding:24px 36px}.context-pane{padding:24px}}
@media(max-width:1180px){.shell{grid-template-columns:154px 1fr}.sidebar{padding-left:9px;padding-right:9px}.sidebar .brand{font-size:13px}.chat-layout{grid-template-columns:225px minmax(300px,1fr)}.context-pane{grid-column:2;border-left:0;border-top:1px solid var(--line);max-height:350px}.thread{min-height:600px}.chat-layout{height:auto;min-height:100%}.customers{grid-row:1/3;max-height:calc(100dvh - 74px)}.content:has(.chat-layout){overflow:auto}.chat-empty{grid-column:2}.split{grid-template-columns:1fr}.topbar{padding:15px 22px}.page{padding:22px}}
@media(max-width:760px){.shell{grid-template-columns:1fr;height:100dvh}.sidebar{border-right:0;border-bottom:1px solid var(--line);padding:10px 12px;display:block}.sidebar .brand{padding:0 2px 10px;align-items:center;font-size:14px}.sidebar .brand small{display:none}.brand-mark{width:27px;height:27px;border-radius:7px}.brand-mark .icon{width:17px}.nav{display:flex;overflow-x:auto;gap:4px}.nav a{padding:8px 11px;min-height:38px;font-size:12px;white-space:nowrap;gap:6px}.nav .icon{width:16px;height:16px}.sidebar-bottom{border:0;position:absolute;right:13px;top:7px;display:flex;align-items:center;padding:0;gap:8px}.sidebar-bottom .avatar,.sidebar-bottom small{display:none}.sidebar-bottom .user-name{font-size:11px;max-width:75px}.sidebar-bottom button{margin:0;font-size:11px}.workspace{height:calc(100dvh - 99px)}.topbar{min-height:67px;padding:12px 16px}.topbar h1{font-size:18px}.topbar p{font-size:11px;max-width:210px}.topbar .badge{font-size:10px;max-width:125px;white-space:normal}.page{padding:18px 14px}.panel{padding:18px}.toolbar{gap:8px}.toolbar input{max-width:none}.toolbar select{max-width:48%;font-size:12px}.form-grid{grid-template-columns:1fr;gap:16px}.full{grid-column:1}.table-wrap{border-radius:8px}th,td{padding:12px}.chat-layout{display:block;height:100%;min-height:0}.customers{height:100%;max-height:none;border-right:0}.customer-tools{padding:14px 16px}.chat-layout.selected .customers{display:none}.chat-layout:not(.selected) .thread,.chat-layout:not(.selected) .context-pane,.chat-layout:not(.selected) .chat-empty{display:none}.chat-layout.selected .thread{height:100%;min-height:0}.context-pane{max-height:none;padding:18px}.content:has(.chat-layout.selected){overflow:auto}.chat-layout.selected{height:auto}.chat-layout.selected .thread{height:calc(100dvh - 166px);min-height:480px}.messages{padding:16px}.thread-header{padding:12px 16px;min-height:70px}.back-mobile{display:inline-flex;padding:4px 6px;min-height:30px}.composer{padding:14px 16px}.composer .row{flex-wrap:wrap}.composer .hint{display:none}.composer textarea{min-height:70px}.composer button{font-size:12px;flex:1;padding:8px 9px}.composer select{max-width:130px;font-size:11px}.message-content{font-size:13px}.customer-page{padding:12px}.chat-empty{display:none}.split{gap:16px}.settings .panel{margin-bottom:16px}.pagination{font-size:12px}.pagination .row{gap:5px}.pagination button{font-size:12px;padding:6px 9px}.setup-strip{font-size:11px}h1{font-size:19px}.login{padding:28px}.user-name{white-space:nowrap}.sidebar .brand{padding-right:110px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important;transition:none!important}}
@media(max-width:760px){.shell{grid-template-columns:minmax(0,1fr)}.sidebar,.nav,.topbar,.content{min-width:0}.thread-header>.row{min-width:0}.thread-header>.row>div{min-width:0}.thread-header h2,.thread-header small{overflow-wrap:anywhere}.thread-header select{flex-shrink:0;width:92px}.composer>.row:first-child{gap:5px;align-items:flex-start}.composer>.row:first-child .helper{max-width:120px;font-size:10px}.composer>.row:first-child button{flex:none;font-size:10px;padding:4px;white-space:normal;max-width:178px}.composer>.row:last-of-type{gap:6px}.composer select{max-width:114px}.message-label{flex-wrap:wrap}.topbar>div{min-width:0}}
