:root{font-family:Inter,"Microsoft YaHei",system-ui,sans-serif;color:#e1ebf4;background:#152331;color-scheme:dark;--border:#3b5366;--ice:#a8d8f1;--panel:#1e3041}*{box-sizing:border-box}body{margin:0;min-height:100dvh;display:grid;grid-template-rows:auto auto 1fr}header{display:flex;align-items:center;gap:16px;min-height:54px;padding:8px 16px;background:#111d28;border-bottom:1px solid var(--border);flex-wrap:wrap}header strong{font-size:16px;letter-spacing:.08em}header strong span,small{color:var(--ice)}header small{margin-left:auto}#nav,.bar{display:flex;gap:6px;align-items:center;flex-wrap:wrap}#notice:not(:empty){padding:8px 14px;background:#4c332a;color:#ffdbca}main{min-height:0;padding:12px}button,input,select,textarea{font:inherit;font-size:14px;border:1px solid var(--border);border-radius:6px;color:inherit;background:#182837;padding:7px 10px}button{cursor:pointer}button:hover,button:focus-visible{border-color:var(--ice)}button.primary{background:#a8d8f1;color:#122637;border-color:#a8d8f1;font-weight:700}input,textarea,select{min-width:0;max-width:100%}label{display:grid;gap:4px;color:#d4e1ed;font-size:13px}h1,h2,h3{margin:0 0 10px;font-size:17px}h1{font-size:21px}.panel{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:12px;min-width:0}.login{max-width:380px;margin:36px auto}.stack{display:grid;gap:9px}.grid{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr))}.workspace{display:grid;grid-template-columns:minmax(185px,255px) minmax(0,1fr);gap:10px;align-items:start}.thread{display:grid;grid-template-rows:auto minmax(100px,1fr) auto;gap:8px;height:calc(100dvh - 82px);min-height:0}.scroll{overflow:auto;max-height:calc(100dvh - 180px)}.bubble{padding:8px 10px;border-radius:8px;background:#243e52;max-width:85%;margin:5px 0;overflow-wrap:anywhere;white-space:pre-wrap}.bubble.mine{background:#315771;margin-left:auto}.bubble.internal{background:#534731}.bubble small{display:block;margin-bottom:4px}.bubble img,.bubble video{display:block;max-width:100%;max-height:260px}.queue button{text-align:left;width:100%;display:flex;justify-content:space-between;gap:5px}.status{font-size:12px;font-weight:700}.waiting{color:#ff9e9e}.active{color:#ffe079}.closed{color:#a3e5ac}.muted{color:#bdccda;font-size:13px}.table{overflow:auto}table{border-collapse:collapse;width:100%;font-size:13px}td,th{padding:7px 8px;text-align:left;border-bottom:1px solid var(--border);white-space:pre-wrap;overflow-wrap:anywhere}textarea{width:100%;resize:vertical}.compose{display:grid;gap:5px}.file{max-width:220px}a{color:var(--ice)}@media(max-width:660px){main{padding:6px}.workspace{grid-template-columns:1fr}.queue{max-height:150px;overflow:auto}.thread{height:calc(100dvh - 175px);min-height:230px}.compose input,.compose textarea{font-size:16px}header{gap:8px;padding:6px 8px}}

.status{display:inline-block;width:max-content;max-width:100%;border-radius:999px;padding:3px 8px;line-height:1.35;white-space:nowrap}
.status.waiting{background:#fce4e4;color:#a82020}
.status.active{background:#fff0b8;color:#805500}
.status.closed{background:#d9f5e3;color:#176b3a}
.queue button{align-items:center;min-width:0}
.queue button>span:first-child{min-width:0;overflow-wrap:anywhere}
.thread{grid-template-rows:auto minmax(0,1fr) auto}
.thread-head{align-items:center}
#messages{min-height:0;max-height:none;overscroll-behavior:contain;padding:2px 4px}
.message-row{display:flex;flex-direction:column;align-items:flex-start;gap:2px;margin:0 0 10px}
.message-row.member-message{align-items:flex-end}
.message-meta{color:#b4c7d6;font-size:11px;line-height:1.25}
.bubble{width:fit-content;max-width:min(calc(15em + 20px),83%);margin:0;border-radius:4px 11px 11px 11px;background:#294258;overflow-wrap:anywhere;white-space:pre-wrap}
.member-message .bubble{background:#365c77;border-radius:11px 4px 11px 11px}
.bubble.internal{background:#534731}
.bubble audio{display:block;max-width:100%}
.compose{gap:6px;min-width:0}
.order-area,.chat-area{min-width:0;border:1px solid var(--border);border-radius:8px;padding:6px 8px;display:grid;gap:5px}
.order-area{background:#182837;grid-template-columns:max-content minmax(0,1fr);align-items:center;font-size:13px}
.order-area input{flex:1;width:0;min-width:5em}
.order-area button{white-space:nowrap}
.order-area small{grid-column:2}
.order-area small:empty,.chat-area small:empty,.chat-area>div:empty{display:none}
.chat-area{background:#23394b}
.chat-area textarea{min-height:44px;max-height:110px}
.chat-area .file{display:none}
.mobile-back{display:none}
.member-page{color:#352e25;background:#fffdf5;color-scheme:light;--border:#e8dfc9;--panel:#fff;--ice:#285876}
.member-page header,.member-page .order-area{background:#fff7e6}
.member-page button,.member-page input,.member-page select,.member-page textarea{background:#fff;color:#352e25}
.member-page button.primary{background:#a8d8f1;color:#163750;border-color:#a8d8f1}
.member-page .chat-area{background:#fffdf5}
.member-page .bubble{background:#f6eddb}
.member-page .member-message .bubble{background:#dceff9}
.member-page .message-meta,.member-page .muted{color:#665b4b}
.member-page a{color:#285876}
@media(max-width:660px){
  .thread{min-height:0;height:min(650px,calc(100dvh - 245px));min-height:240px}
  .member-page:has(.in-thread){height:var(--visible-height,100dvh);min-height:0;overflow:hidden}
  .member-page .in-thread{height:100%;grid-template-rows:minmax(0,1fr);align-items:stretch}
  .member-page .in-thread>.panel:first-child{display:none}
  .member-page .in-thread .thread{height:100%;min-height:0;padding:7px;gap:5px}
  .member-page .mobile-back{display:inline-block}
  .member-page .thread-head select{max-width:48%}
  .member-page .thread-head button,.chat-area button,.order-area button{padding:5px 7px}
  .member-page #notice:not(:empty){padding:4px 8px;font-size:12px}
  .order-area,.chat-area{padding:4px 6px}
  .order-area input{font-size:16px}
  .chat-area textarea{padding:5px 7px}
}

header strong{display:flex;align-items:center;gap:7px}
header strong img{width:24px;height:24px;object-fit:contain}
.member-page header{border-bottom-color:var(--brand-accent,var(--border))}
.payment-address{overflow-wrap:anywhere;margin:4px 0}
canvas{max-width:100%;height:auto}
.panel code{overflow-wrap:anywhere}

:root{--nav-width:208px}
.side-nav,.workspace-tabs{display:none}
.staff-workspace{grid-template-rows:auto auto auto 1fr;padding-left:var(--nav-width)}
.staff-workspace header{position:sticky;top:0;z-index:10;min-height:45px}
.staff-workspace.sidebar-collapsed{--nav-width:46px}
.staff-workspace .side-nav{display:block;position:fixed;inset:0 auto 0 0;width:var(--nav-width);overflow:auto;background:#142332;border-right:1px solid var(--border);padding:9px;z-index:12}
.nav-group{display:grid;gap:2px;margin-bottom:14px}
.nav-group h2{font-size:11px;color:#a8bed0;margin:4px 5px}
.nav-group button{text-align:left;font-size:13px;padding:5px 7px;background:transparent;border-color:transparent}
.nav-group button:hover,.nav-group button.selected{background:#29455c}
.nav-children{display:grid;padding-left:10px}
.sidebar-collapsed .nav-group h2{display:none}
.sidebar-collapsed .nav-group>button{overflow:hidden;white-space:nowrap;width:26px}
.staff-workspace .workspace-tabs{display:flex;gap:4px;overflow-x:auto;overscroll-behavior-x:contain;position:sticky;top:45px;z-index:9;background:#142332;padding:4px 8px;border-bottom:1px solid var(--border);min-height:34px}
.workspace-tab{display:flex;flex:none;border:1px solid transparent;border-radius:4px}
.workspace-tab.selected{background:#29455c;border-color:#547487}
.workspace-tab button{white-space:nowrap;background:transparent;border:0;padding:3px 6px}
.staff-workspace .panel{padding:9px}
.staff-workspace td,.staff-workspace th{padding:4px 7px}
.staff-workspace main button{width:auto;justify-self:start;padding:4px 8px}
.staff-workspace .queue button{width:100%}
.staff-workspace button.column-sort{background:none;border:none;padding:0;text-align:left}
.data-table{min-width:0;display:grid;gap:5px}
.data-table .table{max-width:100%}
.data-table input{padding:4px 7px}
.editor-overlay{position:fixed;inset:0;z-index:20}
.editor-scrim{position:absolute;inset:0;background:#080e16a6}
.editor-drawer{position:absolute;right:0;top:0;bottom:0;width:min(460px,100%);background:var(--panel);border-left:1px solid var(--border);padding:13px;overflow:auto}
.editor-drawer>.panel{border:0}
.editor-drawer .form-actions{position:sticky;bottom:0;justify-content:flex-end;background:var(--panel);border-top:1px solid var(--border);padding:9px 0}
.invalid{color:#ffadad}
.toasts{position:fixed;top:12px;right:12px;z-index:40;width:min(340px,calc(100vw - 24px));display:grid;gap:6px;pointer-events:none}
.toast{pointer-events:auto;display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid #46765e;border-radius:7px;padding:7px 10px;background:#233f35;color:#dcf5e6;box-shadow:0 3px 12px #0003}
.toast.error{background:#522e35;color:#ffe3e5;border-color:#a76069}
.toast button{background:transparent;color:inherit;border:0;padding:0 4px}
.confirm-dialog{max-width:min(410px,calc(100vw - 24px));border:1px solid #547487;border-radius:8px;background:#203449;color:#e1ebf4;padding:14px}
.confirm-dialog::backdrop{background:#080e16ae}
.confirm-dialog .bar{justify-content:flex-end}
@media(max-width:760px){
  .staff-workspace,.staff-workspace.sidebar-collapsed{padding-left:0;--nav-width:min(250px,80vw)}
  .staff-workspace .side-nav{display:none;top:45px;box-shadow:8px 0 20px #0007}
  .staff-workspace.mobile-nav-open .side-nav{display:block}
  .staff-workspace .nav-group h2{display:block}
  .staff-workspace .nav-group>button{width:auto}
}

.workspace-brand{display:grid;gap:2px;padding:5px 5px 10px;margin-bottom:10px;border-bottom:1px solid var(--border);overflow:hidden;white-space:nowrap}
.workspace-brand strong{font-size:16px}
.workspace-brand small{font-size:10px;letter-spacing:.05em}
.workspace-brand .brand-pending{color:#a7b1b9;letter-spacing:0}
.sidebar-collapsed .workspace-brand{display:none}
.recharge-page,.recharge-page .panel,.recharge-page .data-table{width:100%;max-width:none}
.recharge-page .table table{width:100%;min-width:790px}
.recharge-page th,.recharge-page td{white-space:nowrap;overflow-wrap:normal}
.order-number{display:inline-flex;align-items:center;gap:5px;max-width:185px}
.order-number span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.money{display:block;text-align:right;font-variant-numeric:tabular-nums}
.member-page{background:#eae4d9;color:#312b25;--border:#cfc4b5;--panel:#f4efe6;--ice:#28556b}
.member-page header,.member-page .order-area{background:#e8dfd0}
.member-page .chat-area{background:#eee7db}
.member-page button,.member-page input,.member-page select,.member-page textarea{background:#f6f0e7}
.member-page .bubble{background:#e6dbca;color:#312b25}
.member-page .member-message .bubble{background:#dce5e3;color:#263534}
