:root {
  color-scheme: light;
  --app-bg: #f5f7fb;
  --app-text: #1f2329;
  --app-muted: #667085;
  --app-border: #e5e7eb;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--app-bg);
  caret-color: transparent;
  color: var(--app-text);
  font-family: Inter, ui-sans-serif, system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
}

html:has(.chat-provider),
body:has(.chat-provider) {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

:where(input, textarea, [contenteditable]):read-write {
  caret-color: auto;
}

.valid.modified:not([type="checkbox"]) {
  outline: 1px solid #52c41a;
}

.invalid {
  outline: 1px solid #ff4d4f;
}

.validation-message {
  color: #cf1322;
}

.blazor-error-boundary {
  padding: 12px 16px 12px 48px;
  color: #fff;
  background: #a8071a;
}

.blazor-error-boundary::after {
  content: "An error has occurred.";
}

.app-error-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: none;
  padding: 12px 20px;
  color: #5c3b00;
  background: #fff1b8;
  box-shadow: 0 -1px 4px rgb(0 0 0 / 12%);
}

.app-error-bar a {
  margin-left: 12px;
  font-weight: 600;
}

.app-error-bar .dismiss {
  position: absolute;
  top: 8px;
  right: 16px;
  cursor: pointer;
}

.chat-provider {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--chat-canvas);
  --chat-canvas: #f4f6fb;
  --chat-shell-bg: #f8fafc;
  --chat-history-bg: #ffffff;
  --chat-surface: #ffffff;
  --chat-surface-soft: #edf1f7;
  --chat-surface-strong: #e1e7f0;
  --chat-user-bubble: #e8f3ff;
  --chat-user-bubble-border: #c8e1fb;
  --chat-attachment-surface: #f3f7ff;
  --chat-attachment-border: #cdddf5;
  --chat-text: #111827;
  --chat-muted: #667085;
  --chat-subtle: #344054;
  --chat-border: rgb(17 24 39 / 12%);
  --chat-overlay: rgb(15 23 42 / 26%);
  --chat-accent: #2f66f6;
  --chat-accent-strong: #2457df;
  --chat-action-icon: #344054;
  --chat-input-gradient: linear-gradient(180deg, rgb(244 246 251 / 20%), var(--chat-canvas) 24%);
  --chat-shadow: 0 18px 45px rgb(15 23 42 / 10%);
}

.chat-shell {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--chat-text);
  background: var(--chat-shell-bg);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-shell {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  display: grid;
  gap: 22px;
  width: min(100%, 420px);
  padding: 28px;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgb(31 35 41 / 8%);
}

.login-panel h1 {
  margin: 4px 0 8px;
  font-size: 24px;
  line-height: 1.3;
}

.login-panel h1:focus {
  outline: 2px solid transparent;
}

.login-panel p {
  margin: 0;
  color: var(--app-muted);
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-input {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  color: var(--app-text);
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 6px;
}

.login-submit,
.chat-userbar button {
  padding: 8px 14px;
  color: #fff;
  font-weight: 600;
  background: #1668dc;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.chat-topbar {
  position: absolute;
  top: 18px;
  right: 0;
  left: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  padding: 0 22px;
  pointer-events: none;
}

.chat-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--chat-action-icon);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.16s ease, background 0.16s ease;
}

.chat-icon-button:hover {
  color: var(--chat-accent);
  background: color-mix(in srgb, var(--chat-surface-strong) 62%, transparent);
}

.chat-icon-button--compact {
  width: 38px;
  height: 38px;
}

.chat-icon-button svg,
.chat-icon-button img {
  width: 24px;
  height: 24px;
}

.chat-topbar .chat-icon-button svg,
.chat-topbar .chat-icon-button img {
  width: 28px;
  height: 28px;
}

.chat-icon-button--compact svg,
.chat-icon-button--compact img {
  width: 20px;
  height: 20px;
}

.chat-history-backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: var(--chat-overlay);
  border: 0;
  cursor: default;
}

.chat-history {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(78vw, 286px);
  padding: 18px 12px 14px;
  color: var(--chat-text);
  background: var(--chat-history-bg);
  border-right: 1px solid var(--chat-border);
  box-shadow: 20px 0 40px rgb(0 0 0 / 28%);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}

.chat-history--open {
  transform: translateX(0);
}

.chat-history__header,
.chat-history__brand,
.chat-history__new,
.chat-history__user {
  display: flex;
  align-items: center;
}

.chat-history__header {
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 16px;
}

.chat-history__brand {
  flex: 1;
  min-width: 0;
}

.chat-history__logo {
  display: block;
  width: 100%;
  height: auto;
}

.chat-history__new {
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  color: var(--chat-text);
  background: var(--chat-surface-soft);
  border: 1px solid var(--chat-border);
  border-radius: 999px;
  cursor: pointer;
}

.chat-history__new:hover {
  background: var(--chat-surface-strong);
}

.chat-history__list {
  display: grid;
  align-content: start;
  gap: 18px;
  flex: 1;
  min-height: 0;
  margin: 22px 0;
  overflow-y: auto;
  padding-right: 2px;
}

.chat-history__group {
  display: grid;
  gap: 6px;
}

.chat-history__group-title,
.chat-history__empty {
  color: var(--chat-muted);
  font-size: 13px;
}

.chat-history__group-title {
  padding: 0 10px 4px;
}

.chat-history__empty {
  padding: 24px 10px;
  text-align: center;
}

.chat-history-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  border-radius: 8px;
}

.chat-history-row:hover,
.chat-history-row--active,
.chat-history-row--context {
  background: var(--chat-surface-soft);
}

.chat-history-row--context {
  z-index: 73;
}

.chat-history-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 9px 10px;
  color: var(--chat-text);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  user-select: none;
}

.chat-history-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.chat-history-item small {
  overflow: hidden;
  color: var(--chat-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-history-item:focus-visible {
  outline: 2px solid var(--chat-accent);
  outline-offset: -2px;
}

.chat-session-overlay {
  position: absolute;
  inset: 0;
  z-index: 72;
  padding: 0;
  background: rgb(16 35 58 / 16%);
  border: 0;
  backdrop-filter: blur(1px);
}

.chat-session-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 74;
  display: grid;
}

.chat-session-menu__actions {
  overflow: hidden;
  background: var(--chat-surface);
  border: 1px solid var(--chat-border);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgb(15 23 42 / 18%);
}

.chat-session-menu__actions {
  padding: 6px;
}

.chat-session-menu__actions button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--chat-text);
  font: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.chat-session-menu__actions button:hover {
  background: var(--chat-surface-soft);
}

.chat-session-menu__actions .chat-session-menu__danger {
  color: #cf1322;
}

.chat-session-menu__actions svg {
  width: 20px;
  height: 20px;
}

.chat-session-overlay--dialog {
  z-index: 74;
  background: rgb(16 35 58 / 28%);
}

.chat-session-dialog {
  position: absolute;
  top: 50%;
  right: 16px;
  left: 16px;
  z-index: 75;
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--chat-surface);
  border: 1px solid var(--chat-border);
  border-radius: 16px;
  box-shadow: 0 22px 60px rgb(15 23 42 / 24%);
  transform: translateY(-50%);
}

.chat-session-dialog h2 {
  margin: 0;
}

.chat-session-dialog h2 {
  font-size: 18px;
}

.chat-session-dialog input {
  min-height: 44px;
  padding: 9px 12px;
  color: var(--chat-text);
  font: inherit;
  background: var(--chat-surface);
  border: 1px solid var(--chat-border);
  border-radius: 10px;
  outline: none;
}

.chat-session-dialog input:focus {
  border-color: var(--chat-border);
  box-shadow: none;
}

.chat-session-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.chat-session-dialog__actions button {
  min-width: 72px;
  min-height: 40px;
  padding: 8px 14px;
  color: var(--chat-text);
  font: inherit;
  background: var(--chat-surface-soft);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.chat-session-dialog__actions button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.chat-session-dialog__actions .chat-session-dialog__primary {
  color: #fff;
  background: var(--chat-accent);
}

.chat-history__user {
  position: relative;
  gap: 10px;
  padding: 12px 6px 0;
  border-top: 1px solid var(--chat-border);
}

.chat-history__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--chat-accent);
  background: var(--chat-surface-soft);
  border-radius: 50%;
}

.chat-history__user-text {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 2px;
}

.chat-history__user-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.chat-history__user-button:focus-visible {
  outline: 2px solid var(--chat-accent);
  outline-offset: 3px;
}

.chat-history__user-more {
  display: inline-flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  height: 32px;
  color: var(--chat-muted);
}

.chat-history__user-more svg {
  width: 20px;
  height: 20px;
}

.chat-user-menu {
  position: absolute;
  right: 6px;
  bottom: 54px;
  left: 6px;
  z-index: 70;
  display: grid;
  padding: 6px;
  background: var(--chat-surface);
  border: 1px solid var(--chat-border);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgb(15 23 42 / 16%);
}

.chat-user-menu a,
.chat-user-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  color: var(--chat-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.chat-user-menu a:hover,
.chat-user-menu__item:hover {
  color: var(--chat-accent);
  background: var(--chat-surface-soft);
}

.chat-history__user-text strong,
.chat-history__user-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-history__user-text span {
  color: var(--chat-muted);
  font-size: 12px;
}

.chat-user-menu form {
  margin: 0;
}

.chat-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-top: 72px;
}

.chat-intro {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  width: min(100%, 720px);
  min-height: 0;
  max-height: 100%;
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 32px 24px 24px;
  box-sizing: border-box;
  text-align: center;
}

.chat-intro__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--chat-accent-strong);
  background: rgb(76 117 255 / 16%);
  border: 1px solid rgb(95 132 255 / 28%);
  border-radius: 50%;
}

.chat-intro h1 {
  margin: 0;
  color: var(--chat-text);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 650;
  line-height: 1.25;
}

.chat-intro h1:focus {
  outline: none;
}

.chat-intro p {
  max-width: 620px;
  margin: 0;
  color: var(--chat-subtle);
  font-size: 15px;
  line-height: 1.8;
}

.chat-prompts {
  width: 100%;
  margin-top: 12px;
}

.chat-prompts .antdx-prompts-header {
  justify-content: center;
  color: var(--chat-subtle);
}

.chat-prompts .antdx-prompts-header h3 {
  color: var(--chat-subtle);
  font-size: 15px;
  font-weight: 600;
}

.chat-prompts .antdx-prompts-list {
  justify-content: center;
  gap: 10px;
}

.chat-prompts .antdx-prompt {
  min-height: 0;
  padding: 9px 14px;
  color: var(--chat-text);
  background: var(--chat-surface-soft);
  border: 1px solid var(--chat-border);
  border-radius: 999px;
}

.chat-prompts .antdx-prompt-main,
.chat-prompts .antdx-prompt-title {
  color: var(--chat-text);
}

.chat-prompts .antdx-prompt:hover:not(:disabled) {
  color: var(--chat-accent);
  background: color-mix(in srgb, var(--chat-accent) 10%, var(--chat-surface));
  border-color: color-mix(in srgb, var(--chat-accent) 46%, transparent);
}

.chat-prompts .antdx-prompt-description {
  display: none;
}

.chat-message-panel {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 26px;
  width: min(100%, 820px);
  min-height: 0;
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 34px 24px;
  box-sizing: border-box;
  background: transparent;
  -webkit-overflow-scrolling: touch;
}

.chat-message-panel .antdx-bubble-avatar,
.chat-message-panel .antdx-bubble-header {
  display: none;
}

.chat-message-panel .antdx-bubble-body {
  max-width: 100%;
}

.chat-message-panel .antdx-bubble-content {
  color: var(--chat-text);
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 16px;
  line-height: 1.85;
}

.chat-message-panel .antdx-bubble:not(.antdx-bubble-end) .antdx-bubble-content {
  padding: 0;
}

.chat-message-panel .antdx-bubble-end .antdx-bubble-content {
  max-width: min(72vw, 520px);
  padding: 10px 16px;
  color: var(--chat-text);
  background: var(--chat-user-bubble);
  border: 1px solid var(--chat-user-bubble-border);
  border-radius: 22px;
  line-height: 1.6;
}

.chat-message-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.chat-message-block--end {
  align-items: flex-end;
}

.chat-message-block--start {
  align-items: flex-start;
}

.chat-message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(72vw, 520px);
}

.chat-message-attachments--end {
  justify-content: flex-end;
}

.chat-message-attachments--start {
  justify-content: flex-start;
}

.chat-message-attachment {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(72vw, 280px);
  padding: 0;
  border: 1px solid var(--chat-attachment-border, #cdddf5);
  border-radius: 14px;
  background: var(--chat-attachment-surface, #f3f7ff);
  color: var(--chat-text);
  text-decoration: none;
  overflow: hidden;
  cursor: zoom-in;
  appearance: none;
  font: inherit;
}

.chat-message-attachment--file {
  padding: 10px 12px;
  cursor: pointer;
}

.chat-message-attachment__icon {
  flex: 0 0 auto;
}

.chat-message-attachment__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.4;
}

/* 公众端图片预览：遮罩上只显示图片，不带白底卡片与边框 */
.chat-image-preview-mask {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgb(0 0 0 / 72%);
}

.chat-image-preview-mask__close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  background: rgb(0 0 0 / 40%);
}

.chat-image-preview-mask__close:hover {
  background: rgb(0 0 0 / 60%);
}

.chat-image-preview-mask__image {
  display: block;
  max-width: min(96vw, 1080px);
  max-height: min(88vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.chat-message-panel .antdx-markdown p,
.chat-message-panel .antdx-markdown ul,
.chat-message-panel .antdx-markdown ol {
  margin-top: 0;
  margin-bottom: 14px;
}

.chat-message-panel .antdx-markdown :last-child {
  margin-bottom: 0;
}

.chat-actions {
  flex: 0 0 auto;
  padding: 12px 32px max(18px, env(safe-area-inset-bottom));
  background: var(--chat-input-gradient);
}

.chat-actions__sender {
  position: relative;
  width: min(100%, 780px);
  margin: 0 auto;
}

.chat-actions .antdx-sender {
  width: 100%;
  margin: 0;
}

.chat-actions .antdx-sender-editor {
  gap: 8px;
  position: relative;
  min-height: 138px;
  padding: 14px 14px 58px;
  background: var(--chat-surface);
  border: 1px solid var(--chat-border);
  border-radius: 24px;
  box-shadow: none;
}

.chat-actions__sender--with-attachments .antdx-sender-editor {
  min-height: 138px;
  padding-top: 14px;
}

.chat-actions .antdx-sender-editor:focus-within {
  border-color: var(--chat-border);
  box-shadow: none;
}

.chat-actions .antdx-sender-textarea {
  min-height: 46px;
  color: var(--chat-text);
  font-size: 16px;
  line-height: 1.7;
}

.chat-actions .antdx-sender-textarea::placeholder {
  color: var(--chat-muted);
}

.chat-actions .antdx-sender-footer {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  width: max-content;
  /* 为中间的语音按钮留出空间，并保持相邻按钮至少 12px 间距以减少误触。 */
  gap: 58px;
}

.chat-actions .antdx-sender-suffix {
  position: absolute;
  right: 60px;
  bottom: 12px;
  z-index: 1;
  flex: none;
  width: max-content;
}

.chat-actions .antdx-sender-tools {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-left: 0;
}

.chat-actions .antdx-sender-submit {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.chat-actions .antdx-sender-stop + .antdx-sender-send {
  display: none;
}

.chat-actions .antdx-sender-tools > button,
.chat-actions .antdx-sender-send,
.chat-actions .antdx-sender-stop {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  overflow: hidden;
  color: var(--chat-action-icon);
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.chat-actions__speech-status {
  width: min(100%, 780px);
  margin: 6px auto 0;
  padding: 0 12px;
  color: var(--chat-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.chat-actions .antdx-sender-tools > button.antdx-action-danger {
  color: var(--chat-danger, #d4380d);
  background: color-mix(in srgb, var(--chat-danger, #d4380d) 10%, transparent);
}

.chat-actions .antdx-sender-tools > button {
  gap: 0;
  font-size: 0;
}

.chat-actions .antdx-sender-tools > button .anticon,
.chat-actions .antdx-sender-tools > button svg {
  width: 18px;
  height: 18px;
  font-size: 18px;
}

.chat-actions .antdx-sender-send > *,
.chat-actions .antdx-sender-stop > * {
  visibility: hidden;
}

.chat-actions .antdx-sender-tools > button:hover {
  background: rgb(255 255 255 / 10%);
}

.chat-actions .antdx-sender-send {
  font-size: 0;
  color: #fff;
  background: var(--chat-accent);
}

.chat-actions .antdx-sender-send:hover:not(:disabled) {
  background: var(--chat-accent-strong);
}

.chat-actions .antdx-sender-stop {
  font-size: 0;
  color: #fff;
  background: var(--chat-accent);
}

.chat-actions .antdx-sender-stop:hover:not(:disabled) {
  background: var(--chat-accent-strong);
}

.chat-actions .antdx-sender-stop::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  background: currentColor;
  border-radius: 3px;
  transform: translate(-50%, -50%);
}

.chat-actions .antdx-sender-send:disabled {
  color: var(--chat-muted);
  background: var(--chat-surface-strong);
}

.chat-actions .antdx-sender-send::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: translate(-50%, -64%) rotate(45deg);
}

.chat-actions .antdx-sender-send::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 15px;
  background: currentColor;
  border-radius: 2px;
  transform: translate(-50%, -34%);
}

.chat-actions .antdx-attachments-empty,
.chat-actions .antdx-attachments-upload {
  color: var(--chat-subtle);
  background: var(--chat-attachment-surface);
  border-color: var(--chat-attachment-border);
}

.chat-actions .antdx-sender-attachments-panel {
  margin-bottom: 8px;
}

.chat-actions .antdx-sender-attachments-panel .antdx-attachments {
  background: transparent;
  border-radius: 16px;
}

.chat-actions .antdx-attachments-upload {
  min-height: 40px;
  padding: 8px 12px;
}

.chat-actions .antdx-attachments-list {
  display: flex;
  flex-direction: row;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.chat-actions .antdx-attachments-list::-webkit-scrollbar {
  display: none;
}

.chat-actions .antdx-file-card {
  flex: 0 0 min(248px, calc(100vw - 96px));
  background: #fbfdff;
  border-color: var(--chat-attachment-border);
  border-radius: 12px;
  scroll-snap-align: start;
}

.chat-actions .antdx-file-card-preview,
.chat-actions .antdx-file-card-preview img {
  border-radius: 8px;
}

.chat-actions .antdx-sender-attachments-close {
  display: none;
}

.section-toolbar,
.action-row,
.tag-row,
.chunk-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chunk-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  color: var(--chat-text);
}

.chunk-card--risk {
  padding-left: 12px;
  border-left: 4px solid #ff7875;
}

.chunk-card--success {
  padding-left: 12px;
  border-left: 4px solid #73d13d;
}

.chat-thinking {
  width: min(640px, calc(100vw - 56px));
  max-width: 100%;
  color: var(--chat-muted);
  font-size: 14px;
  font-weight: 400;
}

.chat-thinking__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 0 8px;
  color: var(--chat-muted);
  border-bottom: 1px solid var(--chat-border);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.chat-thinking__summary::-webkit-details-marker {
  display: none;
}

.chat-thinking__summary:hover {
  color: var(--chat-subtle);
}

.chat-thinking__summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--chat-accent) 28%, transparent);
  outline-offset: 4px;
  border-radius: 4px;
}

.chat-thinking__label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.chat-thinking__elapsed {
  margin-left: 5px;
  color: var(--chat-subtle);
  font-variant-numeric: tabular-nums;
}

.chat-thinking__dots {
  display: inline-flex;
  gap: 3px;
}

.chat-thinking__dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--chat-accent);
  animation: chat-thinking-dot 1.2s ease-in-out infinite;
}

.chat-thinking__dots span:nth-child(2) {
  animation-delay: 160ms;
}

.chat-thinking__dots span:nth-child(3) {
  animation-delay: 320ms;
}

.chat-thinking__chevron {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentcolor;
  border-bottom: 1.5px solid currentcolor;
  transform: rotate(-45deg);
  transition: transform 180ms ease;
}

.chat-thinking__details[open] .chat-thinking__chevron {
  transform: rotate(45deg) translateY(-1px);
}

.chat-thinking__content {
  padding: 10px 2px 1px;
  color: var(--chat-muted);
  line-height: 1.6;
}

.chat-thinking__stage {
  animation: chat-thinking-stage-in 240ms ease-out;
}

@keyframes chat-thinking-dot {
  0%,
  60%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes chat-thinking-stage-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-thinking__dots span,
  .chat-thinking__stage {
    animation: none;
  }

  .chat-thinking__chevron {
    transition: none;
  }
}

.chunk-title,
.chunk-subtitle {
  color: var(--chat-text);
  font-weight: 600;
}

.chunk-text {
  margin: 0;
  color: var(--chat-subtle);
  line-height: 1.7;
}

.chunk-text--preline {
  white-space: pre-line;
}

.chunk-muted {
  color: var(--chat-muted);
  font-size: 12px;
  line-height: 1.5;
}

.chunk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chunk-stack {
  display: grid;
  gap: 10px;
}

.chunk-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chunk-action-row .antdx-action {
  min-height: 36px;
  padding: 6px 14px;
  color: var(--chat-text);
  background: var(--chat-surface);
  border: 1px solid var(--chat-border);
  border-radius: 6px;
  cursor: pointer;
}

.chunk-action-row .antdx-action:hover:not(:disabled) {
  border-color: var(--chat-accent);
}

.chunk-action-row .antdx-action:disabled,
.chunk-action-row .antdx-action[disabled] {
  cursor: not-allowed;
  opacity: 0.58;
}

.chunk-action-row .antdx-action:first-child {
  color: #fff;
  background: var(--chat-accent);
  border-color: var(--chat-accent);
}

.chunk-action-row .antdx-action:first-child:hover:not(:disabled) {
  background: var(--chat-accent-strong);
}

.chunk-list-card,
.chunk-subsection {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--chat-surface-soft);
  border: 1px solid var(--chat-border);
  border-radius: 8px;
}

.chunk-subsection--warning {
  background: rgb(232 165 90 / 10%);
  border-color: rgb(232 165 90 / 30%);
}

.chunk-subsection--success {
  background: rgb(115 209 61 / 10%);
  border-color: rgb(115 209 61 / 30%);
}

.business-case-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.business-case-card > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.business-case-link {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--chat-accent);
  background: transparent;
  border: 1px solid var(--chat-border);
  border-radius: 50%;
  cursor: pointer;
}

.business-case-link:hover {
  color: #fff;
  background: var(--chat-accent);
  border-color: var(--chat-accent);
}

.chunk-subitem {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--chat-border);
}

.chunk-subitem:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.chunk-guidance {
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--chat-border);
}

.chunk-guidance p {
  margin: 0;
}

.chunk-list,
.ordered-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--chat-subtle);
  line-height: 1.7;
}

.ordered-list--compact {
  display: grid;
  gap: 4px;
}

.chunk-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 8px;
  color: var(--chat-subtle);
  font-size: 12px;
  line-height: 1.5;
  background: var(--chat-surface);
  border: 1px solid var(--chat-border);
  border-radius: 999px;
}

.chunk-badge--warning,
.status-pill--warning {
  color: #8a4b08;
  background: rgb(232 165 90 / 12%);
  border-color: rgb(232 165 90 / 35%);
}

.status-pill--info {
  color: #0958d9;
  background: #e6f4ff;
  border-color: #91caff;
}

.status-pill--success {
  color: #237804;
  background: #f6ffed;
  border-color: #b7eb8f;
}

.chunk-badge--danger,
.status-pill--danger {
  color: #ffa39e;
  background: rgb(255 77 79 / 12%);
  border-color: rgb(255 77 79 / 35%);
}

.admin-layout {
  min-height: 100svh;
  background: var(--app-bg);
}

.admin-sider {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow-y: auto;
  border-right: 1px solid var(--app-border);
}

.admin-brand {
  display: grid;
  gap: 4px;
  padding: 22px 20px 16px;
}

.admin-brand span,
.eyebrow {
  color: #1668dc;
  font-size: 12px;
  font-weight: 600;
}

.admin-brand strong {
  font-size: 18px;
}

.admin-brand__title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-brand__suffix {
  color: #1668dc;
  font-size: 14px;
  font-weight: 600;
}

.admin-menu small {
  display: block;
  color: var(--app-muted);
  font-size: 12px;
  line-height: 1.4;
}

.admin-header {
  height: auto;
  padding: 22px 28px 16px;
  line-height: 1.5;
  background: #fff;
  border-bottom: 1px solid var(--app-border);
}

.admin-page-title {
  display: grid;
  gap: 2px;
}

.admin-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
}

.admin-content {
  display: grid;
  gap: 18px;
  padding: 24px 28px;
}

@media (min-width: 961px) {
  .admin-layout.ant-layout {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    align-items: stretch;
  }

  .admin-layout > .ant-layout {
    min-width: 0;
    min-height: 100svh;
    background: var(--app-bg);
  }

  .admin-layout .admin-sider.ant-layout-sider {
    position: sticky;
    top: 0;
    width: 248px !important;
    min-width: 248px !important;
    max-width: 248px !important;
    height: 100svh;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid var(--app-border);
  }

  .admin-layout .admin-header.ant-layout-header {
    display: flex;
    align-items: center;
    height: auto;
    min-height: 72px;
    padding: 22px 28px 16px;
    line-height: 1.5;
    background: #fff;
    color: #1f2329;
    border-bottom: 1px solid var(--app-border);
  }

  .admin-layout .admin-header h1 {
    margin: 0;
    color: #1f2329;
    font-size: 24px;
    line-height: 1.3;
  }

  .admin-layout .admin-header h1:focus {
    outline: none;
  }

  .admin-layout .admin-content.ant-layout-content {
    display: grid;
    gap: 18px;
    min-width: 0;
    padding: 24px 28px;
    background: var(--app-bg);
  }
}

.admin-section {
  margin-top: 18px;
}

.admin-card {
  border-radius: 8px;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.section-heading__subtitle,
.hint-text,
.message-text,
.item-text {
  color: var(--app-muted);
  line-height: 1.7;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.metric-card .ant-card-body {
  display: grid;
  gap: 6px;
}

.metric-card__value {
  font-size: 30px;
  line-height: 1;
}

.metric-card__label {
  color: var(--app-muted);
}

.health-grid,
.admin-list,
.step-list {
  display: grid;
  gap: 10px;
}

.health-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.health-grid > .ant-alert {
  grid-column: 1 / -1;
}

.health-check-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-layout .health-check-title .admin-status-tag.ant-tag {
  border-radius: 4px;
  font-weight: 500;
}

.admin-layout .health-check-title .admin-status-tag--success.ant-tag {
  color: #237804;
  background: #f6ffed;
  border-color: #b7eb8f;
}

.admin-layout .health-check-title .admin-status-tag--warning.ant-tag {
  color: #ad6800;
  background: #fffbe6;
  border-color: #ffe58f;
}

.admin-layout .health-check-title .admin-status-tag--danger.ant-tag {
  color: #cf1322;
  background: #fff1f0;
  border-color: #ffa39e;
}

.admin-list--spacious {
  gap: 16px;
}

.admin-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--app-border);
}

.admin-list-item:first-child {
  border-top: 0;
}

.admin-list-item.health-check-item {
  grid-template-columns: 1fr;
  gap: 6px;
  border-top: 0;
  border-bottom: 1px solid var(--app-border);
}

.attachment-record {
  align-items: start;
}

.attachment-record__main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.attachment-record__preview {
  position: relative;
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: #f7f8fa;
  cursor: zoom-in;
  appearance: none;
  font: inherit;
  color: inherit;
}

.attachment-record__preview:focus-visible {
  outline: 2px solid #1677ff;
  outline-offset: 2px;
}

.attachment-record__thumb {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
}

.attachment-record__preview-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.attachment-record__preview:hover .attachment-record__preview-mask,
.attachment-record__preview:focus-visible .attachment-record__preview-mask {
  opacity: 1;
}

.attachment-record__body,
.attachment-record__actions {
  min-width: 0;
}

.attachment-record__body {
  flex: 1 1 auto;
}

.attachment-record__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.attachment-preview-modal {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 240px;
  max-height: min(72vh, 760px);
  overflow: auto;
  background: #f7f8fa;
  border-radius: 10px;
}

.attachment-preview-modal__image {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 720px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.attachment-ocr-content {
  grid-column: 1 / -1;
  min-width: 0;
}

.attachment-ocr-text {
  max-height: 260px;
  margin: 10px 0 0;
  padding: 12px;
  overflow: auto;
  color: #1f2329;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
}

.item-title {
  color: #1f2329;
  font-weight: 600;
}

.item-text {
  margin: 4px 0 0;
}

.admin-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 18px;
  margin-top: 0;
}

.admin-two-column--cases {
  grid-template-columns: minmax(320px, 3fr) minmax(0, 7fr);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid--case-status {
  grid-template-columns: 140px minmax(0, 1fr) auto;
}

.form-grid--case-status .form-field--wide {
  grid-column: auto;
}

.form-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field--wide {
  grid-column: span 2;
}

.form-field--full {
  grid-column: 1 / -1;
}

.faq-status-field {
  align-self: start;
}

/* 常见问答采用左侧维护、右侧列表的主次工作区布局。 */
.faq-workspace {
  display: grid;
  grid-template-areas: "list editor";
  grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
  align-items: start;
  gap: 18px;
}

.faq-list-panel {
  grid-area: list;
}

.faq-editor-panel {
  grid-area: editor;
}

.faq-workspace > section,
.faq-workspace .admin-card {
  min-width: 0;
}

.faq-editor-form {
  grid-template-columns: minmax(0, 1fr);
}

.form-grid + .action-row {
  margin-top: 18px;
}

.faq-keyword-hint {
  color: var(--app-muted);
  font-size: 12px;
  line-height: 1.5;
}

.faq-search-input {
  width: min(100%, 420px);
}

.faq-list-item > :first-child {
  min-width: 0;
}

.form-label {
  font-weight: 600;
}

.form-textarea {
  min-height: 112px;
  resize: vertical;
}

.knowledge-editor {
  min-height: 260px;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.filter-row--logs {
  grid-template-columns: minmax(260px, 1fr) 150px 120px 150px auto;
}

.filter-row--cases {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.filter-row--cases > :is(.case-keyword-filter, .case-date-filter) {
  grid-column: 1 / -1;
}

.case-list-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.case-list-heading__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-row--attachments {
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto auto;
  align-items: end;
  margin-bottom: 12px;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.conversation-record {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--app-border);
}

.case-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
}

.case-list-row--active {
  border-color: #1668dc;
  background: #eef4ff;
}

.case-list-button {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 0;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.case-list-button span,
.case-list-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-detail-grid {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 14px 0;
}

.case-detail-grid span {
  color: var(--app-muted);
}

.case-detail-time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr);
  gap: 12px;
}

.case-status-save-button {
  align-self: end;
}

.case-status-message {
  display: block;
  margin-top: 10px;
}

.admin-layout .case-detail-status-tag.ant-tag {
  align-self: flex-start;
  flex: 0 0 auto;
  justify-content: center;
  min-width: 64px;
  height: 32px;
  margin: 0;
  padding: 4px 12px;
  border-radius: 4px;
  line-height: 22px;
  white-space: nowrap;
}

.admin-role-select {
  width: 128px;
}

.my-cases-shell {
  display: grid;
  gap: 18px;
  width: min(100% - 32px, 920px);
  margin: 0 auto;
  padding: 28px 0 42px;
}

.my-cases-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.my-cases-header h1 {
  margin: 0;
  font-size: 26px;
}

.my-cases-header p {
  margin: 4px 0 0;
  color: var(--app-muted);
}

.my-cases-empty,
.my-case-card {
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
}

.my-cases-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 46px 20px;
  text-align: center;
}

.my-cases-empty svg,
.my-cases-empty img {
  width: 36px;
  height: 36px;
  color: #1668dc;
}

.my-cases-empty p {
  margin: 0;
  color: var(--app-muted);
}

.my-cases-list {
  display: grid;
  gap: 12px;
}

.my-case-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.my-case-card--focused {
  border-color: #7eb6ff;
  box-shadow: 0 0 0 3px rgb(22 104 220 / 14%), 0 14px 34px rgb(32 70 108 / 10%);
  background: linear-gradient(180deg, #f5f9ff 0%, #ffffff 48%);
  scroll-margin-top: 88px;
}

.case-progress {
  display: grid;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.attachment-preview-mask {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(0 0 0 / 55%);
}

.attachment-preview-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1040px, 92vw);
  height: min(820px, 88vh);
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgb(0 0 0 / 24%);
}

.attachment-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--app-border);
}

.attachment-preview-header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-content {
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: auto;
  background: #f5f5f5;
}

.attachment-preview-content iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.attachment-preview-content img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.case-progress__step {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  min-height: 58px;
  color: var(--app-muted);
}

.case-progress__step:not(:last-child)::after {
  position: absolute;
  top: 24px;
  bottom: 0;
  left: 11px;
  width: 2px;
  content: "";
  background: #dce5ef;
}

.case-progress__marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #fff;
  background: #fff;
  border: 2px solid #c9d4e1;
  border-radius: 50%;
}

.case-progress__marker .anticon {
  font-size: 12px;
}

.case-progress__content {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 1px 0 14px;
}

.case-progress__content strong {
  color: #718096;
  font-size: 14px;
  font-weight: 600;
}

.case-progress__content small {
  color: #1677ff;
  font-size: 12px;
}

.case-progress__step--done .case-progress__marker,
.case-progress__step--current .case-progress__marker {
  background: #1677ff;
  border-color: #1677ff;
}

.case-progress__step--done:not(:last-child)::after {
  background: #69b1ff;
}

.case-progress__step--done .case-progress__content strong,
.case-progress__step--current .case-progress__content strong {
  color: #1f2d3d;
}

.case-progress__step--current .case-progress__marker::after {
  width: 6px;
  height: 6px;
  content: "";
  background: #fff;
  border-radius: 50%;
}

.case-progress__step--danger .case-progress__marker {
  background: #ff4d4f;
  border-color: #ff4d4f;
}

.case-progress__step--danger .case-progress__marker::after {
  width: 8px;
  height: 2px;
  content: "";
  background: #fff;
  border-radius: 2px;
}

.case-progress__step--danger .case-progress__content strong,
.case-progress__step--danger .case-progress__content small {
  color: #cf1322;
}

.my-cases-message {
  margin: 0;
  padding: 11px 14px;
  color: #096b57;
  background: #eaf8f3;
  border: 1px solid #a8dfd1;
  border-radius: 12px;
}

.my-cases-message--error {
  color: #a8071a;
  background: #fff1f0;
  border-color: #ffa39e;
}

.case-action-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.my-cases-confirmation-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 0;
  background: rgb(16 35 58 / 42%);
  border: 0;
}

.my-cases-confirmation-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1001;
  display: grid;
  gap: 14px;
  width: min(calc(100% - 40px), 360px);
  padding: 22px;
  color: var(--app-text);
  background: #fff;
  border: 1px solid #d8e4ef;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgb(15 23 42 / 26%);
  transform: translate(-50%, -50%);
}

.my-cases-confirmation-dialog h2,
.my-cases-confirmation-dialog p {
  margin: 0;
}

.my-cases-confirmation-dialog h2 {
  font-size: 18px;
}

.my-cases-confirmation-dialog p {
  color: var(--app-muted);
  line-height: 1.65;
}

.my-cases-confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.my-cases-button.ant-btn {
  min-height: 44px;
  padding-inline: 18px;
  border-radius: 10px;
}

.log-record {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--app-border);
}

.conversation-record:first-child {
  padding-top: 0;
  border-top: 0;
}

.log-record:first-child {
  padding-top: 0;
  border-top: 0;
}

.log-title,
.log-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.log-meta {
  color: var(--app-muted);
  font-size: 13px;
}

.log-detail-grid {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px 12px;
  margin-top: 12px;
}

.log-detail-grid span {
  color: var(--app-muted);
}

.log-json,
.log-stack {
  max-height: 240px;
  margin: 12px 0 0;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  font-size: 12px;
}

.record-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.details-panel {
  padding: 12px;
  background: #f7f9fc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
}

.details-panel + .details-panel {
  margin-top: 8px;
}

.case-status-section + .details-panel {
  margin-top: 8px;
}

.details-panel summary {
  color: #1668dc;
  font-weight: 600;
  cursor: pointer;
}

.step-list {
  margin-top: 12px;
}

.step-item {
  display: grid;
  gap: 4px;
  padding-left: 12px;
  border-left: 2px solid #d9d9d9;
}

.inline-link {
  margin-left: 8px;
  font-weight: 600;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.admin-pagination__buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-page-button {
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  color: #1f2329;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  cursor: pointer;
}

.admin-page-button:hover:not(:disabled) {
  color: #1668dc;
  border-color: #1668dc;
}

.admin-page-button:disabled {
  color: var(--app-muted);
  cursor: not-allowed;
  background: #f7f9fc;
}

.admin-page-button--active,
.admin-page-button--active:disabled {
  color: #fff;
  background: #1668dc;
  border-color: #1668dc;
}

.empty-state {
  padding: 32px 16px;
  color: var(--app-muted);
  text-align: center;
  background: #f7f9fc;
  border: 1px dashed #d9d9d9;
  border-radius: 8px;
}

.error-page {
  width: min(100% - 32px, 800px);
  margin: 40px auto;
}

@media (max-width: 960px) {
  .chat-topbar {
    top: max(4px, env(safe-area-inset-top));
    padding: 0 14px;
  }

  .chat-icon-button {
    width: 54px;
    height: 54px;
  }

  .chat-icon-button svg,
  .chat-icon-button img {
    width: 26px;
    height: 26px;
  }

  .chat-topbar .chat-icon-button svg,
  .chat-topbar .chat-icon-button img {
    width: 30px;
    height: 30px;
  }

  .chat-icon-button--compact {
    width: 38px;
    height: 38px;
  }

  .chat-icon-button--compact svg,
  .chat-icon-button--compact img {
    width: 20px;
    height: 20px;
  }

  .chat-history {
    width: min(82vw, 300px);
  }

  .chat-main {
    padding-top: 58px;
  }

  .chat-intro {
    align-content: start;
    gap: 12px;
    padding: 18px 20px 14px;
  }

  .chat-intro__mark {
    width: 44px;
    height: 44px;
  }

  .chat-intro h1 {
    font-size: 25px;
    line-height: 1.25;
  }

  .chat-intro p {
    font-size: 15px;
    line-height: 1.75;
  }

  .chat-prompts {
    margin-top: 6px;
  }

  .chat-prompts .antdx-prompts-list {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .chat-prompts .antdx-prompt {
    width: 100%;
    min-height: 40px;
    padding: 9px 14px;
  }

  .chat-message-panel {
    padding-inline: 20px;
  }

  .chat-actions {
    padding: 10px 14px max(18px, env(safe-area-inset-bottom));
  }

  .chat-actions .antdx-sender-editor {
    min-height: 150px;
    padding: 16px 16px 62px;
    border-radius: 22px;
  }

  .chat-actions .antdx-file-card {
    flex-basis: min(238px, calc(100vw - 72px));
  }

  .chat-actions__sender--with-attachments .antdx-sender-editor {
    min-height: 150px;
    padding-top: 16px;
  }

  .chat-actions .antdx-sender-textarea {
    min-height: 78px;
  }

  .chat-actions .antdx-sender-footer {
    right: 18px;
    bottom: 14px;
    /* 预留 40px 语音按钮及两侧各 12px 间距，避免附件按钮与独立后缀重叠。 */
    gap: 64px;
  }

  .chat-actions .antdx-sender-suffix {
    right: 70px;
    bottom: 14px;
  }

  .chat-actions .antdx-sender-tools > button,
  .chat-actions .antdx-sender-send,
  .chat-actions .antdx-sender-stop {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .admin-layout {
    display: block;
  }

  .admin-sider {
    position: static;
    width: 100% !important;
    height: auto;
  }

  .admin-content,
  .admin-header {
    padding: 18px;
  }

  .metric-grid,
  .health-grid,
  .chat-status-grid,
  .form-grid--three,
  .form-grid--four,
  .admin-two-column,
  .faq-workspace,
  .chunk-grid,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .faq-workspace {
    grid-template-areas:
      "list"
      "editor";
  }

  .form-field--wide {
    grid-column: auto;
  }

  .admin-list-item {
    grid-template-columns: 1fr;
  }

  .faq-search-input {
    width: 100%;
  }
}

@media (min-width: 720px) {
  .chat-shell {
    min-height: 0;
    margin-block: 0;
    border-radius: 0;
    overflow: hidden;
  }
}

/* 双端视觉升级集中在此处，保留原有组件布局与业务交互。 */
:root {
  --app-bg: #eef3f9;
  --app-text: #172033;
  --app-muted: #5d6b82;
  --app-border: #dce5f0;
  --app-primary: #155eef;
  --app-primary-strong: #0b4dcc;
  --app-cyan: #0e9384;
  --app-gold: #eaaa08;
  --app-surface: #ffffff;
  --app-shadow: 0 18px 45px rgb(31 64 104 / 10%);
}

html,
body {
  color: var(--app-text);
  background: var(--app-bg);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

:where(button, a, summary):focus-visible {
  outline: 3px solid rgb(21 94 239 / 24%);
  outline-offset: 3px;
}

/* 输入类控件聚焦时不显示浏览器或组件库附加的蓝色外轮廓。 */
:where(input, textarea, select):focus-visible {
  outline: none;
}

.eyebrow {
  color: var(--app-primary);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.login-shell {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  align-items: center;
  gap: clamp(48px, 8vw, 104px);
  width: 100%;
  min-height: 100svh;
  padding: clamp(32px, 6vw, 76px) max(24px, calc((100vw - 1160px) / 2));
  overflow: auto;
  background:
    radial-gradient(circle at 8% 14%, rgb(41 171 226 / 22%), transparent 28%),
    radial-gradient(circle at 88% 88%, rgb(14 147 132 / 18%), transparent 26%),
    linear-gradient(135deg, #eef7ff 0%, #f7f9fd 48%, #eefaf8 100%);
}

.login-shell--admin {
  background:
    radial-gradient(circle at 12% 18%, rgb(37 99 235 / 22%), transparent 30%),
    radial-gradient(circle at 86% 82%, rgb(234 170 8 / 13%), transparent 24%),
    linear-gradient(135deg, #e9f1fb 0%, #f6f8fc 52%, #f2f6fb 100%);
}

.login-showcase {
  display: grid;
  align-content: center;
  justify-items: start;
  max-width: 620px;
}

.login-showcase__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  margin-bottom: 28px;
  color: #fff;
  background: linear-gradient(145deg, #155eef, #18a89a);
  border: 0;
  border-radius: 22px;
  box-shadow: 0 18px 40px rgb(21 94 239 / 25%);
}

.login-shell--admin .login-showcase__mark {
  background: linear-gradient(145deg, #0d3765, #155eef);
}

.login-showcase__mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.login-showcase h1 {
  max-width: 620px;
  margin: 14px 0 18px;
  color: #10213b;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.14;
}

.login-showcase h1:focus {
  outline: none;
}

.login-showcase h1 span {
  color: var(--app-primary);
}

.login-showcase > p {
  max-width: 520px;
  margin: 0;
  color: #53657e;
  font-size: 17px;
  line-height: 1.8;
}

.login-showcase__features {
  display: grid;
  gap: 12px;
  margin-top: 32px;
}

.login-showcase__features span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #30435f;
  font-weight: 600;
}

.login-showcase__features svg {
  color: var(--app-cyan);
}

.login-panel {
  position: relative;
  gap: 26px;
  width: 100%;
  max-width: 460px;
  justify-self: end;
  padding: clamp(28px, 4vw, 40px);
  overflow: hidden;
  background: rgb(255 255 255 / 92%);
  border: 1px solid rgb(255 255 255 / 88%);
  border-radius: 26px;
  box-shadow: 0 30px 80px rgb(28 67 112 / 16%);
  backdrop-filter: blur(18px);
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #155eef, #20b7c7, #0e9384);
}

.login-panel h1 {
  margin-top: 8px;
  color: #14233b;
  font-size: 28px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.login-panel p {
  color: #66758b;
}

.login-form {
  gap: 18px;
}

.login-shell--admin .login-submit {
  margin-top: 12px;
}

.form-label {
  color: #34445b;
}

.login-input {
  box-sizing: border-box;
  min-height: 48px;
  padding: 11px 14px;
  color: var(--app-text);
  background: #f8fafc;
  border-color: #d7e1ed;
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-input:focus {
  background: #fff;
  border-color: #d7e1ed;
  box-shadow: none;
  outline: none;
}

.login-submit,
.chat-userbar button {
  min-height: 48px;
  background: linear-gradient(135deg, #155eef, #0f74d8);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgb(21 94 239 / 22%);
  transition: box-shadow 0.2s ease, filter 0.2s ease;
}

.login-submit:hover {
  filter: brightness(1.06);
  box-shadow: 0 14px 28px rgb(21 94 239 / 30%);
}

.chat-provider {
  --chat-canvas: #eef5fb;
  --chat-shell-bg: #f5f9fd;
  --chat-history-bg: #f9fbfe;
  --chat-surface: #ffffff;
  --chat-surface-soft: #edf4fb;
  --chat-surface-strong: #dfeaf6;
  --chat-user-bubble: #e8f2ff;
  --chat-user-bubble-border: #bed8f6;
  --chat-attachment-surface: #f0f7ff;
  --chat-attachment-border: #c9dff4;
  --chat-text: #172033;
  --chat-muted: #64748b;
  --chat-subtle: #40516a;
  --chat-border: rgb(70 100 135 / 16%);
  --chat-accent: #155eef;
  --chat-accent-strong: #0b4dcc;
  --chat-shadow: 0 22px 58px rgb(26 72 118 / 13%);
}

.chat-shell {
  background:
    radial-gradient(circle at 8% 18%, rgb(70 179 225 / 15%), transparent 26%),
    radial-gradient(circle at 92% 26%, rgb(36 187 166 / 13%), transparent 24%),
    linear-gradient(180deg, #f7fbff 0%, #f3f8fc 48%, #eef4fa 100%);
}

.chat-topbar {
  align-items: center;
  padding-inline: 28px;
}

.chat-icon-button {
  color: #31506f;
  background: rgb(255 255 255 / 78%);
  border: 1px solid rgb(185 207 229 / 70%);
  box-shadow: 0 8px 22px rgb(31 76 122 / 10%);
  backdrop-filter: blur(12px);
}

.chat-icon-button:hover {
  color: #fff;
  background: var(--chat-accent);
  border-color: var(--chat-accent);
}

.chat-topbar .chat-icon-button,
.chat-topbar .chat-icon-button:hover {
  color: #31506f;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.chat-topbar__brand {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 150px);
  min-width: 0;
  transform: translateX(-50%);
}

.chat-topbar__logo {
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: auto;
}

.chat-topbar__title {
  overflow: hidden;
  color: #254766;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-history {
  padding: 22px 16px 18px;
  background:
    radial-gradient(circle at 0 0, rgb(21 94 239 / 9%), transparent 34%),
    var(--chat-history-bg);
  border-right-color: #d5e2ef;
  box-shadow: 24px 0 60px rgb(24 55 90 / 24%);
}

.chat-history__new {
  min-height: 46px;
  color: #fff;
  font-weight: 650;
  background: linear-gradient(135deg, #155eef, #0f75d9);
  border: 0;
  box-shadow: 0 10px 22px rgb(21 94 239 / 18%);
}

.chat-history__new:hover {
  color: #fff;
  background: linear-gradient(135deg, #0b4dcc, #0b67c4);
}

.chat-history-row,
.chat-user-menu,
.chat-history__avatar {
  border-radius: 12px;
}

.chat-history-row:hover,
.chat-history-row--active {
  background: #eaf2fb;
}

.chat-intro {
  gap: 18px;
  width: min(100%, 900px);
  padding: 52px 30px 30px;
}

.chat-intro__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  color: #0b5a92;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgb(255 255 255 / 74%);
  border: 1px solid rgb(85 160 207 / 25%);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgb(24 94 139 / 8%);
}

.chat-intro__eyebrow svg {
  color: var(--chat-accent);
}

.chat-intro h1 {
  max-width: 760px;
  color: #142b49;
  font-size: clamp(36px, 5vw, 54px);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.chat-intro h1 span {
  color: transparent;
  background: linear-gradient(90deg, #155eef, #0d83c5 56%, #0e9384);
  background-clip: text;
  -webkit-background-clip: text;
}

.chat-intro p {
  max-width: 680px;
  color: #52667e;
  font-size: 16px;
}

.chat-intro__features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.chat-intro__features span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  color: #41556e;
  font-size: 13px;
  font-weight: 600;
  background: rgb(255 255 255 / 65%);
  border: 1px solid rgb(162 190 218 / 40%);
  border-radius: 10px;
}

.chat-intro__features span:nth-child(1) svg {
  color: #155eef;
}

.chat-intro__features span:nth-child(2) svg {
  color: #0e9384;
}

.chat-intro__features span:nth-child(3) svg {
  color: #d69205;
}

.chat-prompts {
  margin-top: 14px;
}

.chat-prompts .antdx-prompts-header h3 {
  color: #40536c;
  font-weight: 650;
}

.chat-prompts .antdx-prompts-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.chat-prompts .antdx-prompt {
  min-height: 48px;
  padding: 12px 16px;
  background: rgb(255 255 255 / 82%);
  border-color: rgb(146 180 212 / 42%);
  border-radius: 14px;
  box-shadow: 0 10px 26px rgb(36 80 124 / 7%);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.chat-prompts .antdx-prompt:hover:not(:disabled) {
  color: var(--chat-accent);
  background: #fff;
  border-color: rgb(21 94 239 / 45%);
  box-shadow: 0 14px 30px rgb(21 94 239 / 13%);
}

.chat-message-panel .antdx-bubble-end .antdx-bubble-content {
  background: linear-gradient(145deg, #eaf3ff, #dfeefe);
  border-color: #b9d5f3;
  box-shadow: 0 8px 22px rgb(35 91 145 / 8%);
}

.chat-actions {
  background: linear-gradient(180deg, rgb(238 244 250 / 0%), rgb(238 244 250 / 88%) 26%, #eef4fa 100%);
}

.chat-actions .antdx-sender-editor {
  border-color: rgb(126 162 198 / 35%);
  box-shadow: 0 18px 48px rgb(30 77 123 / 13%);
}

.chat-actions .antdx-sender-editor:focus-within {
  border-color: rgb(126 162 198 / 35%);
  box-shadow: 0 18px 48px rgb(30 77 123 / 13%);
}

.chunk-list-card,
.chunk-subsection {
  padding: 14px;
  background: #f5f9fd;
  border-color: #d8e5f1;
  border-radius: 14px;
}

.admin-layout,
.admin-layout > .ant-layout,
.admin-layout .admin-content.ant-layout-content {
  background:
    radial-gradient(circle at 92% 4%, rgb(21 94 239 / 7%), transparent 28%),
    var(--app-bg);
}

@media (min-width: 961px) {
  .admin-layout.ant-layout {
    grid-template-columns: 264px minmax(0, 1fr);
  }
}

.admin-sider,
.admin-layout .admin-sider.ant-layout-sider {
  width: 264px !important;
  min-width: 264px !important;
  max-width: 264px !important;
  color: #dcecff;
  background:
    radial-gradient(circle at 18% 4%, rgb(32 183 199 / 22%), transparent 30%),
    linear-gradient(180deg, #0d315b 0%, #102b4c 48%, #0b203a 100%) !important;
  border-right: 0;
  box-shadow: 12px 0 38px rgb(14 38 67 / 14%);
}

.admin-brand {
  display: block;
  padding: 22px 14px 20px;
}

.admin-brand__logo {
  display: block;
  width: 100%;
  height: auto;
}

.admin-layout .admin-menu.ant-menu {
  padding: 4px 12px 24px;
  color: #bdd2e8;
  background: transparent;
  border-inline-end: 0;
}

.admin-layout .admin-menu .ant-menu-item {
  width: auto;
  height: 44px;
  margin: 4px 0;
  padding-inline: 16px !important;
  color: #bfd2e5;
  border-radius: 11px;
  line-height: 44px;
}

.admin-layout .admin-menu .ant-menu-item:hover {
  color: #fff;
  background: rgb(255 255 255 / 8%);
}

.admin-layout .admin-menu .ant-menu-item-selected {
  color: #fff;
  font-weight: 650;
  background: linear-gradient(90deg, rgb(47 128 237 / 68%), rgb(32 183 199 / 32%));
  box-shadow: inset 3px 0 #65d5df, 0 8px 20px rgb(2 18 37 / 18%);
}

.admin-layout .admin-header.ant-layout-header,
.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 94px;
  padding: 20px 30px;
  color: var(--app-text);
  background: rgb(255 255 255 / 86%);
  border-bottom: 1px solid rgb(207 220 234 / 82%);
  box-shadow: 0 8px 30px rgb(39 72 108 / 6%);
  backdrop-filter: blur(16px);
}

.admin-page-title {
  gap: 3px;
}

.admin-page-title__eyebrow {
  color: #2773c8;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.admin-layout .admin-header h1,
.admin-header h1 {
  color: #17263c;
  font-size: 25px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.admin-page-title p {
  margin: 2px 0 0;
  color: #758297;
  font-size: 13px;
}

.admin-header__meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-header__user-wrap {
  position: relative;
}

.admin-header__status,
.admin-header__user {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  color: #40516a;
  background: #f5f8fc;
  border: 1px solid #dfe8f2;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.admin-header__status .anticon,
.admin-header__user .anticon {
  font-size: 12px;
  line-height: 1;
}

button.admin-header__user {
  margin: 0;
  appearance: none;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.admin-header__user-wrap.is-open .admin-header__user {
  position: relative;
  z-index: 31;
}

button.admin-header__user:hover,
button.admin-header__user[aria-expanded="true"] {
  color: #1f4f8a;
  background: #eef5ff;
  border-color: #c9dbf2;
}

.admin-header__user-caret {
  font-size: 10px;
  opacity: 0.72;
}

.admin-user-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: transparent;
}

.admin-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 148px;
  padding: 6px;
  background: #fff;
  border: 1px solid #dfe8f2;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgb(31 61 110 / 12%);
}

.admin-user-menu form {
  margin: 0;
}

.admin-user-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  color: #40516a;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.admin-user-menu__item:hover {
  color: #1565a8;
  background: #f1f7fc;
}

.admin-user-menu form .admin-user-menu__item:hover {
  color: #c0392b;
  background: #fff5f4;
}

.admin-password-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(15 35 58 / 42%);
}

.admin-password-dialog {
  width: min(420px, 100%);
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgb(18 45 73 / 22%);
}

.admin-password-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-password-dialog__header h2,
.admin-password-dialog__header p {
  margin: 0;
}

.admin-password-dialog__header h2 {
  color: #172b45;
  font-size: 20px;
}

.admin-password-dialog__header p {
  margin-top: 5px;
  color: #73839a;
  font-size: 13px;
}

.admin-password-dialog__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #65758b;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.admin-password-dialog__field {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
}

.admin-password-dialog__field label {
  color: #31465f;
  font-size: 13px;
  font-weight: 600;
}

.admin-password-dialog__field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d5e0ec;
  border-radius: 6px;
  outline: none;
}

.admin-password-dialog__field input:focus {
  border-color: #2687c9;
  box-shadow: 0 0 0 3px rgb(38 135 201 / 12%);
}

.admin-password-dialog__message {
  margin-top: 2px;
  font-size: 13px;
}

.admin-password-dialog__message.is-error {
  color: #c0392b;
}

.admin-password-dialog__message.is-success {
  color: #138564;
}

.admin-password-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.admin-password-dialog__actions button {
  min-width: 84px;
  height: 38px;
  border-radius: 6px;
  cursor: pointer;
}

.admin-password-dialog__cancel {
  color: #40516a;
  background: #fff;
  border: 1px solid #d5e0ec;
}

.admin-password-dialog__submit {
  color: #fff;
  background: #126da8;
  border: 1px solid #126da8;
}

.admin-password-dialog__submit:disabled {
  cursor: default;
  opacity: .65;
}

.admin-header__status i {
  width: 8px;
  height: 8px;
  background: #16a085;
  border: 2px solid #c9f1e9;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgb(22 160 133 / 10%);
}

.admin-layout .admin-content.ant-layout-content,
.admin-content {
  gap: 22px;
  padding: 28px 30px 36px;
}

.metric-grid {
  gap: 16px;
}

.metric-card.ant-card,
.admin-card.ant-card {
  overflow: hidden;
  background: rgb(255 255 255 / 94%);
  border: 1px solid rgb(211 224 237 / 88%);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgb(32 70 108 / 7%);
}

.metric-card.ant-card {
  position: relative;
}

.metric-card.ant-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #155eef, #20b7c7);
}

.metric-card .ant-card-body {
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 13px;
  min-height: 116px;
  padding: 22px 18px;
}

.metric-card__icon {
  display: inline-flex;
  grid-row: 1 / 3;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #155eef;
  background: #eaf2ff;
  border-radius: 14px;
}

.metric-grid > :nth-child(2) .metric-card__icon {
  color: #0e9384;
  background: #e8f8f5;
}

.metric-grid > :nth-child(3) .metric-card__icon {
  color: #d69205;
  background: #fff7dd;
}

.metric-grid > :nth-child(4) .metric-card__icon {
  color: #7c5ce5;
  background: #f1edff;
}

.metric-grid > :nth-child(5) .metric-card__icon {
  color: #d14d72;
  background: #fff0f4;
}

.metric-card__value {
  color: #17263c;
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}

.metric-card__label {
  color: #69778c;
  font-size: 13px;
}

.admin-section {
  margin-top: 0;
}

.admin-card .ant-card-body {
  padding: 24px;
}

.section-heading__title {
  color: #1a2b43;
  font-size: 19px;
  font-weight: 700;
}

.health-grid {
  gap: 12px;
}

.admin-list-item.health-check-item {
  padding: 15px;
  background: #f7fafc;
  border: 1px solid #e2eaf3;
  border-radius: 12px;
}

.case-list-row,
.details-panel,
.empty-state {
  background: #f7fafc;
  border-color: #dce6f0;
  border-radius: 12px;
}

.case-list-row--active {
  background: #edf4ff;
  border-color: #6ca5ee;
  box-shadow: 0 0 0 3px rgb(21 94 239 / 8%);
}

.admin-layout .ant-input,
.admin-layout .ant-select-selector,
.admin-layout .form-textarea {
    border-color: #d5e0ec;
    border-radius: 10px;
    height: 32px;
}

.admin-layout input.ant-input {
  box-sizing: border-box;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #d5e0ec;
  border-radius: 6px;
  box-shadow: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.admin-layout input.ant-input:hover {
  border-color: #9db7d4;
}

.admin-layout :where(input, textarea, select).ant-input:focus {
  background: #fff;
  border-color: #d5e0ec;
  box-shadow: none;
  outline: none;
}

.admin-layout .ant-select-focused .ant-select-selector {
  border-color: #d5e0ec;
  box-shadow: none;
}

.admin-layout input.ant-input:disabled {
  color: #8795a8;
  background: #eef2f6;
  border-color: #dce3eb;
}

.admin-layout .ant-btn {
  border-radius: 9px;
}

.admin-layout .ant-btn-primary {
  background: linear-gradient(135deg, #155eef, #0f74d8);
  border-color: #155eef;
  box-shadow: 0 6px 16px rgb(21 94 239 / 18%);
}

.ant-popconfirm .ant-popover-inner {
  background-color: #fff;
}

.ant-popconfirm .ant-popover-arrow,
.ant-popconfirm .ant-popover-arrow-content {
  --antd-arrow-background-color: #fff;
  background-color: #fff;
}

.my-cases-shell {
  gap: 20px;
  width: min(100% - 36px, 980px);
  padding: 34px 0 52px;
}

.my-cases-header {
  position: relative;
  gap: 18px;
  padding: 26px 28px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 86% 20%, rgb(53 211 199 / 28%), transparent 28%),
    linear-gradient(125deg, #0e3765, #155eef 68%, #0d7b87);
  border-radius: 22px;
  box-shadow: 0 22px 48px rgb(20 67 112 / 20%);
}

.my-cases-header .chat-icon-button {
  flex: 0 0 auto;
  color: #fff;
  background: rgb(255 255 255 / 14%);
  border-color: rgb(255 255 255 / 24%);
}

.my-cases-header .eyebrow,
.my-cases-header h1,
.my-cases-header p {
  color: #fff;
}

.my-cases-header .eyebrow {
  opacity: 0.78;
}

.my-cases-header h1 {
  margin-top: 3px;
  font-size: 30px;
}

.my-cases-header p {
  opacity: 0.72;
}

.my-cases-empty,
.my-case-card {
  position: relative;
  overflow: hidden;
  border-color: #d8e4ef;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgb(32 70 108 / 8%);
}

.my-case-card {
  padding: 20px;
}

.my-case-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #155eef, #20b7c7);
}

@media (hover: hover) {
  .metric-card.ant-card,
  .admin-card.ant-card,
  .my-case-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  }

  .metric-card.ant-card:hover,
  .admin-card.ant-card:hover,
  .my-case-card:hover {
    border-color: #c4d8eb;
    box-shadow: 0 20px 44px rgb(32 70 108 / 11%);
    transform: translateY(-2px);
  }
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .login-shell {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 42px max(22px, calc((100vw - 620px) / 2));
  }

  .login-showcase {
    justify-items: center;
    text-align: center;
  }

  .login-showcase__mark {
    margin-bottom: 18px;
  }

  .login-showcase__features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 22px;
  }

  .login-panel {
    max-width: 560px;
    justify-self: center;
  }

  .chat-topbar {
    padding-inline: 14px;
  }

  .chat-intro {
    align-content: start;
    gap: 14px;
    padding: 24px 20px 18px;
  }

  .chat-intro h1 {
    font-size: clamp(30px, 8vw, 42px);
  }

  .chat-prompts .antdx-prompts-list {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    display: block;
  }

  .admin-sider,
  .admin-layout .admin-sider.ant-layout-sider {
    position: static;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: auto;
  }

  .admin-layout .admin-menu.ant-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding-inline: 12px;
  }

  .admin-layout .admin-header.ant-layout-header,
  .admin-header {
    position: static;
    padding: 18px 20px;
  }

  .admin-layout .admin-content.ant-layout-content,
  .admin-content {
    padding: 20px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .login-shell {
    gap: 26px;
    padding: 28px 18px;
  }

  .login-showcase__mark {
    width: 56px;
    height: 56px;
    border-radius: 18px;
  }

  .login-showcase h1 {
    margin-block: 10px 12px;
    font-size: 36px;
  }

  .login-showcase > p {
    font-size: 15px;
  }

  .login-showcase__features {
    display: none;
  }

  .login-panel {
    padding: 26px 22px;
    border-radius: 22px;
  }

  .login-shell--public .login-panel {
    padding-block: 32px;
    transform: translateY(-30px);
  }

  .login-shell--public .login-form {
    gap: 22px;
  }

  .login-shell--public .login-submit {
    margin-top: 12px;
  }

  .chat-topbar__brand {
    width: calc(100% - 132px);
    max-width: calc(100% - 132px);
    justify-content: center;
  }

  .chat-topbar__logo {
    width: 42px;
  }

  .chat-topbar__title {
    font-size: 14px;
  }

  .chat-intro__features {
    gap: 7px;
  }

  .chat-intro__features span {
    padding: 6px 9px;
    font-size: 12px;
  }

  .admin-header__meta {
    display: none;
  }

  .admin-layout .admin-menu.ant-menu,
  .metric-grid,
  .health-grid {
    grid-template-columns: 1fr;
  }

  .admin-brand {
    padding-block: 20px 16px;
  }

  .my-cases-shell {
    width: min(100% - 24px, 980px);
    padding-top: 18px;
  }

  .my-cases-header {
    align-items: flex-start;
    padding: 20px 18px;
    border-radius: 18px;
  }

  .my-cases-header h1 {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-input,
  .login-submit,
  .chat-prompts .antdx-prompt,
  .metric-card.ant-card,
  .admin-card.ant-card,
  .my-case-card {
    transition: none;
  }
}
