:root{color-scheme:light;--brand:#235bd4;--ink:#16253e;--muted:#546580;--line:#dce5f2;--surface:#fff;--page:#f2f6fc;font-family:system-ui,"PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--page)}
*{box-sizing:border-box}body{margin:0}a{color:var(--brand);text-decoration:none}a:hover{text-decoration:underline}button,input,select,textarea{font:inherit}button{cursor:pointer;border:1px solid var(--line);background:white;color:var(--ink);border-radius:8px;padding:8px 13px;white-space:nowrap}button:hover{border-color:var(--brand);color:var(--brand)}button:disabled{opacity:.55;cursor:default}.primary,.primary:hover{background:var(--brand);color:white;border-color:var(--brand)}input,textarea,select{min-width:0;border:1px solid #bdcbe0;border-radius:8px;padding:10px 12px;width:100%;color:var(--ink);background:white}input[type=checkbox]{width:auto}h1,h2,h3,p{margin:0 0 12px}h1{font-size:28px}h2{font-size:20px}small,.muted{color:var(--muted)}[hidden]{display:none!important}label{display:grid;gap:7px;font-size:14px;font-weight:600}form{display:grid;gap:14px}.top{height:66px;padding:0 clamp(16px,4vw,55px);display:flex;align-items:center;justify-content:space-between;background:#fff;border-bottom:1px solid var(--line);gap:12px}.brand{color:var(--ink);display:flex;gap:9px;align-items:center;font-weight:750;white-space:nowrap}.brand-logo{width:40px;height:40px;object-fit:contain;border-radius:9px}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.row>input{flex:1;width:auto}.grow{flex:1}.stack{display:grid;gap:14px}.portal{max-width:490px;margin:30px auto;padding:0 16px}.hero{border-radius:20px;background:linear-gradient(135deg,#2461df,#153c99);color:white;padding:28px;margin-bottom:16px}.hero p{color:#e9f0ff;margin:0}.card{background:white;border:1px solid var(--line);border-radius:15px;padding:20px}.desk{display:grid;grid-template-columns:218px minmax(0,1fr);min-height:calc(100vh - 66px)}.side{background:#10264c;color:white;padding:24px 16px;display:flex;gap:8px;flex-direction:column}.side h2{padding:0 8px 12px}.side button{text-align:left;background:transparent;color:#d9e5fa;border-color:transparent}.side button:hover,.side button.active{background:#234775;color:white}.workspace{padding:clamp(16px,3vw,38px);min-width:0}.head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:16px;flex-wrap:wrap}.head h1{margin:0}.table-wrap{overflow:auto;background:white;border:1px solid var(--line);border-radius:12px}table{border-collapse:collapse;width:100%;text-align:left;font-size:14px}th,td{padding:12px;border-bottom:1px solid var(--line);vertical-align:middle}th{color:var(--muted);background:#f8faff;white-space:nowrap}td .row{min-width:130px}tr:last-child td{border-bottom:0}.pager{justify-content:flex-end;margin-top:12px}.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:12px}.metric strong{display:block;font-size:29px;margin-top:8px}.chat{display:grid;gap:10px}.messages{height:min(54vh,520px);overflow:auto;background:#eaf0f9;border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:10px}.message{background:white;padding:8px 12px;border-radius:10px;max-width:82%;align-self:flex-start;white-space:pre-wrap;overflow-wrap:anywhere}.message.mine{align-self:flex-end;background:#d7e6ff}.message small{display:block;margin-bottom:3px}.message img{max-width:100%;max-height:210px}.composer{display:flex;gap:8px}.composer input{flex:1}.warning{color:#8c410a;background:#fff2d9;border-radius:8px;padding:9px 12px}#notice{position:fixed;z-index:5;right:16px;top:77px;max-width:min(420px,calc(100vw - 32px));border:1px solid #b9d1f7;background:#fff;box-shadow:0 8px 26px #152d5022;border-radius:10px;padding:12px 16px}dialog{max-width:min(460px,calc(100vw - 24px));width:100%;border:1px solid var(--line);border-radius:14px;padding:22px;color:var(--ink)}dialog::backdrop{background:#0b1d3e77}dialog .row{justify-content:flex-end}pre{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:700px){.desk{display:block}.side{flex-direction:row;overflow:auto;padding:10px}.side h2{display:none}.side button{flex:none}.top{height:56px}#notice{top:65px}.portal{margin:18px auto}.card{padding:16px}.composer{gap:5px}}

.login-page {
  display: grid;
  place-items: start center;
  padding: clamp(28px, 8vh, 88px) 16px 36px;
}
.login-page .card {
  width: min(100%, 420px);
  padding: clamp(22px, 5vw, 36px);
  box-shadow: 0 12px 36px #162c5214;
}
.login-brand {
  text-align: center;
  margin-bottom: 24px;
}
.login-brand h1 {
  margin-bottom: 4px;
}
.login-brand p {
  margin: 0;
}
.login-logo {
  display: block;
  width: 136px;
  height: 136px;
  max-width: 100%;
  object-fit: contain;
  margin: 0 auto 10px;
  border-radius: 16px;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(100px, 1fr);
  gap: 10px;
  align-items: end;
}
.captcha-refresh {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 3px 5px;
  min-height: 44px;
  font-size: 12px;
  color: var(--muted);
}
.captcha-image {
  display: block;
  width: min(100%, 154px);
  height: auto;
}

.invite-landing {
  min-height: calc(100vh - 66px);
  padding: clamp(42px, 11svh, 110px) clamp(18px, 6vw, 32px) 36px;
  background:
    radial-gradient(ellipse at 28% 0%, #e1eeff 0%, transparent 58%),
    radial-gradient(ellipse at 100% 76%, #e3f6f0 0%, transparent 54%),
    linear-gradient(180deg, #f6f9ff 0%, #fbfcfe 100%);
}
body:has(.invite-landing) > .top {
  display: none;
}
body:has(.invite-landing) .invite-landing {
  min-height: 100vh;
  min-height: 100svh;
}
.invite-content {
  max-width: 400px;
  margin-inline: auto;
}
.invite-brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: clamp(22px, 5svh, 36px);
}
.invite-logo {
  width: clamp(104px, 31vw, 136px);
  height: auto;
  display: block;
  border-radius: 28px;
  box-shadow: 0 8px 28px #17467a13;
}
.invite-brand h1 {
  margin: 0;
  color: #163451;
  font-size: clamp(28px, 7vw, 34px);
  letter-spacing: .11em;
}
.invite-content .card {
  border-radius: 22px;
  padding: clamp(18px, 5vw, 26px);
  box-shadow: 0 14px 42px #16345110;
}
.invite-content form {
  gap: 16px;
}
.invite-content input,
.invite-content .primary {
  min-height: 52px;
  border-radius: 12px;
  font-size: 16px;
}
.invite-content input {
  background: #f8fbff;
}
.invite-content .primary {
  font-weight: 650;
}
.invite-content :is(input, button, a):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
.apply-hint {
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.apply-hint a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-weight: 650;
}
.application-actions {
  margin-top: 16px;
  justify-content: space-between;
}

.password-panel {
  max-width: 460px;
}

.current-nickname {
  overflow-wrap: anywhere;
}

.composer {
  position: relative;
  align-items: stretch;
}
.composer > input {
  flex: 1 1 0;
  min-width: 0;
}
.composer-icon {
  width: 44px;
  padding: 0;
  font-size: 21px;
  line-height: 1;
}
.composer-menu {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  gap: 6px;
  max-width: 100%;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px #16253e25;
}
.emoji-menu {
  width: min(100%, 365px);
  gap: 8px;
  padding: 10px;
}
.expression-tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
}
.expression-tabs button {
  flex: none;
  padding: 6px 9px;
  border-color: transparent;
  font-size: 13px;
}
.expression-tabs button[aria-pressed='true'] {
  color: var(--brand);
  background: #edf4ff;
}
.expression-grid {
  display: grid;
  grid-template-columns: repeat(7,minmax(0,1fr));
  align-content: start;
  gap: 4px;
  max-height: min(226px, 35vh);
  min-height: 53px;
  overflow-y: auto;
  padding: 2px;
}
.expression-grid button {
  min-width: 0;
  padding: 3px;
  border-color: transparent;
  font-size: 22px;
  line-height: 1.35;
  background: #f7faff;
}
.expression-grid .sticker-option {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.sticker-option img {
  width: 100%;
  height: auto;
  display: block;
}
.sticker-grid {
  grid-template-columns: repeat(4,minmax(0,1fr));
}
.expression-empty {
  grid-column: 1 / -1;
  margin: 10px 4px;
  font-size: 13px;
}
.message .chat-sticker {
  display: block;
  width: 104px;
  height: 104px;
  object-fit: contain;
}
.message button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}

.invite-tab-active {
  border-color: var(--brand);
  background: #edf4ff;
  color: var(--brand);
}

.side .agent-workbench {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.agent-unread-badge {
  display: inline-grid;
  min-width: 20px;
  min-height: 20px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: #bf2238;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.unread-cell {
  color: #b51f35;
  font-weight: 700;
}
.conversation-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 164px), 1fr));
  align-items: end;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.conversation-filters label {
  min-width: 0;
}
.conversation-filters .filter-actions {
  min-height: 42px;
}

.customer-total-card {
  container-type: inline-size;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.customer-total-card .metric {
  min-width: 0;
  overflow-wrap: anywhere;
}
.customer-additions {
  display: grid;
  flex: none;
  gap: 6px;
  margin: 0;
  padding-inline-start: 12px;
  border-inline-start: 1px solid var(--line);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.customer-additions > div {
  display: grid;
  grid-template-columns: auto minmax(3ch, auto);
  gap: 10px;
  text-align: right;
}
.customer-additions dt {
  color: var(--muted);
}
.customer-additions dd {
  margin: 0;
  font-weight: 650;
}
@container (max-width: 185px) {
  .customer-total-card .metric {
    font-size: 13px;
  }
  .customer-additions {
    padding-inline-start: 7px;
    font-size: 12px;
  }
  .customer-additions > div {
    grid-template-columns: auto minmax(1ch, auto);
    gap: 5px;
  }
}

.branch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-color: transparent;
  color: var(--brand);
  font-weight: 650;
}
.branch-toggle::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: none;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);
}
.branch-toggle[aria-expanded='true']::before {
  transform: rotate(45deg);
}
.table-branch > td {
  padding: 12px 16px 16px 28px;
  background: #f8faff;
}
.enterprise-agent-branch {
  padding-inline-start: 14px;
  border-inline-start: 2px solid #c3d5f2;
}
.enterprise-agent-branch > p {
  margin: 0;
}
