/* 在线客服 · 员工工资卡银行柜面风格
 * 固定顶栏 + 底栏，仅中间消息区滚动
 */
html:has(body.page-support) {
  height: 100%;
  overflow: hidden;
}

.page-support {
  --cs-navy: #0b3d78;
  --cs-navy-deep: #072a54;
  --cs-blue: #1a6fd4;
  --cs-sky: #e8f3fc;
  --cs-ink: #12263f;
  --cs-muted: #6a7c93;
  --cs-line: #d9e4f0;
  --cs-agent: #ffffff;
  --cs-me: #1a6fd4;
  --cs-me-ink: #ffffff;
  --cs-shell: 430px;
  --cs-font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;

  margin: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  height: 100svh;
  max-height: 100dvh;
  max-height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--cs-font);
  color: var(--cs-ink);
  background:
    radial-gradient(1000px 520px at 50% -8%, #d7ebfb 0%, transparent 55%),
    linear-gradient(180deg, #cfe4f7 0%, #eef4fa 38%, #e8eef6 100%);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.page-support .subpage-topbar,
.page-support > .support-main {
  display: none;
}

.cs-shell {
  width: min(100%, var(--cs-shell));
  margin: 0 auto;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background:
    linear-gradient(165deg, rgba(247, 251, 255, 0.92) 0%, rgba(238, 246, 252, 0.95) 42%, rgba(230, 240, 250, 0.98) 100%);
  overflow: hidden;
}

.cs-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 36% at 88% 6%, rgba(120, 180, 230, 0.22), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400' preserveAspectRatio='none'%3E%3Cpath d='M0 220 Q200 160 400 210 T800 180 V400 H0Z' fill='rgba(26,111,212,0.05)'/%3E%3Cpath d='M0 260 Q250 200 500 250 T800 230 V400 H0Z' fill='rgba(11,61,120,0.04)'/%3E%3C/svg%3E")
      center bottom / 100% 42% no-repeat;
  z-index: 0;
}

.cs-shell > * {
  position: relative;
  z-index: 1;
}

/* 顶部固定：返回 / 名称 / 存管标签 */
.cs-chrome {
  flex-shrink: 0;
  z-index: 30;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(244, 249, 253, 0.96) 100%);
  border-bottom: 1px solid rgba(217, 228, 240, 0.95);
  box-shadow: 0 4px 16px rgba(11, 61, 120, 0.06);
  backdrop-filter: blur(10px);
}

.cs-topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 4px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 6px;
}

.cs-topbar__back,
.cs-topbar__more {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--cs-navy);
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
}

.cs-topbar__more {
  font-size: 22px;
  letter-spacing: 1px;
  font-weight: 700;
}

.cs-topbar__agent {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  justify-content: center;
}

.cs-topbar__avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1a6fd4, #0b3d78);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(11, 61, 120, 0.22);
}

.cs-topbar__meta {
  min-width: 0;
  text-align: left;
}

.cs-topbar__meta strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--cs-navy-deep);
  letter-spacing: 0.02em;
}

.cs-topbar__meta small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--cs-muted);
}

.cs-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1a9a6a;
  box-shadow: 0 0 0 2px rgba(26, 154, 106, 0.2);
}

.cs-bank-tag {
  text-align: center;
  margin: 0;
  padding: 0 16px 8px;
}
.cs-bank-tag span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(217, 228, 240, 0.85);
  font-size: 11px;
  color: var(--cs-muted);
}
.cs-bank-tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a9a6a;
  display: inline-block;
}

.cs-holiday-tag {
  text-align: center;
  margin: 0;
  padding: 0 14px 10px;
}

.cs-holiday-tag[hidden] {
  display: none !important;
}

.cs-holiday-tag span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 244, 230, 0.95), rgba(255, 236, 210, 0.92));
  border: 1px solid rgba(224, 168, 90, 0.55);
  font-size: 11px;
  color: #8a5a12;
  line-height: 1.35;
}

.cs-holiday-tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d4891a;
  box-shadow: 0 0 0 2px rgba(212, 137, 26, 0.22);
  display: inline-block;
  flex-shrink: 0;
}

.cs-holiday-tag em {
  font-style: normal;
  font-weight: 600;
}

.cs-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.cs-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 10px 14px 16px;
  scroll-behavior: smooth;
}

.cs-load-older {
  display: flex;
  justify-content: center;
  margin: 4px 0 12px;
}

.cs-load-older__btn {
  appearance: none;
  border: 1px solid rgba(217, 228, 240, 0.95);
  background: rgba(255, 255, 255, 0.92);
  color: var(--cs-navy);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 61, 120, 0.06);
}

.cs-load-older__btn:active {
  background: var(--cs-sky);
}

.cs-load-older__btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.cs-jump {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, #1a6fd4, #0b3d78);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(11, 61, 120, 0.28);
  animation: cs-jump-in 0.22s ease;
}

.cs-jump[hidden] {
  display: none !important;
}

.cs-jump__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff5a4a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.cs-jump__badge[hidden] {
  display: none !important;
}

@keyframes cs-jump-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.cs-date {
  margin: 4px auto 14px;
  padding: 3px 10px;
  width: fit-content;
  font-size: 11px;
  color: var(--cs-muted);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(217, 228, 240, 0.7);
  border-radius: 999px;
}

.cs-msgs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 92%;
  animation: cs-in 0.28s ease;
}

@keyframes cs-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cs-row--agent {
  align-self: flex-start;
}

.cs-row--me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.cs-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #1a6fd4, #0b3d78);
  box-shadow: 0 2px 6px rgba(11, 61, 120, 0.18);
}

.cs-row--me .cs-avatar {
  background: linear-gradient(145deg, #4a8fd9, #1a6fd4);
}

.cs-bubble {
  position: relative;
  padding: 11px 13px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--cs-ink);
  background: var(--cs-agent);
  border-radius: 4px 14px 14px 14px;
  border: 1px solid rgba(217, 228, 240, 0.85);
  box-shadow: 0 4px 14px rgba(11, 61, 120, 0.06);
  word-break: break-word;
  white-space: pre-wrap;
}

.cs-row--me .cs-bubble {
  background: linear-gradient(145deg, #1a6fd4, #0f5bb5);
  color: var(--cs-me-ink);
  border-color: transparent;
  border-radius: 14px 4px 14px 14px;
  box-shadow: 0 4px 14px rgba(26, 111, 212, 0.22);
}

.cs-bubble a {
  color: var(--cs-blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cs-bubble a.cs-bubble__btn {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.cs-bubble a.cs-bubble__btn--ghost {
  color: var(--cs-navy);
  background: var(--cs-sky);
  text-decoration: none;
}

.cs-row--me .cs-bubble a {
  color: #e8f3fc;
}

.cs-bubble__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.cs-bubble__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #1a6fd4, #0b3d78);
  border-radius: 10px;
  text-decoration: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 61, 120, 0.18);
}

.cs-bubble__btn--ghost {
  color: var(--cs-navy);
  background: var(--cs-sky);
  box-shadow: none;
  border: 1px solid rgba(217, 228, 240, 0.9);
}

.cs-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  min-width: 52px;
}

.cs-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aa3b5;
  animation: cs-bounce 1.2s infinite ease-in-out;
}

.cs-typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.cs-typing i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes cs-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.cs-footer {
  flex-shrink: 0;
  z-index: 30;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.97), rgba(255, 255, 255, 0.98));
  border-top: 1px solid rgba(217, 228, 240, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 -4px 16px rgba(11, 61, 120, 0.05);
}

.cs-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 8px;
  scrollbar-width: none;
}

.cs-chips::-webkit-scrollbar {
  display: none;
}

.cs-chip {
  flex-shrink: 0;
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--cs-navy);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 228, 240, 0.95);
  border-radius: 999px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(11, 61, 120, 0.05);
}

.cs-chip:active {
  background: var(--cs-sky);
  border-color: rgba(26, 111, 212, 0.35);
  color: var(--cs-blue);
}

.cs-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.cs-input {
  flex: 1;
  min-height: 40px;
  max-height: 110px;
  padding: 10px 12px;
  resize: none;
  border: 1px solid var(--cs-line);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  line-height: 1.4;
  font-family: inherit;
  color: var(--cs-ink);
  outline: none;
}

.cs-input:focus {
  border-color: rgba(26, 111, 212, 0.45);
  box-shadow: 0 0 0 3px rgba(26, 111, 212, 0.1);
}

.cs-send {
  flex-shrink: 0;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, #1a6fd4, #0b3d78);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 61, 120, 0.2);
}

.cs-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.cs-footer__note {
  margin: 8px 2px 0;
  font-size: 11px;
  color: var(--cs-muted);
  text-align: center;
  line-height: 1.45;
}

.cs-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.cs-sheet[hidden] {
  display: none !important;
}

.cs-sheet__mask {
  position: absolute;
  inset: 0;
  background: rgba(7, 42, 84, 0.42);
}

.cs-sheet__panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(100%, var(--cs-shell));
  transform: translateX(-50%);
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: #eef4fa;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 -8px 28px rgba(11, 61, 120, 0.12);
}

.cs-sheet__title {
  margin: 4px 4px 8px;
  font-size: 13px;
  color: var(--cs-muted);
  text-align: center;
}

.cs-sheet__item,
.cs-sheet__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid rgba(217, 228, 240, 0.9);
  border-radius: 12px;
  color: var(--cs-ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
}

.cs-sheet__item--muted {
  color: var(--cs-muted);
  font-weight: 500;
}
