:root{--green:#287d55;--green2:#195f3e;--pale:#e9f4ed;--ink:#1c3428;--muted:#7c8e82;--stroke:#e1e9e2;--bg:#f5f8f5;--danger:#b55441}*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--ink)}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}.hidden{display:none!important}.auth-wrap{display:grid;place-items:center;min-height:100vh;padding:24px;background:radial-gradient(circle at 15% 20%,#e0f2e6,transparent 35%),radial-gradient(circle at 95% 90%,#d5ebdb,transparent 40%),#f6faf7}.auth-card{width:min(100%,470px);background:white;padding:32px;border:1px solid var(--stroke);border-radius:22px;box-shadow:0 18px 60px #28694d15}.logo,.brand{display:flex;gap:13px;align-items:center}.logo span,.brand-mark{background:var(--green);color:white;border-radius:13px;display:grid;place-items:center;font-size:26px;font-weight:700;width:52px;height:52px}.logo h1{margin:0;font-size:26px}.logo small,.brand small{display:block;color:var(--muted);font-size:12px;margin-top:4px}.pill{background:var(--pale);color:var(--green);display:inline-block;padding:7px 12px;border-radius:30px;font-size:12px;margin:21px 0 7px}.auth-card h2{font-size:23px;margin:13px 0 5px}.hint{color:var(--muted);font-size:13px;line-height:1.6}label{display:block;font-size:13px;font-weight:600;margin-bottom:7px}.field{margin:15px 0}input,textarea,select{width:100%;padding:12px 14px;border-radius:10px;border:1px solid #dce6de;background:#fff;color:var(--ink);outline:none}input:focus,textarea:focus,select:focus{border-color:var(--green);box-shadow:0 0 0 3px #287d551a}textarea{resize:vertical;min-height:75px}.primary,.secondary,.danger,.quiet{border:0;border-radius:9px;padding:11px 15px;font-weight:600}.primary{background:var(--green);color:white}.primary:hover{background:var(--green2)}.secondary{background:#ebf3ed;color:var(--green2)}.danger{background:#fff0ec;color:var(--danger)}.quiet{background:transparent;color:#61776a}.full{width:100%}.auth-links{text-align:center;margin:18px 0;font-size:13px}.link{border:0;background:transparent;color:var(--green);padding:4px 8px}.demo-note{background:#f6f8f6;padding:15px;border-radius:12px;margin-top:22px;font-size:12px;color:#697d70}.demo-note p{margin:6px 0}.layout{display:flex;min-height:100vh}.sidebar{width:242px;background:#fff;border-right:1px solid var(--stroke);padding:24px 16px;display:flex;flex-direction:column;gap:22px;position:sticky;top:0;height:100vh}.brand{padding:0 10px}.brand-mark{width:40px;height:40px;font-size:20px}.brand b{font-size:22px}.my-id{font-size:12px;background:var(--pale);border-radius:12px;padding:13px;color:#2b6647;line-height:1.9}.sidebar nav{display:grid;gap:5px}.sidebar nav button{border:0;padding:12px 15px;background:transparent;color:#60776a;text-align:left;border-radius:9px;font-weight:600;width:100%}.sidebar nav button:hover{background:#f3f7f3}.sidebar nav button.active{color:var(--green);background:var(--pale)}.side-bottom{margin-top:auto;display:grid;gap:10px}.side-bottom span{font-size:11px;color:#98a59c;line-height:1.5}.main{flex:1;min-width:0}.topbar{display:flex;justify-content:space-between;align-items:center;padding:25px 34px;background:white;border-bottom:1px solid var(--stroke);gap:16px}.topbar h2{font-size:23px;margin:0}.topbar p{margin:5px 0 0;color:var(--muted);font-size:13px}.top-user{color:var(--green);font-weight:700;font-size:13px}#content{max-width:1300px;margin:auto;padding:28px 34px 80px}.panel{background:white;border:1px solid var(--stroke);border-radius:15px;padding:23px;margin:0 0 18px;box-shadow:0 3px 12px #1d493908}.panel h3{margin:0 0 15px;font-size:18px}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(225px,1fr));gap:15px}.stat{border-radius:12px;background:#f3f7f3;padding:20px}.stat b{font-size:27px;display:block;margin:8px 0;color:var(--green2)}.stat small,.muted{color:var(--muted);font-size:12px}.list{display:grid;gap:10px}.list-row{border:1px solid var(--stroke);border-radius:10px;padding:15px;display:flex;align-items:center;gap:12px;justify-content:space-between}.list-row:hover{background:#fcfefd}.list-row strong{display:block;margin-bottom:5px}.list-row small{color:var(--muted);line-height:1.6}.row-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.row-actions button{padding:8px 10px;font-size:12px}.flex{display:flex;gap:15px;align-items:center}.flex-between{display:flex;justify-content:space-between;gap:15px;align-items:center}.avatar{background:#d5eadd;color:#276849;width:43px;height:43px;border-radius:50%;display:grid;place-items:center;font-weight:700;flex:none}.chat-layout{display:grid;grid-template-columns:290px 1fr;gap:15px;min-height:500px}.chat-list{border-right:1px solid var(--stroke);padding-right:13px}.chat-link{display:block;width:100%;text-align:left;background:white;border:1px solid var(--stroke);padding:14px;border-radius:10px;margin:7px 0}.chat-link.selected{background:var(--pale);border-color:#aacdb6}.chat-messages{height:360px;overflow-y:auto;background:#f7faf8;border-radius:12px;padding:15px;display:flex;flex-direction:column;gap:12px}.bubble{border-radius:13px;background:white;border:1px solid var(--stroke);padding:12px 14px;max-width:83%;align-self:flex-start;line-height:1.6;overflow-wrap:anywhere}.bubble.mine{align-self:flex-end;background:#d7efdf;border:0}.bubble small{display:block;color:#91a097;font-size:10px;margin-top:7px}.composer{display:flex;gap:10px;margin-top:12px}.composer input{flex:1}.composer button{flex:none}.notice{padding:13px;background:#ebf5ef;border-radius:10px;color:#3c7655;font-size:13px;line-height:1.8}.warn{background:#fff0e9;color:#8d6045}.two{display:grid;grid-template-columns:1fr 1fr;gap:15px}.table{overflow:auto}.table table{border-collapse:collapse;width:100%;font-size:13px}.table td,.table th{padding:13px 11px;text-align:left;border-bottom:1px solid var(--stroke);white-space:nowrap}.table th{color:#829388;background:#f7faf8}.badge{border-radius:99px;padding:5px 10px;display:inline-block;font-size:11px;background:#e4f2e8;color:#25814c}.badge.off{background:#f5e8e3;color:#ae6049}.toast{position:fixed;top:20px;right:20px;padding:14px 20px;z-index:99;background:#243d2e;color:white;border-radius:12px;box-shadow:0 8px 35px #0002;max-width:360px;font-size:14px}.stack{display:grid;gap:13px}.stack label{margin:0}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.toolbar input{width:min(100%,300px)}.empty{text-align:center;color:#99a99d;padding:35px 10px}.progress{background:#e2ece5;height:8px;border-radius:30px;overflow:hidden}.progress i{display:block;background:var(--green);height:100%;border-radius:30px}@media(max-width:850px){.sidebar{width:74px;padding:18px 9px}.sidebar .brand div:not(.brand-mark),.sidebar .my-id,.sidebar nav button .navlabel,.side-bottom span{display:none}.sidebar .brand{padding:0}.sidebar nav button{text-align:center;font-size:20px;padding:12px 2px}.sidebar .brand-mark{margin:auto}.topbar{padding:20px}.topbar h2{font-size:20px}#content{padding:20px}.chat-layout{grid-template-columns:1fr}.chat-list{border-right:0;border-bottom:1px solid var(--stroke);padding-bottom:12px}.chat-list .chat-link{display:inline-block;width:auto;margin:5px}.two{grid-template-columns:1fr}}@media(max-width:540px){.sidebar{width:58px;padding:17px 4px}.sidebar .brand-mark{width:38px;height:38px}.topbar{padding:14px}.topbar p{max-width:180px}.top-user{font-size:11px}.panel{padding:15px}.list-row{flex-wrap:wrap}.row-actions{width:100%;justify-content:flex-start}#content{padding:12px}.auth-card{padding:22px}}

/* V1.2：聊天双方消息区分；仅修改显示，不变更已有会话/数据结构 */
.chat-messages{display:flex;flex-direction:column;align-items:stretch;gap:12px}
.message-row{display:flex;width:100%;min-width:0}
.message-incoming{justify-content:flex-start}
.message-outgoing{justify-content:flex-end}
.message-bubble{max-width:min(78%,570px);min-width:72px;padding:10px 14px;border-radius:16px;border:1px solid var(--stroke);background:#fff;box-shadow:0 1px 2px #1c342807;overflow-wrap:anywhere}
.message-incoming .message-bubble{border-bottom-left-radius:5px}
.message-outgoing .message-bubble{background:#d8efdf;border-color:#badbc5;border-bottom-right-radius:5px}
.message-sender{font-size:12px;font-weight:700;color:#528066;margin-bottom:5px}
.message-outgoing .message-sender{color:#286847;text-align:right}
.message-text{font-size:15px;line-height:1.7;white-space:pre-wrap;word-break:break-word}
.message-time{font-size:11px;color:#829588;margin-top:6px;text-align:left}
.message-outgoing .message-time{text-align:right}
@media(max-width:540px){.message-bubble{max-width:88%}}
/* V1.8: polished operations dashboard, consistent with navy Windows client */
:root{--green:#275783;--green2:#193d68;--pale:#e9f0fa;--ink:#24374b;--muted:#788ba2;--stroke:#e0e8f1;--bg:#f5f7fb}
body{background:#f5f7fb}
.sidebar{background:#193d68;color:#eaf1ff;border:0}
.sidebar .brand b,.sidebar .brand small,.sidebar .my-id,.sidebar nav button,.sidebar .side-bottom,.sidebar .quiet{color:#f0f6ff!important}
.sidebar .brand-mark{background:#315e90}
.sidebar nav button.active,.sidebar nav button:hover{background:#315e90;color:white}
.main .topbar{background:#fff;border-bottom:1px solid #e6ecf5}
.panel{border:1px solid #e4eaf3;box-shadow:0 3px 18px #173a6310;border-radius:17px}
.notice{background:#edf3fa;border-radius:13px;color:#345477}
.stat{background:#f2f5fa;border-radius:14px}
.primary{background:#275783}
.primary:hover{background:#193d68}
.secondary{background:#e9f0f7;color:#285176}
.secondary:hover{background:#d8e5f3}
.badge{color:#27624f;background:#e6f4ec}

/* V2.0.5 conversation browser */
.chat-filters{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:12px;align-items:end;margin:18px 0}.chat-filters .field{min-width:0}.chat-filters input,.chat-filters select{width:100%;box-sizing:border-box;padding:12px;border:1px solid #cfdbd5;border-radius:9px;background:#fff}.chat-pages{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin:12px 0}.chat-message-list{max-height:560px;overflow:auto;display:flex;flex-direction:column;gap:10px;margin-top:12px}.chat-message-row{border:1px solid #dce7e0;border-radius:10px;padding:12px;background:#f8faf8;overflow-wrap:anywhere}.chat-message-row small{display:block;color:#6c8276;margin-bottom:7px}.chat-message-body{white-space:pre-wrap;line-height:1.6}@media(max-width:1000px){.chat-filters{grid-template-columns:repeat(2,minmax(140px,1fr))}}
