:root {
  color-scheme:light;
  --blue:#1769ed;
  --blue-dark:#1057c8;
  --blue-soft:#eaf2ff;
  --ink:#17233b;
  --muted:#69788e;
  --line:#e5ebf3;
  --canvas:#f4f7fb;
  --surface:#fff;
  --green:#208458;
  --orange:#a86817;
  --danger:#c0393f;
  --radius:16px;
  font-family:"PingFang SC","Microsoft YaHei",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:14px;
  font-synthesis:none
}
* {
  box-sizing:border-box
}
body {
  margin:0;
  color:var(--ink);
  background:var(--canvas);
  line-height:1.6
}
button,input,textarea {
  font:inherit
}
button,a,input,textarea {
  -webkit-tap-highlight-color:transparent
}
button {
  cursor:pointer
}
button,a {
  touch-action:manipulation
}
button:disabled {
  cursor:wait;
  opacity:.55
}
a {
  color:var(--blue);
  text-decoration:none
}
button {
  border:0
}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,[tabindex]:focus-visible {
  outline:3px solid #76aaff;
  outline-offset:3px
}
h1,h2,h3,p {
  margin:0
}
h1,h2,h3 {
  line-height:1.4
}
h2 {
  font-size:18px
}
h3 {
  font-size:15px
}
[hidden] {
  display:none!important
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0
}
.preview-banner {
  min-height:32px;
  background:#fff2d7;
  color:#805a1f;
  text-align:center;
  font-size:12px;
  padding:5px 12px;
  display:flex;
  gap:16px;
  align-items:center;
  justify-content:center;
  border-bottom:1px solid #f1e3c9
}
.preview-banner a {
  color:#675023;
  text-decoration:underline;
  text-underline-offset:3px
}
.brand {
  display:flex;
  align-items:center;
  gap:11px;
  color:var(--ink);
  font-weight:750;
  font-size:21px;
  letter-spacing:1px;
  flex-shrink:0
}
.brand-mark {
  display:grid;
  place-items:center;
  width:43px;
  height:43px;
  border-radius:13px;
  background:linear-gradient(140deg,#1874f5,#1cb7c5);
  font-style:italic;
  font-weight:900;
  font-size:28px;
  letter-spacing:-2px;
  color:#fff;
  box-shadow:0 4px 9px #1769ed1a
}
.brand-sub {
  display:block;
  font-size:10px;
  font-weight:500;
  color:var(--muted);
  letter-spacing:2px;
  margin-top:-2px
}
.eyebrow {
  font-size:11px;
  color:var(--blue);
  font-weight:650;
  letter-spacing:2px
}
.primary-button,.secondary-button {
  border-radius:9px;
  min-height:44px;
  padding:10px 20px;
  font-weight:600;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:13px;
  transition:background 150ms,box-shadow 150ms
}
.primary-button {
  background:var(--blue);
  color:#fff;
  box-shadow:0 4px 10px #1769ed16
}
.primary-button:hover:not(:disabled) {
  background:var(--blue-dark);
  box-shadow:0 5px 14px #1769ed28
}
.primary-button:active:not(:disabled),.secondary-button:active:not(:disabled) {
  transform:translateY(1px)
}
.secondary-button {
  background:#f4f7fc;
  border:1px solid var(--line);
  color:#344963
}
.secondary-button:hover:not(:disabled) {
  background:#eaf1fc
}
.text-button {
  background:none;
  padding:8px;
  color:var(--muted);
  min-height:44px;
  font-size:13px;
  white-space:nowrap
}
.text-button:hover {
  color:var(--blue);
  background:#f4f7fc;
  border-radius:7px
}
.full-width {
  width:100%
}
.muted {
  color:var(--muted)
}
.small-badge {
  display:inline-flex;
  color:var(--blue);
  background:var(--blue-soft);
  border-radius:6px;
  padding:4px 9px;
  font-size:11px;
  letter-spacing:1px
}
.field {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:18px;
  min-width:0
}
.field label,.topic-fieldset legend {
  font-weight:600;
  font-size:13px
}
.field label span {
  font-weight:400;
  color:#8a95a5;
  font-size:12px;
  margin-left:3px
}
input,textarea {
  width:100%;
  min-width:0;
  border:1px solid #e0e7f0;
  border-radius:9px;
  background:#f7f9fc;
  color:var(--ink);
  padding:11px 12px;
  outline:none;
  transition:border 150ms,box-shadow 150ms
}
input {
  min-height:44px
}
input::placeholder,textarea::placeholder {
  color:#8d98a9;
  font-weight:400
}
input:focus,textarea:focus {
  border-color:#77a8f1;
  background:#fff;
  box-shadow:0 0 0 3px #1769ed0c
}
textarea {
  resize:vertical;
  min-height:80px;
  max-height:220px;
  line-height:1.65
}
.field-note {
  font-size:11px;
  color:var(--muted)
}
.form-row {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px
}
.form-row .field {
  margin-bottom:6px
}
.form-row+.field-note {
  margin:0 0 18px
}
.order-fieldset {
  border:0;
  margin:0 0 18px;
  padding:0;
  min-width:0
}
.order-fieldset>legend {
  padding:0;
  margin-bottom:8px;
  font-size:13px;
  font-weight:600
}
.order-fieldset>legend>span {
  color:var(--muted);
  font-size:12px;
  font-weight:400;
  margin-left:5px
}
.order-entry-actions {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:4px 8px
}
.order-entry-actions>.secondary-button {
  flex:1 1 120px;
  justify-content:space-between;
  color:var(--blue);
  background:#f1f6ff;
  border-color:#dce8fb
}
.order-entry-actions>.text-button {
  font-size:12px
}
.order-fieldset>.field-note {
  margin-top:8px
}
.order-refresh-note {
  color:var(--blue)
}
.order-selection {
  border:1px solid #dce8fb;
  border-radius:10px;
  padding:12px;
  background:#f5f9ff;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:4px 10px
}
.order-selection-copy {
  display:flex;
  flex-direction:column;
  gap:3px;
  flex:1 1 180px;
  min-width:0
}
.order-selection-label {
  color:var(--blue);
  font-size:11px
}
.order-selection-copy>strong {
  font-size:13px;
  line-height:1.6;
  font-weight:600;
  overflow-wrap:anywhere
}
.order-selection-copy>span:last-child {
  font-size:11px;
  color:var(--muted);
  overflow-wrap:anywhere
}
.order-selection-actions {
  display:flex;
  margin-left:auto;
  flex-shrink:0
}
.order-selection-actions .text-button {
  min-width:44px;
  color:var(--blue);
  font-size:12px
}
.order-validation-note {
  flex-basis:100%;
  font-size:12px;
  line-height:1.7;
  color:var(--muted)
}
.order-selection>#order-validation-retry {
  font-size:12px;
  flex-basis:100%;
  margin-top:4px
}
.order-picker {
  margin-top:10px;
  border:1px solid #dce6f4;
  border-radius:11px;
  padding:12px;
  background:#fafcff
}
.order-picker-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px
}
.order-picker-heading h3 {
  font-size:14px
}
.order-picker-heading .text-button {
  font-size:12px;
  margin-right:-6px
}
.order-source-note,.order-picker-status {
  font-size:12px;
  line-height:1.7;
  color:var(--muted)
}
.order-source-note {
  margin:1px 0 10px
}
.order-picker-status {
  border:1px solid var(--line);
  background:#f1f5fb;
  border-radius:8px;
  padding:12px;
  margin:8px 0
}
.order-picker-loading {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:72px;
  color:var(--muted);
  font-size:12px
}
.order-picker-loading .loading-ring {
  width:19px;
  height:19px
}
.order-picker-list {
  list-style:none;
  padding:3px;
  margin:0 -3px;
  max-height:320px;
  overflow:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin
}
.order-picker-list>li+li {
  margin-top:7px
}
.order-choice {
  display:flex;
  flex-direction:column;
  gap:4px;
  width:100%;
  min-height:72px;
  padding:11px 12px;
  text-align:left;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
  color:var(--ink);
  transition:background 150ms,border-color 150ms
}
.order-choice:hover,.order-choice[aria-pressed="true"] {
  border-color:#80acef;
  background:#f0f6ff
}
.order-choice:active {
  background:#eaf2ff
}
.order-choice-heading {
  display:flex;
  align-items:flex-start;
  flex-wrap:wrap;
  gap:5px 10px;
  width:100%
}
.order-choice-heading>strong {
  font-size:13px;
  line-height:1.65;
  font-weight:600;
  flex:1 1 150px;
  overflow-wrap:anywhere
}
.order-choice-status {
  color:#556d8a;
  background:#eef3fa;
  padding:2px 6px;
  border-radius:4px;
  font-size:11px;
  max-width:100%;
  overflow-wrap:anywhere
}
.order-choice-reference,.order-choice-date {
  font-size:11px;
  color:var(--muted);
  overflow-wrap:anywhere;
  max-width:100%
}
.order-picker-controls {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:4px 6px;
  margin-top:8px
}
.order-picker-controls .secondary-button {
  flex:1 1 100%;
  font-size:12px
}
.order-picker-controls .text-button {
  font-size:12px
}
.order-manual-field {
  margin:0
}
.order-manual-field>.text-button {
  align-self:flex-start;
  padding-left:0;
  font-size:12px
}
.text-counter {
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:10px;
  color:#8591a3
}
.text-counter span:last-child {
  white-space:nowrap
}
.form-error {
  background:#fff0f0;
  color:var(--danger);
  padding:9px 11px;
  border-radius:7px;
  font-size:12px;
  margin:0 0 12px;
  overflow-wrap:anywhere
}
.network-notice {
  padding:9px 16px;
  color:#855d23;
  background:#fff5e4;
  border-bottom:1px solid #f2e7d3;
  font-size:12px
}
.presence {
  display:flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  color:var(--muted)
}
.presence-dot {
  display:inline-block;
  height:7px;
  width:7px;
  background:#a3aebb;
  border-radius:50%;
  flex-shrink:0
}
.is-online .presence-dot {
  background:#29a46c;
  box-shadow:0 0 0 3px #29a46c13
}
.is-online {
  color:var(--green)
}
.status-badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  line-height:1.6;
  padding:3px 9px;
  border-radius:5px;
  background:#edf2f8;
  color:#62748a;
  white-space:nowrap
}
.status-badge.waiting {
  background:#fff0d8;
  color:#966117
}
.status-badge.active {
  background:#eaf3ff;
  color:#2b6dbd
}
.status-badge.resolved {
  background:#eaf5ef;
  color:#337551
}
.loading-state,.initial-error,.admin-loading {
  display:flex;
  flex-direction:column;
  gap:16px;
  align-items:center;
  justify-content:center;
  min-height:300px;
  color:var(--muted);
  padding:24px;
  text-align:center
}
.loading-ring {
  display:block;
  width:25px;
  height:25px;
  border:2px solid #dce6f4;
  border-top-color:var(--blue);
  border-radius:50%;
  animation:spin .9s linear infinite
}
@keyframes spin {
  to {
    transform:rotate(360deg)
  }
}
/* 顾客端 */
.customer-page {
  background:radial-gradient(ellipse at 12% 12%,#e9f2ff 0,transparent 48%),#f4f7fb
}
.customer-layout {
  width:min(1030px,100% - 48px);
  margin:clamp(24px,5vh,56px) auto;
  display:grid;
  grid-template-columns:minmax(250px,1fr) minmax(430px,560px);
  gap:clamp(30px,5vw,76px);
  align-items:stretch
}
.customer-intro {
  display:flex;
  flex-direction:column;
  padding:18px 0;
  min-width:0
}
.intro-body {
  padding-top:84px
}
.intro-body h1 {
  font-size:clamp(31px,3.1vw,42px);
  letter-spacing:-1px;
  line-height:1.4;
  margin:17px 0 21px;
  font-weight:700
}
.intro-body>p {
  color:var(--muted);
  font-size:14px;
  line-height:1.9
}
.intro-points {
  margin:32px 0;
  display:grid;
  gap:15px;
  color:#51627b;
  font-size:12px
}
.intro-points>span {
  display:flex;
  align-items:center;
  gap:10px
}
.intro-points i {
  font-style:normal;
  color:var(--blue);
  display:grid;
  place-items:center;
  width:20px;
  height:20px;
  border-radius:6px;
  background:#e0ecff
}
.privacy-note {
  font-size:11px;
  line-height:1.8;
  color:#8a97aa;
  margin-top:auto;
  padding-top:60px
}
.customer-card {
  border:1px solid #e5ecf5;
  background:#fff;
  border-radius:20px;
  box-shadow:0 18px 55px #2546760b;
  overflow:hidden;
  min-width:0;
  display:flex;
  flex-direction:column
}
.customer-header {
  padding:20px 24px;
  display:flex;
  align-items:center;
  gap:12px;
  border-bottom:1px solid var(--line);
  flex-shrink:0
}
.service-avatar {
  background:#eaf2ff;
  color:var(--blue);
  height:42px;
  width:42px;
  border-radius:12px;
  font-size:16px;
  display:grid;
  place-items:center;
  font-weight:650;
  flex-shrink:0
}
.customer-header h2 {
  font-size:15px;
  margin-bottom:4px
}
.history-button {
  margin-left:auto;
  font-size:12px;
  padding-right:0
}
.welcome-panel {
  padding:24px 28px
}
.welcome-copy {
  margin-bottom:23px
}
.welcome-copy h2 {
  font-size:23px;
  margin:12px 0 7px
}
.welcome-copy p {
  font-size:12px;
  color:var(--muted)
}
.topic-fieldset {
  border:0;
  padding:0;
  margin:0 0 23px;
  min-width:0
}
.topic-options {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:7px;
  margin-top:10px
}
.topic-options label {
  position:relative;
  cursor:pointer
}
.topic-options input {
  position:absolute;
  opacity:0;
  width:1px;
  min-height:1px;
  height:1px
}
.topic-options span {
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px 4px;
  min-height:42px;
  border-radius:8px;
  border:1px solid var(--line);
  color:#66758b;
  background:#fafbfd;
  font-size:12px;
  white-space:nowrap
}
.topic-options input:checked+span {
  color:var(--blue);
  background:var(--blue-soft);
  border-color:#9ec2fc;
  font-weight:600
}
.topic-options input:focus-visible+span {
  outline:3px solid #77a8f1;
  outline-offset:3px
}
.browser-note {
  color:#8490a2;
  font-size:10px;
  text-align:center;
  line-height:1.8;
  margin:14px 0 0
}
.customer-history {
  background:#f8faff;
  border-bottom:1px solid var(--line);
  padding:12px 20px 18px;
  max-height:300px;
  overflow:auto
}
.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between
}
.section-heading h3 {
  font-size:13px
}
.customer-history .conversation-item {
  border:1px solid #e9edf5;
  border-radius:9px;
  margin-bottom:7px;
  background:#fff
}
.customer-history .secondary-button {
  font-size:12px;
  min-height:40px
}
.customer-chat {
  height:650px;
  max-height:calc(100dvh - 200px);
  min-height:450px;
  display:flex;
  flex-direction:column;
  position:relative
}
.conversation-strip {
  padding:12px 24px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  border-bottom:1px solid #edf1f7;
  color:#53647c
}
.chat-context {
  padding:8px 24px;
  font-size:10px;
  color:#8491a3;
  background:#fafbfd;
  overflow-wrap:anywhere
}
.customer-offline-note {
  font-size:11px;
  text-align:center;
  color:#846c43;
  background:#fff8eb;
  border-top:1px solid #f3e9d6;
  padding:8px 12px
}
.chat-privacy {
  text-align:center;
  font-size:9px;
  color:#8d99a9;
  background:#fff;
  padding:5px 10px 10px
}
.message-list {
  flex:1;
  min-height:0;
  overflow:auto;
  overscroll-behavior:contain;
  padding:22px 22px 16px;
  background:#f8faff;
  scrollbar-width:thin;
  scrollbar-color:#cbd5e3 transparent
}
.message-group {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  max-width:100%;
  margin-bottom:18px
}
.message-group.own {
  align-items:flex-end
}
.message-meta {
  font-size:10px;
  color:#8895a8;
  margin-bottom:5px;
  display:flex;
  gap:9px
}
.message-bubble {
  background:#fff;
  border:1px solid #e6edf6;
  border-radius:0 12px 12px 12px;
  padding:10px 13px;
  max-width:88%;
  font-size:13px;
  line-height:1.75;
  color:#35465f;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word
}
.own .message-bubble {
  background:#e8f1ff;
  color:#224e8f;
  border-color:#d7e6fc;
  border-radius:12px 0 12px 12px
}
.message-day {
  text-align:center;
  color:#93a0b2;
  font-size:10px;
  margin-bottom:20px
}
.message-empty {
  color:#8a96a8;
  text-align:center;
  font-size:12px;
  margin:30px 0
}
.composer {
  padding:12px 18px 10px;
  background:#fff;
  border-top:1px solid var(--line);
  flex-shrink:0
}
.composer textarea {
  display:block;
  background:#f6f8fc;
  border:1px solid #e6ebf2;
  min-height:68px;
  max-height:150px;
  resize:vertical;
  font-size:14px
}
.composer-actions {
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:9px
}
.composer .primary-button {
  min-height:38px;
  padding:7px 16px;
  font-size:12px;
  flex-shrink:0;
  margin-left:auto
}
.composer-hint {
  font-size:9px;
  color:#99a3b1
}
.message-count {
  font-size:10px;
  color:#8b96a5;
  white-space:nowrap;
  margin-left:auto
}
.composer .form-error {
  margin:8px 0 0
}
.new-message-button {
  position:absolute;
  bottom:163px;
  left:50%;
  transform:translateX(-50%);
  z-index:3;
  color:var(--blue);
  background:#fff;
  border:1px solid #d4e3fc;
  border-radius:20px;
  padding:8px 14px;
  font-size:11px;
  white-space:nowrap;
  box-shadow:0 4px 16px #3c62951a;
  min-height:36px
}
/* 客服登录 */
.login-layout {
  display:grid;
  grid-template-columns:1fr 1fr;
  max-width:1020px;
  min-height:640px;
  margin:clamp(30px,9vh,90px) auto;
  border:1px solid #e3eaf4;
  border-radius:22px;
  background:#fff;
  overflow:hidden;
  box-shadow:0 16px 60px #294e7b09
}
.login-story {
  background:linear-gradient(145deg,#edf4ff,#f2f9fc);
  padding:40px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:50px
}
.login-story h1 {
  font-size:32px;
  margin:17px 0 22px;
  line-height:1.5;
  letter-spacing:-.5px
}
.login-story p {
  color:#718198;
  font-size:13px;
  line-height:1.9
}
.story-foot {
  font-size:11px;
  color:#93a3b9;
  letter-spacing:1px
}
.login-card {
  padding:55px 52px;
  align-self:center
}
.login-card h2 {
  font-size:27px;
  margin:14px 0 5px
}
.login-card>.muted {
  font-size:13px;
  margin-bottom:29px
}
.demo-login {
  border-top:1px solid var(--line);
  margin-top:25px;
  padding-top:20px
}
.demo-login>span {
  font-size:12px;
  font-weight:600
}
.demo-login p {
  font-size:11px;
  line-height:1.8;
  color:var(--muted);
  margin:5px 0 12px
}
.demo-login button {
  min-height:40px;
  font-size:12px
}
.login-footnote {
  font-size:11px;
  color:#8c98a9;
  text-align:center;
  margin-top:24px
}
.admin-loading {
  height:calc(100dvh - 32px)
}
/* 客服工作台 */
.workspace {
  height:100dvh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:#fff
}
.preview-banner:not([hidden])~.workspace {
  height:calc(100dvh - 32px)
}
.workspace-header {
  height:79px;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 28px;
  border-bottom:1px solid var(--line);
  gap:18px
}
.workspace-header .brand {
  font-size:20px
}
.workspace-header .brand-mark {
  width:39px;
  height:39px;
  font-size:25px;
  border-radius:11px
}
.staff-actions {
  display:flex;
  align-items:center;
  gap:18px
}
.staff-name {
  font-size:12px;
  color:#738096
}
.presence-toggle {
  border:1px solid var(--line);
  border-radius:20px;
  background:#f8fafc;
  display:flex;
  align-items:center;
  gap:8px;
  min-height:36px;
  padding:7px 12px;
  font-size:11px;
  color:#798596
}
.presence-toggle.is-online {
  color:var(--green);
  background:#f1f9f5;
  border-color:#dceee4
}
.workspace-content {
  flex:1;
  display:grid;
  grid-template-columns:290px minmax(0,1fr) 250px;
  min-height:0
}
.inbox-panel {
  display:flex;
  flex-direction:column;
  min-width:0;
  border-right:1px solid var(--line);
  background:#fff
}
.inbox-heading {
  padding:24px 22px 19px;
  display:flex;
  align-items:center;
  justify-content:space-between
}
.inbox-heading .eyebrow {
  font-size:10px;
  letter-spacing:1px
}
.inbox-heading h1 {
  font-size:21px;
  margin-top:3px
}
.inbox-total {
  font-size:11px;
  color:#8995a8;
  background:#f3f6fa;
  padding:2px 8px;
  border-radius:6px
}
.search-field {
  display:flex;
  align-items:center;
  background:#f5f7fb;
  border:1px solid #e8edf4;
  border-radius:8px;
  gap:7px;
  margin:0 18px 20px;
  padding:0 9px;
  color:#8290a5
}
.search-field>span:first-child {
  font-size:24px;
  line-height:1
}
.search-field input {
  background:none;
  border:0;
  border-radius:0;
  min-height:37px;
  padding:8px 0;
  font-size:11px;
  box-shadow:none
}
.search-field:focus-within {
  border-color:#80acef
}
.inbox-tabs {
  display:flex;
  gap:3px;
  padding:0 14px 13px;
  border-bottom:1px solid var(--line)
}
.inbox-tabs button {
  font-size:11px;
  padding:7px 7px;
  white-space:nowrap;
  background:none;
  color:#7d8a9c;
  border-radius:6px;
  min-height:35px
}
.inbox-tabs button.active {
  background:var(--blue-soft);
  color:var(--blue);
  font-weight:600
}
.inbox-tabs span {
  font-size:9px;
  margin-left:2px;
  color:inherit
}
.conversation-list {
  flex:1;
  min-height:0;
  overflow:auto;
  scrollbar-width:thin
}
.conversation-item {
  display:block;
  width:100%;
  text-align:left;
  border-bottom:1px solid #f0f3f8;
  background:#fff;
  padding:16px 20px;
  position:relative;
  transition:background 150ms
}
.conversation-item:hover {
  background:#f8faff
}
.conversation-item.selected {
  background:#f0f6ff
}
.conversation-item.selected:before {
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:3px;
  background:var(--blue)
}
.conversation-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:7px
}
.conversation-name {
  font-size:13px;
  font-weight:650;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}
.conversation-time {
  font-size:9px;
  color:#95a1b2;
  flex-shrink:0
}
.conversation-snippet {
  color:#8c98a9;
  font-size:11px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin:6px 0 10px
}
.conversation-bottom {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  font-size:10px;
  color:#7b8ca3
}
.unread-count {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:17px;
  height:17px;
  padding:0 4px;
  background:var(--blue);
  color:#fff;
  border-radius:9px;
  font-size:9px
}
.list-empty {
  text-align:center;
  padding:50px 18px;
  color:#8e9aab;
  font-size:12px
}
.list-empty strong {
  display:block;
  font-size:13px;
  color:#65778f;
  font-weight:500;
  margin-bottom:6px
}
.inbox-footer {
  padding:12px 16px;
  font-size:9px;
  text-align:center;
  color:#a0aab8;
  border-top:1px solid var(--line);
  flex-shrink:0
}
.staff-chat-panel {
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0;
  background:#f7f9fc
}
.chat-empty {
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:24px
}
.empty-icon {
  display:grid;
  place-items:center;
  width:64px;
  height:64px;
  background:#eaf1fc;
  color:#8baae0;
  border-radius:20px;
  font-size:30px;
  margin-bottom:24px
}
.chat-empty h2 {
  font-size:19px;
  font-weight:600;
  color:#53677f;
  margin-bottom:12px
}
.chat-empty p {
  font-size:12px;
  color:#91a0b2;
  line-height:1.9
}
.staff-chat {
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  position:relative
}
.chat-header {
  padding:19px 23px;
  min-height:85px;
  background:#fff;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0
}
.chat-customer-heading {
  min-width:0;
  margin-right:auto
}
.chat-customer-heading h2 {
  font-size:16px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.chat-customer-heading p {
  font-size:10px;
  color:#8a98aa;
  margin-top:3px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis
}
.resolve-button {
  min-height:33px;
  padding:5px 9px;
  font-size:10px;
  white-space:nowrap
}
.back-button {
  display:none;
  background:none;
  font-size:22px;
  color:#6c82a0;
  min-height:44px;
  min-width:36px;
  padding:0
}
.staff-chat .message-list {
  padding:27px 27px 18px;
  background:#f7f9fc
}
.staff-chat .message-bubble {
  font-size:13px;
  max-width:86%
}
.staff-chat .own .message-bubble {
  background:#e8f1ff
}
.quick-replies {
  padding:11px 20px;
  background:#fff;
  border-top:1px solid var(--line);
  font-size:10px;
  color:#8c98a9;
  display:flex;
  align-items:flex-start;
  gap:12px;
  flex-shrink:0
}
.quick-replies>span {
  white-space:nowrap;
  line-height:29px
}
.quick-replies>div {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  max-height:80px;
  overflow:auto
}
.quick-reply {
  background:#f3f6fb;
  color:#61768f;
  font-size:10px;
  padding:6px 9px;
  border-radius:5px;
  text-align:left;
  line-height:1.6;
  min-height:29px;
  max-width:205px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis
}
.quick-reply:hover {
  background:var(--blue-soft);
  color:var(--blue)
}
.staff-composer {
  border-top:1px solid #f0f3f8;
  padding:16px 21px 18px
}
.staff-composer textarea {
  background:#fff;
  border:0;
  box-shadow:none;
  padding:0;
  min-height:75px;
  max-height:180px;
  resize:vertical;
  font-size:13px
}
.staff-composer .primary-button {
  min-height:36px;
  padding:7px 16px
}
.staff-chat .new-message-button {
  bottom:229px
}
.details-panel {
  border-left:1px solid var(--line);
  overflow:auto;
  background:#fff;
  min-width:0;
  padding:26px 22px
}
.details-title h2 {
  font-size:13px;
  margin-bottom:5px
}
.details-title>span {
  color:#98a3b2;
  font-size:10px
}
.details-empty {
  font-size:11px;
  text-align:center;
  color:#9aa6b7;
  padding-top:60px
}
.customer-profile {
  margin:29px 0 26px;
  text-align:center
}
.profile-avatar {
  display:grid;
  place-items:center;
  margin:0 auto 11px;
  background:#eaf2ff;
  color:#477cc2;
  width:48px;
  height:48px;
  border-radius:15px;
  font-size:18px;
  font-weight:600
}
.customer-profile h3 {
  font-size:14px;
  overflow-wrap:anywhere
}
.customer-profile>span {
  font-size:10px;
  color:#94a0b1
}
.details-list {
  margin:0
}
.details-list dt {
  font-size:10px;
  color:#8b98aa;
  margin-top:18px
}
.details-list dd {
  margin:6px 0 0;
  font-size:12px;
  color:#516781;
  overflow-wrap:anywhere;
  white-space:pre-wrap
}
.verification-note {
  margin-top:12px;
  background:#f9f7f1;
  border:1px solid #f1ecdf;
  padding:10px;
  font-size:10px;
  border-radius:7px;
  color:#9e7e48
}
.verification-note span {
  font-size:9px;
  color:#a49882;
  line-height:1.8;
  display:inline-block;
  margin-top:3px
}
.detail-secondary {
  border-top:1px solid var(--line);
  margin-top:24px;
  padding-top:4px
}
.detail-secondary dd {
  font-size:10px;
  color:#8594a8
}
.service-tip {
  background:#f3f7fc;
  border-radius:8px;
  margin-top:30px;
  padding:12px;
  font-size:10px;
  color:#7d91ab;
  line-height:1.8
}
.service-tip>span {
  color:#5d7ba5;
  font-size:11px
}
.service-tip p {
  margin-top:5px
}
@media(min-width:1500px) {
  .workspace-content {
    grid-template-columns:320px minmax(0,1fr) 280px
  }
  .staff-chat .message-list {
    padding-right:40px;
    padding-left:40px
  }
}
@media(max-width:1100px) {
  .workspace-content {
    grid-template-columns:275px minmax(0,1fr)
  }
  .details-panel {
    display:none
  }
  .login-layout {
    margin:40px 24px
  }
  .login-card {
    padding:40px
  }
  .customer-layout {
    gap:35px;
    grid-template-columns:minmax(200px,1fr) minmax(400px,1.5fr)
  }
  .intro-body h1 {
    font-size:32px
  }
}
@media(max-width:760px) {
  .customer-layout {
    display:block;
    width:min(560px,100% - 28px);
    margin:18px auto
  }
  .customer-intro {
    display:none
  }
  .customer-card {
    border-radius:15px
  }
  .customer-header {
    padding:16px 19px
  }
  .welcome-panel {
    padding:23px
  }
  .customer-chat {
    height:calc(100dvh - 180px);
    max-height:none;
    min-height:400px
  }
  .login-layout {
    display:block;
    max-width:450px;
    min-height:0;
    margin:25px auto;
    width:calc(100% - 28px)
  }
  .login-story {
    padding:24px
  }
  .login-story>div,.story-foot {
    display:none
  }
  .login-card {
    padding:30px
  }
  .workspace-header {
    height:68px;
    padding:0 16px;
    gap:10px
  }
  .workspace-header .brand {
    font-size:16px;
    gap:8px
  }
  .workspace-header .brand-mark {
    width:33px;
    height:33px;
    font-size:21px;
    border-radius:10px
  }
  .workspace-header .brand-sub {
    font-size:9px;
    letter-spacing:1px
  }
  .staff-actions {
    gap:8px
  }
  .staff-name {
    display:none
  }
  .presence-toggle {
    padding:6px 9px;
    font-size:10px;
    min-height:34px
  }
  .staff-actions>.text-button {
    font-size:11px
  }
  .workspace-content {
    display:block;
    position:relative
  }
  .inbox-panel {
    height:100%;
    border:0
  }
  .inbox-heading {
    padding:22px 20px 18px
  }
  .inbox-heading h1 {
    font-size:22px
  }
  .inbox-tabs {
    gap:9px;
    padding:0 18px 13px
  }
  .inbox-tabs button {
    font-size:12px;
    padding:7px 11px;
    min-height:40px
  }
  .search-field {
    margin:0 20px 15px
  }
  .search-field input {
    font-size:13px;
    min-height:42px
  }
  .conversation-item {
    padding:17px 22px
  }
  .conversation-name {
    font-size:14px
  }
  .conversation-time {
    font-size:10px
  }
  .conversation-snippet {
    font-size:12px
  }
  .staff-chat-panel {
    display:none;
    height:100%
  }
  .workspace.chat-open .inbox-panel {
    display:none
  }
  .workspace.chat-open .staff-chat-panel {
    display:flex
  }
  .back-button {
    display:block
  }
  .chat-header {
    padding:12px;
    gap:8px;
    min-height:73px
  }
  .chat-customer-heading h2 {
    font-size:14px
  }
  .chat-header>.status-badge {
    font-size:9px;
    padding:3px 6px
  }
  .resolve-button {
    font-size:10px;
    padding:5px 7px;
    min-height:39px
  }
  .staff-chat .message-list {
    padding:20px 16px
  }
  .staff-composer {
    padding:12px 15px
  }
  .staff-composer textarea {
    font-size:16px;
    min-height:65px
  }
  .quick-replies {
    padding:9px 15px;
    gap:8px
  }
  .quick-reply {
    min-height:35px;
    max-width:180px;
    font-size:11px
  }
  .composer-hint {
    display:none
  }
  .composer textarea {
    font-size:16px
  }
  .composer .primary-button {
    min-height:40px
  }
  .message-count {
    margin-left:0
  }
  .staff-chat .new-message-button {
    bottom:211px
  }
  .preview-banner {
    font-size:10px;
    gap:12px
  }
}
@media(max-width:380px) {
  .customer-layout {
    width:calc(100% - 18px);
    margin:10px auto
  }
  .customer-header {
    padding:13px
  }
  .customer-header h2 {
    font-size:14px
  }
  .service-avatar {
    height:37px;
    width:37px;
    border-radius:10px
  }
  .history-button {
    font-size:11px;
    padding-left:3px
  }
  .welcome-panel {
    padding:19px 16px
  }
  .welcome-copy h2 {
    font-size:21px
  }
  .topic-options {
    gap:5px
  }
  .topic-options span {
    font-size:11px;
    padding:9px 2px
  }
  .form-row {
    grid-template-columns:1fr;
    gap:10px
  }
  .field input {
    font-size:16px
  }
  .text-counter span:first-child {
    font-size:9px
  }
  .composer {
    padding:11px 12px 9px
  }
  .message-list {
    padding:18px 13px
  }
  .conversation-strip {
    padding:10px 14px
  }
  .chat-context {
    padding:8px 14px
  }
  .customer-chat {
    height:calc(100dvh - 151px)
  }
  .preview-banner {
    gap:7px;
    font-size:9px
  }
  .workspace-header {
    padding:0 10px
  }
  .staff-actions {
    gap:2px
  }
  .workspace-header .brand {
    font-size:14px
  }
  .inbox-tabs {
    gap:2px
  }
  .inbox-tabs button {
    padding:7px 9px
  }
  .chat-header {
    gap:5px;
    padding:10px 7px
  }
  .chat-header>.status-badge {
    display:none
  }
  .login-card {
    padding:25px
  }
  .login-story {
    padding:20px
  }
}
@media(prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    animation:none!important;
    scroll-behavior:auto!important;
    transition:none!important
  }
}
@media(max-width:760px) {
  .composer .primary-button,.presence-toggle,.resolve-button,.quick-reply,.inbox-tabs button,.topic-options span {
    min-height:44px;
  }
  .back-button {
    min-width:44px;
  }
}
.details-toggle,.details-close {
  display:none
}
.workspace-content {
  position:relative
}
.details-backdrop {
  position:absolute;
  inset:0;
  background:#17233b50;
  z-index:6
}
.details-title {
  position:relative
}
@media(max-width:1100px) {
  .details-toggle,.details-close {
    display:inline-block
  }
  .details-close {
    float:right;
    margin-top:-12px;
    margin-right:-8px
  }
  .workspace.details-open .details-panel {
    display:block;
    position:absolute;
    right:0;
    top:0;
    bottom:0;
    z-index:7;
    width:min(300px,100%);
    box-shadow:-12px 0 32px #253b6522
  }
  .details-toggle {
    padding:6px;
    font-size:11px
  }
}
@media(max-width:760px) {
  .field input,.field textarea,.search-field input {
    font-size:16px
  }
  .customer-chat {
    min-height:0
  }
  .quick-replies>div {
    max-height:75px
  }
}
@media(max-width:760px) {
  .message-bubble,.staff-chat .message-bubble {
    font-size:15px;
    color:#314057
  }
  .own .message-bubble {
    color:#224e8f
  }
  .chat-context,.customer-offline-note,.chat-privacy,.browser-note,.field-note,.presence {
    font-size:12px;
    line-height:1.7
  }
  .chat-context,.chat-privacy,.browser-note,.field-note {
    color:#68778e
  }
  .message-meta {
    font-size:11px;
    color:#728199
  }
  .message-day {
    font-size:11px;
    color:#728199
  }
  .chat-privacy {
    padding-bottom:10px
  }
}
/* 短视口允许整页滚动，避免固定会话高度裁掉输入和发送区。 */
@media(max-width:760px) and (max-height:520px) {
  .customer-layout {
    margin-top:8px;
    margin-bottom:16px;
  }
  .customer-header {
    padding-top:12px;
    padding-bottom:12px;
  }
  .customer-chat {
    height:auto;
    max-height:none;
    min-height:0;
  }
  .customer-chat .message-list {
    flex:0 0 120px;
    min-height:120px;
    max-height:120px;
  }
  .customer-chat .chat-privacy {
    flex-shrink:0;
  }
}
.message-history { flex: 0 0 auto; align-self: center; min-height: 44px; padding: 8px 16px; margin: 2px 0; border: 0; border-radius: 8px; background: transparent; color: #526077; font: inherit; font-size: 13px; cursor: pointer; }
.message-history:hover { background: #f0f3f8; }
.message-history:active { transform: scale(.98); }
.message-history:focus-visible { outline: 2px solid #4263eb; outline-offset: 2px; }
.message-history:disabled { cursor: wait; opacity: .65; }
.message-history[hidden] { display: none; }
@media (prefers-color-scheme: dark) { .message-history { color: inherit; } }

/* Startup recovery is in normal page flow, above the unavailable composer. */
.startup-recovery{margin:16px 0;padding:16px;border:1px solid #cbdcf6;border-radius:12px;background:#f5f9ff;color:#22324b}
.startup-recovery h2{margin:0 0 10px;font-size:18px;line-height:1.4}
.startup-recovery .field-note{font-size:14px;line-height:1.6;color:#53647e}
.startup-recovery-preview{display:block;box-sizing:border-box;width:100%;min-height:140px;max-height:300px;padding:12px;border:1px solid #ccd7e7;border-radius:8px;background:white;color:#24364d;font-size:16px;line-height:1.6;resize:vertical}
.startup-recovery-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.startup-recovery-actions button{min-height:44px;white-space:normal}
.startup-recovery [hidden]{display:none!important}
@media(max-width:420px){.startup-recovery-actions .primary-button{width:100%}.startup-recovery{padding:14px}}
