:root {
  --engap-sidebar-width: 340px;
  --engap-sidebar-bg: rgba(244, 247, 250, 0.96);
  --engap-sidebar-border: rgba(20, 78, 92, 0.14);
  --engap-sidebar-shadow: 0 24px 60px rgba(20, 49, 64, 0.14);
  --engap-accent: #0f766e;
  --engap-accent-soft: #d6f3ee;
  --engap-text: #14212b;
  --engap-muted: #334155;
  --engap-card: rgba(255, 255, 255, 0.86);
}

body .message-content {
  color: var(--engap-text);
  font-size: 15px;
  line-height: 1.68;
}

body .text-muted-foreground {
  color: #334155 !important;
}

body input::placeholder,
body textarea::placeholder {
  color: #334155 !important;
  opacity: 1;
}

/* Chainlit TaskList is a right-side runtime panel. Keep it dismissible without
   cancelling the server-side task; a new quant run id makes the panel visible again. */
aside.tasklist.mx-tasklist-dismissed,
aside.tasklist-mobile.mx-tasklist-dismissed {
  display: none !important;
}

.mx-tasklist-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-left: 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #334155;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.mx-tasklist-close:hover,
.mx-tasklist-close:focus-visible {
  background: #f1f5f9;
  color: #0f172a;
  outline: none;
}

/* Hide Chainlit welcome screen avatar */
body:not(.mx-login-page) img[alt="logo"][src*="model-xiansheng"] {
  display: none !important;
}
body:not(.mx-login-page) .flex.items-center.justify-center > img[src*="model-xiansheng"] {
  display: none !important;
}

body .message-content > :first-child {
  margin-top: 0 !important;
}

body .message-content > :last-child {
  margin-bottom: 0 !important;
}

body .message-content h1,
body .message-content h2,
body .message-content h3,
body .message-content h4,
body .message-content h5,
body .message-content h6 {
  margin: 12px 0 8px !important;
  color: #1f1712;
  line-height: 1.24 !important;
  letter-spacing: -0.01em;
}

body .message-content h1 {
  font-size: 1.65rem !important;
  font-weight: 800 !important;
}

body .message-content h2 {
  font-size: 1.4rem !important;
  font-weight: 800 !important;
}

body .message-content h3 {
  font-size: 1.2rem !important;
  font-weight: 750 !important;
}

body .message-content h4,
body .message-content h5,
body .message-content h6 {
  font-size: 1rem !important;
  font-weight: 700 !important;
}

body .message-content p,
body .message-content ul,
body .message-content ol,
body .message-content pre,
body .message-content blockquote,
body .message-content table,
body .message-content hr {
  margin: 0 0 8px !important;
}

body .message-content ul,
body .message-content ol {
  padding-left: 1.3em !important;
}

body .message-content li + li {
  margin-top: 2px;
}

body .message-content pre {
  padding: 10px 12px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
}

body .message-content code {
  font-size: 13px;
}

body .message-content :not(pre) > code {
  font-size: 15px;
  font-weight: 600;
  padding: 0 2px;
  background: transparent;
  color: #4a2a17;
}

body .message-content blockquote {
  padding: 4px 0 4px 12px;
  border-left: 3px solid rgba(159, 74, 44, 0.35);
  background: rgba(240, 249, 250, 0.82);
}

body .message-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

body .message-content th,
body .message-content td {
  padding: 8px 10px !important;
  vertical-align: top;
}

body .message-content img {
  margin: 8px 0;
  border-radius: 12px;
  max-width: 100%;
}

/* Chainlit wraps each inline image element (cl.Image display="inline", e.g. K线图产物)
   in <div class="rounded-sm bg-accent overflow-hidden">. In light theme bg-accent =
   #f2f2f2, which paints a gray frame around the otherwise-white chart image — visible
   as "一个灰色框框包裹图片". img.inline-image is Chainlit's stable class for these
   elements, so its direct parent is exactly that wrapper; make it transparent. */
body div:has(> img.inline-image) {
  background-color: transparent;
}

/* Markdown element polish for the restored-thread (history) and export (PNG/PDF) views,
   mirroring .message-content so a historical answer renders identically to the live
   window once renderMarkdownHtml rebuilds it from plain text. Additive only. */
.engap-restored-content table,
.engap-export-html table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.engap-restored-content th,
.engap-restored-content td,
.engap-export-html th,
.engap-export-html td {
  border: 1px solid rgba(124, 92, 53, 0.22);
  padding: 8px 10px;
  vertical-align: top;
}

.engap-restored-content thead th,
.engap-export-html thead th {
  background: rgba(244, 237, 226, 0.7);
  font-weight: 700;
}

.engap-restored-content blockquote,
.engap-export-html blockquote {
  padding: 4px 0 4px 12px;
  border-left: 3px solid rgba(159, 74, 44, 0.35);
  background: rgba(240, 249, 250, 0.82);
}

.engap-restored-content pre,
.engap-export-html pre {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(40, 28, 20, 0.05);
  font-size: 13px;
  line-height: 1.55;
  overflow-x: auto;
}

.engap-restored-content code,
.engap-export-html code {
  font-size: 13px;
}

.engap-restored-content :not(pre) > code,
.engap-export-html :not(pre) > code {
  font-weight: 600;
  color: #4a2a17;
}

.engap-restored-content ul,
.engap-export-html ul,
.engap-restored-content ol,
.engap-export-html ol {
  padding-left: 1.3em;
}

body[data-engap-sidebar="open"] .engap-main-shell {
  padding-left: var(--engap-sidebar-width);
  transition: padding-left 180ms ease;
}

body[data-engap-sidebar="closed"] .engap-main-shell {
  padding-left: 0;
  transition: padding-left 180ms ease;
}

#engap-shell {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  pointer-events: none;
}

#engap-toggle {
  position: fixed;
  left: 0;
  top: 52vh;
  transform: translateY(-50%);
  z-index: 62;
  pointer-events: auto;
  border: 1px solid var(--engap-sidebar-border);
  background: rgba(249, 252, 253, 0.94);
  color: var(--engap-text);
  border-left: 0;
  border-radius: 0 16px 16px 0;
  padding: 14px 10px;
  min-height: 120px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(67, 46, 25, 0.14);
  backdrop-filter: blur(12px);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.08em;
  transition: left 180ms ease, transform 180ms ease, background 180ms ease;
}

#engap-toggle:hover {
  background: #f4fbfb;
}

body[data-engap-sidebar="open"] #engap-toggle {
  left: calc(var(--engap-sidebar-width) - 1px);
}

#engap-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--engap-sidebar-width);
  height: 100vh;
  padding: 12px 12px 10px;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 164, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(238, 247, 250, 0.96));
  border-right: 1px solid var(--engap-sidebar-border);
  box-shadow: var(--engap-sidebar-shadow);
  transform: translateX(calc(-1 * var(--engap-sidebar-width) - 12px));
  transition: transform 180ms ease;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

body[data-engap-sidebar="open"] #engap-sidebar {
  transform: translateX(0);
}

.engap-sidebar-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-bottom: 4px;
}

.engap-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(159, 74, 44, 0.14);
  color: var(--engap-accent);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.engap-sidebar-title {
  margin: 0;
  color: var(--engap-text);
  font-size: 16px;
  line-height: 1.1;
  flex: 1;
}

.engap-toolbar,
.engap-account-card,
.engap-history-card {
  border: 1px solid rgba(126, 96, 68, 0.12);
  background: var(--engap-card);
  border-radius: 14px;
  backdrop-filter: blur(10px);
}

.engap-account-card {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.engap-account-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.engap-account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.engap-account-label {
  display: block;
  color: var(--engap-muted);
  font-size: 11px;
  margin-bottom: 2px;
}

.engap-status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.engap-status-badge[data-status="active"] {
  background: #dcfce7;
  color: #166534;
}

.engap-status-badge[data-status="expired"] {
  background: #fee2e2;
  color: #991b1b;
}

.engap-status-badge[data-status="quota_exhausted"] {
  background: #ffedd5;
  color: #9a3412;
}

.engap-status-badge[data-status="inactive"] {
  background: #e2e8f0;
  color: #334155;
}

.engap-status-badge[data-status="security_blocked"] {
  background: #991b1b;
  color: #fff;
}

.engap-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(124, 92, 53, 0.16);
  background: rgba(255, 255, 255, 0.92);
  color: var(--engap-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.engap-link-btn:hover {
  background: #f7fbfe;
}

.engap-account-footer {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.engap-account-footer .engap-link-btn {
  flex: 1;
}

.engap-account-action {
  background: #fff7ed;
  border-color: rgba(154, 52, 18, 0.28);
  color: #9a3412;
  cursor: pointer;
}

.engap-account-action:hover {
  background: #ffedd5;
}

.engap-logout-btn {
  color: #991b1b !important;
  border-color: rgba(153, 27, 27, 0.15) !important;
}

.engap-logout-btn:hover {
  background: #fef2f2 !important;
}

.engap-toolbar {
  padding: 8px;
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex-shrink: 0;
}

.engap-toolbar .engap-btn {
  flex: 1;
}

.engap-btn,
.engap-select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 53, 0.16);
  padding: 8px 10px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--engap-text);
}

.engap-btn {
  cursor: pointer;
  font-weight: 600;
}

.engap-btn-primary {
  background: linear-gradient(135deg, #0f766e, #2563eb);
  border-color: #0f766e;
  color: #fff;
}

.engap-btn-secondary:hover,
.engap-btn:hover {
  background: #f7fbfe;
}

.engap-card-title {
  margin: 0;
  color: var(--engap-text);
  font-size: 13px;
  font-weight: 700;
}

.engap-card-meta {
  margin: 0;
  color: var(--engap-muted);
  font-size: 11px;
  line-height: 1.4;
}

.engap-history-card {
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.engap-history-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.engap-history-head .engap-card-title {
  flex: 1;
  font-size: 14px;
}

.engap-history-warning {
  margin: 0 0 8px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 251, 235, 0.88);
  color: #92400e;
  font-size: 11px;
  line-height: 1.45;
  flex-shrink: 0;
}

.engap-select-mini {
  width: auto;
  min-width: 62px;
  padding: 3px 6px;
  font-size: 11px;
  border-radius: 6px;
}

.engap-btn-icon {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(124, 92, 53, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.engap-btn-icon:hover {
  background: #f7fbfe;
}

.engap-export-trigger {
  width: auto;
  max-width: 138px;
  padding: 0 8px;
  gap: 5px;
  justify-content: flex-start;
}

.engap-export-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  font-size: 13px;
  line-height: 1;
}

.engap-export-label {
  min-width: 0;
  overflow: hidden;
  color: var(--engap-text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engap-history-scroll-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.engap-session-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  max-height: 100%;
  padding-right: 4px;
  padding-bottom: 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 118, 110, 0.22) transparent;
}

.engap-session-list::-webkit-scrollbar {
  width: 6px;
}

.engap-session-list::-webkit-scrollbar-track {
  background: transparent;
}

.engap-session-list::-webkit-scrollbar-thumb {
  background: rgba(15, 118, 110, 0.22);
  border-radius: 6px;
}

.engap-scroll-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 6px;
  height: 36px;
  background: linear-gradient(transparent, rgba(248, 250, 252, 0.98));
  pointer-events: none;
  z-index: 1;
}

.engap-session-item {
  border: 1px solid rgba(124, 92, 53, 0.08);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  text-align: left;
  transition: background 120ms ease, border-color 120ms ease;
}

.engap-session-item:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(159, 74, 44, 0.25);
}

.engap-session-item[data-active="true"] {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.06);
}

.engap-session-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.engap-session-label {
  color: var(--engap-text);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.engap-session-badge {
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--engap-accent-soft);
  color: var(--engap-accent);
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
}

.engap-session-preview,
.engap-session-time,
.engap-empty {
  color: var(--engap-muted);
  font-size: 11px;
  line-height: 1.4;
}

.engap-session-time {
  display: block;
  margin-top: 1px;
}

.engap-empty {
  text-align: center;
  padding: 24px 0;
  color: var(--engap-muted);
}

.mx-login-page {
  background: #f6f8f7;
}

.mx-login-page #root > .grid.min-h-svh.lg\:grid-cols-2,
.mx-login-grid {
  min-height: 100vh;
  background: #f6f8f7;
}

.mx-login-brand-logo {
  display: none !important;
}

/* ===== DUAL-COLUMN LAYOUT ===== */
/* Left: login + register | Right: product intro | Vertical divider */
body.mx-login-page .grid.min-h-svh,
body.mx-login-page [class*="grid-cols-2"][class*="min-h"] {
  grid-template-columns: 1fr 1fr !important;
}
.mx-login-dual-col {
  grid-template-columns: 1fr 1fr !important;
  position: relative;
}
/* Vertical divider between columns */
.mx-login-dual-col::after {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, #d0d0d0 20%, #d0d0d0 80%, transparent);
  z-index: 2;
  pointer-events: none;
}

.mx-login-page .flex.flex-col.gap-4.p-6.md\:p-10,
.mx-login-form-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 16px 16px !important;
  background: linear-gradient(180deg, #fafaf8, #f5f3ef);
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.mx-login-page .flex.flex-1.items-center.justify-center,
.mx-login-form-center {
  align-items: center !important;
  justify-content: center !important;
  flex: 0 1 auto !important;
  width: 100%;
}

.mx-login-form-shell {
  width: min(100%, 400px) !important;
  max-width: 400px !important;
  padding: 24px 28px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.mx-login-form-shell form {
  gap: 14px !important;
}

.mx-login-form-shell form > .grid.gap-6 {
  gap: 14px !important;
}

.mx-login-form-shell h1 {
  display: none;
}

.mx-login-form-shell input {
  border-radius: 8px !important;
  min-height: 42px;
  font-size: 15px;
}

.mx-login-form-shell button[type="submit"] {
  min-height: 42px;
  border-radius: 8px !important;
  font-weight: 700;
  font-size: 15px;
}

.mx-login-form-note {
  margin: 8px 0 0;
  color: var(--engap-muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.mx-login-auth-notice {
  margin: 0 0 14px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}
.mx-login-auth-toast {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 100000;
  max-width: min(560px, calc(100vw - 32px));
  transform: translate(-50%, -16px);
  opacity: 0;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  padding: 14px 18px;
  background: #991b1b;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  box-shadow: 0 18px 40px rgba(153, 27, 27, 0.28);
  transition: opacity 180ms ease, transform 180ms ease;
  text-align: center;
}
.mx-login-auth-toast--show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===== RIGHT PANEL: product intro ===== */
.mx-login-right-panel {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #faf9f7 0%, #f3f0eb 100%);
  overflow-y: auto;
  padding: 40px 48px;
}

.mx-login-right-inner {
  max-width: 600px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ===== LEFT COLUMN: registration section ===== */
.mx-login-left-reg {
  width: 100%;
  max-width: 94vw;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mx-login-visual-panel {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  flex: 1 1 52%;
  padding: 0;
  overflow: hidden;
  background: #eef5f2;
  isolation: isolate;
}

.mx-login-visual-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(7, 31, 36, 0.2), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(2, 44, 34, 0.12));
  pointer-events: none;
}

.mx-login-hero-image {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.96) contrast(1.02);
}

.mx-login-note {
  width: min(100%, 700px);
  margin: 0 auto;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  color: var(--engap-text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05);
}

/* ===== V2: no-card, wider, bigger — unused, kept for fallback ===== */
.mx-login-note.mx-login-v2 {
  width: min(100%, 820px);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border: none;
}

.mx-login-hero-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mx-login-hero-kicker {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 18px;
  background: rgba(165, 76, 29, 0.08);
  color: rgb(165, 76, 29);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.mx-login-hero-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 900;
  color: #111;
}

.mx-login-hero-desc {
  margin: 0;
  color: #3f3f46;
  font-size: 17px;
  line-height: 1.65;
}

.mx-login-hero-desc strong {
  color: rgb(165, 76, 29);
}

/* --- Capabilities: single-line items --- */
.mx-login-capabilities {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mx-login-cap-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(165, 76, 29, 0.03);
  border: 1px solid rgba(165, 76, 29, 0.05);
  font-size: 15px;
  color: #555;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mx-login-cap-item strong {
  font-size: 15px;
  color: #222;
  font-weight: 700;
}

.mx-login-cap-icon {
  font-size: 26px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* --- Divider --- */
.mx-login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #334155;
  font-size: 15px;
}

.mx-login-divider::before,
.mx-login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e5e5;
}

/* --- Registration flow --- */
.mx-login-flow {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mx-login-flow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.mx-login-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.05);
  min-width: 80px;
  width: 80px;
  height: 72px;
}

.mx-login-flow-step--highlight {
  background: rgb(165, 76, 29);
  border-color: rgb(165, 76, 29);
}

.mx-login-flow-step--highlight .mx-login-flow-num {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.mx-login-flow-step--highlight .mx-login-flow-label {
  color: #fff;
}

.mx-login-flow-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(165, 76, 29, 0.1);
  color: rgb(165, 76, 29);
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mx-login-flow-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

.mx-login-flow-label small {
  color: #334155;
  font-weight: 400;
}

.mx-login-flow-arrow {
  color: #7f351d;
  font-size: 20px;
  font-weight: 700;
}

.mx-login-register-btn {
  display: inline-block;
  text-align: center;
  padding: 14px 32px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, rgb(165, 76, 29), rgb(192, 96, 40));
  color: #fff !important;
  font-size: 17px;
  font-weight: 800;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(165, 76, 29, 0.25);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.mx-login-register-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(165, 76, 29, 0.35);
}

.mx-login-flow-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.mx-login-v2 .mx-login-flow-actions {
  gap: 24px;
}

.mx-login-board {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 80;
  display: none;
  align-items: center;
  width: min(860px, calc(100vw - 32px));
  min-height: 40px;
  transform: translateX(-50%);
  border: 1px solid rgba(165, 76, 29, 0.16);
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.96);
  padding: 7px 12px 7px 16px;
  box-shadow: 0 12px 28px rgba(54, 34, 20, 0.1);
  backdrop-filter: blur(10px);
}

.mx-login-board--visible {
  display: flex;
}

.mx-login-board-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex: 0 0 auto;
  margin: 0 12px 0 0;
}

.mx-login-board-title {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 800;
  color: #2f2118;
  white-space: nowrap;
}

.mx-login-board-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  font-size: 12px;
  color: #5f4635;
  white-space: nowrap;
}

.mx-login-board-live span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a54c1d;
  box-shadow: 0 0 0 0 rgba(165, 76, 29, 0.35);
  animation: mx-login-board-pulse 1.7s ease-out infinite;
}

.mx-login-board-live em {
  font-style: normal;
}

.mx-login-board--loading .mx-login-board-live em {
  color: #a54c1d;
}

.mx-login-board--error .mx-login-board-live span {
  background: #8a7462;
  animation: none;
}

.mx-login-board-list {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  overflow: hidden;
}

.mx-login-board-list:hover .mx-login-board-items--marquee {
  animation-play-state: paused;
}

.mx-login-board-items {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: max-content;
  gap: 10px;
}

.mx-login-board-items--marquee {
  animation: mx-login-board-marquee 28s linear infinite;
}

.mx-login-board-row {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(165, 76, 29, 0.08);
}

.mx-login-board-name {
  min-width: 0;
  overflow: hidden;
  color: #2f2118;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mx-login-board-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.mx-login-board-row--signup .mx-login-board-badge {
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
}

.mx-login-board-row--pending .mx-login-board-badge {
  background: rgba(250, 204, 21, 0.25);
  color: #a16207;
}

.mx-login-board-row--approved .mx-login-board-badge {
  background: rgba(21, 128, 36, 0.1);
  color: #15803d;
}

.mx-login-board-row--rejected .mx-login-board-badge {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.mx-login-board-reason {
  color: #b91c1c;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  max-width: 180px;
  text-overflow: ellipsis;
}

.mx-login-board-row--renewed .mx-login-board-badge {
  background: rgba(29, 78, 216, 0.1);
  color: #1d4ed8;
}

.mx-login-board-row--upgraded .mx-login-board-badge {
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
}

.mx-login-board-meta {
  min-width: 0;
  overflow: hidden;
  color: #5f4635;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes mx-login-board-pulse {
  0% { box-shadow: 0 0 0 0 rgba(165, 76, 29, 0.35); }
  70% { box-shadow: 0 0 0 8px rgba(165, 76, 29, 0); }
  100% { box-shadow: 0 0 0 0 rgba(165, 76, 29, 0); }
}

@keyframes mx-login-board-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.mx-login-qr-inline {
  display: flex;
  gap: 20px;
}

.mx-login-qr-buttons {
  display: flex;
  gap: 12px;
}

.mx-login-qr-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.1);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.mx-login-qr-btn:hover {
  background: #f5f5f5;
  border-color: rgba(165, 76, 29, 0.3);
}

.mx-login-qr-btn-icon {
  font-size: 16px;
}

.mx-login-qr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mx-login-qr-item img {
  width: 110px;
  height: 110px;
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,0.08);
  background: #fff;
}

.mx-login-qr-item span {
  font-size: 13px;
  color: #334155;
  font-weight: 500;
}

/* --- Daily market summary card --- */
.mx-login-summary {
  padding: 20px 24px;
  border-radius: 14px;
  background: rgba(165, 76, 29, 0.04);
  border: 1px solid rgba(165, 76, 29, 0.08);
}

.mx-login-summary-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 700;
  color: rgb(165, 76, 29);
}

.mx-login-summary-date {
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  color: #334155;
}

.mx-login-summary-text {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
  max-height: 96px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

/* ===== QR MODAL ===== */
.mx-qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mx-qr-fadein 200ms ease;
}
@keyframes mx-qr-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}
.mx-qr-card {
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 36px 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  max-width: 90vw;
}
.mx-qr-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 20px;
  color: #334155;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.mx-qr-close:hover {
  background: #f0f0f0;
  color: #333;
}
.mx-qr-title {
  font-size: 18px;
  font-weight: 700;
  color: #222;
}
.mx-qr-img {
  width: 280px;
  height: 280px;
  border-radius: 12px;
  border: 2px solid rgba(0,0,0,0.08);
  background: #fff;
  object-fit: contain;
}
.mx-qr-hint {
  font-size: 14px;
  color: #334155;
}

.engap-qr-float {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 80;
  pointer-events: auto;
}

.engap-qr-trigger {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 18px 38px rgba(20, 49, 64, 0.2);
}

.engap-qr-panel {
  position: absolute;
  right: 0;
  bottom: 66px;
  display: grid;
  grid-template-columns: repeat(2, 300px);
  gap: 16px;
  padding: 16px;
  max-width: 96vw;
  /* 防止码数增多后高度冲出视口：上限=视口高-触发按钮(54)-底部偏移(24)-余量，
     超过就面板内滚动。原来没这层兜底，3 个码 2 行直接顶出屏幕且无法滑。 */
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(126, 96, 68, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 56px rgba(20, 49, 64, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.engap-qr-float:hover .engap-qr-panel,
.engap-qr-float:focus-within .engap-qr-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 点击/触摸切换：手机没有可靠 hover，必须 click 兜底；桌面也受益——
   点击常驻显示，点击面板外自动关闭。.engap-qr-open 由 JS 切换。 */
.engap-qr-float.engap-qr-open .engap-qr-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.engap-qr-item {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--engap-text);
  font-size: 12px;
  font-weight: 700;
}

.engap-qr-item img {
  width: 300px;
  height: 300px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.engap-export-thread,
.engap-restored-thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.engap-export-message,
.engap-restored-message {
  border-radius: 20px;
  padding: 16px 18px;
  border: 1px solid rgba(124, 92, 53, 0.12);
  background: rgba(255, 255, 255, 0.84);
}

.engap-export-message[data-role="user"],
.engap-restored-message[data-role="user"] {
  background: linear-gradient(135deg, #e8f4ff, #e7f8f1);
}

.engap-export-role,
.engap-restored-role {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--engap-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.engap-export-html,
.engap-restored-content {
  color: var(--engap-text);
  font-size: 15px;
  line-height: 1.7;
  word-break: break-word;
}

.engap-export-html p,
.engap-export-html ul,
.engap-export-html ol,
.engap-export-html pre,
.engap-export-html blockquote,
.engap-export-html table,
.engap-export-html h1,
.engap-export-html h2,
.engap-export-html h3,
.engap-export-html h4,
.engap-export-html h5,
.engap-export-html h6,
.engap-restored-content p,
.engap-restored-content ul,
.engap-restored-content ol,
.engap-restored-content pre,
.engap-restored-content blockquote,
.engap-restored-content table,
.engap-restored-content h1,
.engap-restored-content h2,
.engap-restored-content h3,
.engap-restored-content h4,
.engap-restored-content h5,
.engap-restored-content h6 {
  margin: 0 0 12px;
}

.engap-export-html h1,
.engap-restored-content h1,
.engap-export-html h2,
.engap-restored-content h2,
.engap-export-html h3,
.engap-restored-content h3,
.engap-export-html h4,
.engap-restored-content h4,
.engap-export-html h5,
.engap-restored-content h5,
.engap-export-html h6,
.engap-restored-content h6 {
  line-height: 1.24;
  letter-spacing: -0.01em;
}

.engap-export-html h1,
.engap-restored-content h1 {
  font-size: 1.6rem;
  font-weight: 800;
}

.engap-export-html h2,
.engap-restored-content h2 {
  font-size: 1.36rem;
  font-weight: 800;
}

.engap-export-html h3,
.engap-restored-content h3 {
  font-size: 1.18rem;
  font-weight: 750;
}

.engap-export-html h4,
.engap-export-html h5,
.engap-export-html h6,
.engap-restored-content h4,
.engap-restored-content h5,
.engap-restored-content h6 {
  font-size: 1rem;
  font-weight: 700;
}

.engap-export-html p:last-child,
.engap-export-html ul:last-child,
.engap-export-html ol:last-child,
.engap-export-html pre:last-child,
.engap-export-html blockquote:last-child,
.engap-export-html table:last-child,
.engap-export-html h1:last-child,
.engap-export-html h2:last-child,
.engap-export-html h3:last-child,
.engap-export-html h4:last-child,
.engap-export-html h5:last-child,
.engap-export-html h6:last-child,
.engap-restored-content p:last-child,
.engap-restored-content ul:last-child,
.engap-restored-content ol:last-child,
.engap-restored-content pre:last-child,
.engap-restored-content blockquote:last-child,
.engap-restored-content table:last-child,
.engap-restored-content h1:last-child,
.engap-restored-content h2:last-child,
.engap-restored-content h3:last-child,
.engap-restored-content h4:last-child,
.engap-restored-content h5:last-child,
.engap-restored-content h6:last-child {
  margin-bottom: 0;
}

.engap-export-html ul,
.engap-export-html ol,
.engap-restored-content ul,
.engap-restored-content ol {
  padding-left: 1.5em;
}

.engap-export-html pre,
.engap-restored-content pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: rgba(48, 33, 23, 0.92);
  color: #f8f5ee;
  padding: 14px;
  border-radius: 14px;
}

.engap-export-html code,
.engap-restored-content code {
  font-size: 13px;
}

.engap-export-html :not(pre) > code,
.engap-restored-content :not(pre) > code {
  font-size: 15px;
  font-weight: 600;
  padding: 0 2px;
  background: transparent;
  color: #4a2a17;
}

.engap-export-html blockquote,
.engap-restored-content blockquote {
  border-left: 4px solid rgba(159, 74, 44, 0.35);
  padding: 4px 0 4px 14px;
  color: #64493b;
  background: rgba(255, 249, 242, 0.74);
}

.engap-export-html table,
.engap-restored-content table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
}

.engap-export-html th,
.engap-export-html td,
.engap-restored-content th,
.engap-restored-content td {
  padding: 10px 12px;
  border: 1px solid rgba(124, 92, 53, 0.14);
  text-align: left;
  vertical-align: top;
}

.engap-export-html th,
.engap-restored-content th {
  background: rgba(159, 74, 44, 0.08);
}

.engap-export-html a,
.engap-restored-content a {
  color: var(--engap-accent);
}

.engap-export-html img,
.engap-restored-content img {
  display: block;
  max-width: 100%;
  border-radius: 16px;
}

.engap-restored-thread {
  width: min(100%, 920px);
  margin: 0 auto 24px;
}

.engap-restored-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(159, 74, 44, 0.18);
  background: linear-gradient(135deg, rgba(231, 245, 255, 0.96), rgba(233, 250, 244, 0.96));
  color: var(--engap-text);
}

.engap-restored-banner strong {
  font-size: 15px;
}

.engap-restored-banner span {
  color: var(--engap-muted);
  font-size: 12px;
}

/* ── 额度耗尽引导横幅 ── */
.engap-quota-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 14px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(255, 243, 210, 0.98));
  border-bottom: 2px solid rgba(234, 88, 12, 0.25);
  box-shadow: 0 6px 24px rgba(234, 88, 12, 0.10);
  backdrop-filter: blur(10px);
  animation: engap-banner-slide 320ms ease;
}

.engap-security-notice {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px max(18px, env(safe-area-inset-right)) 14px max(18px, env(safe-area-inset-left));
  border-bottom: 2px solid #c2410c;
  background: #fff7ed;
  color: #7c2d12;
  box-shadow: 0 8px 24px rgba(124, 45, 18, 0.16);
}

.engap-security-notice--blocked {
  inset: 0;
  z-index: 100001;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 0;
  background: rgba(254, 242, 242, 0.98);
  color: #7f1d1d;
}

.engap-security-mark {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #c2410c;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}

.engap-security-notice--blocked .engap-security-mark {
  flex-basis: 42px;
  width: 42px;
  height: 42px;
  background: #991b1b;
  font-size: 25px;
}

.engap-security-body {
  min-width: 0;
  max-width: 880px;
}

.engap-security-body h2 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

.engap-security-body p {
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.engap-security-notice--blocked .engap-security-body {
  max-width: 620px;
}

.engap-security-notice--blocked .engap-security-body h2 {
  font-size: 22px;
}

.engap-security-notice--blocked .engap-security-body p {
  font-size: 15px;
}

.engap-security-reason,
.engap-security-until {
  font-weight: 700;
}

.engap-security-logout {
  min-height: 40px;
  margin-top: 14px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: #991b1b;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 640px) {
  .engap-security-notice--blocked {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes engap-banner-slide {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============ 全站广播：顶部跑马灯（窄/半透明/可关闭） ============ */
.engap-broadcast-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 88;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  /* 半透明：用户明确要求比旧版"高度窄一点、半透明" */
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.82), rgba(219, 234, 254, 0.82));
  border-bottom: 1px solid rgba(37, 99, 235, 0.22);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: engap-banner-slide 280ms ease;
}
.engap-broadcast-icon {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
.engap-broadcast-marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
  /* 左右渐隐遮罩，强调跑马灯流动感 */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.engap-broadcast-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  /* 无缝循环：track 内容是两份拼接，translateX(-50%) 恰好回到第二份起点 */
  animation: engap-broadcast-marquee 28s linear infinite;
  will-change: transform;
}
.engap-broadcast-banner:hover .engap-broadcast-track {
  animation-play-state: paused;
}
@keyframes engap-broadcast-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .engap-broadcast-track { animation: none; }
}
.engap-broadcast-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}
.engap-broadcast-hasimg {
  font-size: 12px;
}
.engap-broadcast-item .engap-broadcast-title {
  margin: 0;
  font-weight: 800;
  color: #1d4ed8;
}
.engap-broadcast-item .engap-broadcast-text {
  margin: 0;
  color: #1e3a8a;
  font-weight: 500;
}
.engap-broadcast-sep {
  display: inline-block;
  margin: 0 12px;
  color: rgba(37, 99, 235, 0.45);
  font-weight: 700;
}
.engap-broadcast-history-btn {
  flex-shrink: 0;
  border: 0;
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  height: 24px;
  padding: 0 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.engap-broadcast-history-btn:hover {
  background: rgba(37, 99, 235, 0.24);
}
.engap-broadcast-close {
  flex-shrink: 0;
  border: 0;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.engap-broadcast-close:hover {
  background: rgba(37, 99, 235, 0.22);
}
@keyframes engap-banner-slide {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (max-width: 640px) {
  .engap-broadcast-banner { padding: 5px 10px; gap: 8px; }
  .engap-broadcast-item { font-size: 12px; }
  .engap-broadcast-marquee { height: 20px; }
}

/* ============ 顶部栏小喇叭按钮 + 未读红点 ============ */
.mx-broadcast-float { display: inline-flex; }
.mx-broadcast-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 16px;
  line-height: 1;
}
.mx-broadcast-mega { font-size: 17px; }
.mx-broadcast-badge {
  position: absolute;
  top: 0;
  right: -1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #fff;
  line-height: 1;
}

/* ============ 广播历史面板（模态） ============ */
.mx-broadcast-history-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: mx-bcast-fade 200ms ease;
}
@keyframes mx-bcast-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.mx-broadcast-history-card {
  position: relative;
  width: min(560px, 96vw);
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}
.mx-broadcast-history-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
  font-size: 15px;
}
.mx-broadcast-history-close:hover { background: #e2e8f0; }
.mx-broadcast-history-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid #eef2ff;
}
.mx-broadcast-history-header h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}
.mx-broadcast-history-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mx-broadcast-markall {
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.mx-broadcast-markall:hover { background: #e0e7ff; }
.mx-broadcast-history-sub {
  font-size: 12px;
  color: #334155;
  font-weight: 600;
}
.mx-broadcast-history-body {
  padding: 8px 12px 16px;
  overflow-y: auto;
  flex: 1;
}
.mx-bcast-loading,
.mx-bcast-empty {
  text-align: center;
  color: #334155;
  font-size: 13px;
  padding: 28px 0;
}
.mx-bcast-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #eef2ff;
  background: #fff;
  margin-bottom: 8px;
}
.mx-bcast-item-unread {
  border-color: #c7d2fe;
  background: linear-gradient(135deg, #f5f7ff, #eef2ff);
}
.mx-bcast-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mx-bcast-item-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  flex: 1;
  min-width: 0;
  /* 标题单行省略 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mx-bcast-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}
.mx-bcast-item-meta {
  font-size: 11.5px;
  color: #334155;
  font-weight: 600;
}
.mx-bcast-toggle {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  border-radius: 7px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.mx-bcast-toggle:hover { background: #eef2ff; color: #4338ca; }
.mx-bcast-item-preview {
  margin-top: 4px;
  font-size: 13px;
  color: #475569;
  /* 一行省略 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mx-bcast-item-full {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}
.mx-bcast-item-full p {
  margin: 0 0 6px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #1e293b;
  word-break: break-word;
}
.mx-bcast-item-full p a {
  color: #2563eb;
  word-break: break-all;
}
.mx-bcast-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.mx-bcast-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mx-bcast-image:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.engap-quota-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}

.engap-quota-body {
  flex: 1;
  min-width: 0;
}

.engap-quota-title {
  margin: 0 0 4px;
  color: #9a3412;
  font-size: 14px;
  font-weight: 700;
}

.engap-quota-text {
  margin: 0;
  color: #78350f;
  font-size: 13px;
  line-height: 1.5;
}

.engap-quota-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.engap-quota-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  background: rgba(234, 88, 12, 0.10);
  color: #c2410c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.engap-quota-cta:hover {
  background: rgba(234, 88, 12, 0.18);
  transform: translateY(-1px);
}

.engap-quota-cta--primary {
  background: linear-gradient(135deg, #ea580c, #dc2626);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.25);
}

.engap-quota-cta--primary:hover {
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.35);
  transform: translateY(-1px);
}

.engap-quota-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: rgba(234, 88, 12, 0.10);
  color: #c2410c;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 960px) {
  body[data-engap-sidebar="open"] .engap-main-shell {
    padding-left: 0;
  }

  #engap-sidebar {
    width: min(86vw, 340px);
    transform: translateX(-105%);
  }

  #engap-toggle {
    top: auto;
    bottom: 112px;
    left: 0;
    min-height: 96px;
    transform: none;
  }

  body[data-engap-sidebar="open"] #engap-toggle {
    left: calc(min(86vw, 340px) - 1px);
  }

  .mx-login-note {
    width: min(100%, calc(100vw - 32px));
    margin: 0 auto 0;
  }

  .mx-login-copy {
    flex-direction: column;
    gap: 8px;
  }

  .mx-login-page #root > .grid.min-h-svh.lg\:grid-cols-2,
  .mx-login-grid {
    display: block !important;
  }

  .mx-login-dual-col::after {
    display: none !important;
  }

  .mx-login-page .flex.flex-col.gap-4.p-6.md\:p-10,
  .mx-login-form-column {
    padding: 20px 16px !important;
  }

  .mx-login-form-shell {
    width: 100% !important;
    max-width: none !important;
    padding: 22px 18px 20px;
  }

  .mx-login-flow-steps {
    width: 100%;
    gap: 4px;
    justify-content: space-between;
  }

  .mx-login-flow-step {
    width: clamp(58px, 18vw, 80px);
    min-width: 0;
    height: 68px;
    padding: 8px 4px;
  }

  .mx-login-flow-arrow {
    flex: 0 0 auto;
    font-size: 16px;
  }

  .mx-login-flow-label {
    font-size: 11px;
  }

  .mx-login-board {
    top: 8px;
    width: min(100vw - 16px, 640px);
    min-height: 38px;
    padding: 6px 10px 6px 12px;
  }

  .mx-login-board-head {
    align-items: center;
    margin-right: 8px;
  }

  .mx-login-board-title {
    font-size: 12px;
  }

  .mx-login-board-live {
    display: none;
  }

  .mx-login-board-list {
    height: 26px;
  }

  .mx-login-board-row {
    gap: 6px;
    min-height: 24px;
    padding: 3px 8px;
  }

  .mx-login-board-meta {
    max-width: 96px;
  }

  .mx-login-copy {
    padding: 22px;
  }

  .mx-login-visual-panel {
    min-height: 320px;
    padding: 24px;
  }

  .engap-qr-float {
    right: 12px;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .engap-qr-trigger {
    width: 44px;
    height: 44px;
    font-size: 12px;
  }

  .engap-qr-panel {
    grid-template-columns: auto;
    max-height: min(82vh, 600px);
    overflow: auto;
  }

  .engap-qr-item img {
    width: min(78vw, 408px);
    height: min(78vw, 408px);
  }

  /* 手机/窄屏：历史会话区"导出当前对话"按钮收敛为纯图标，避免与"历史会话"标题
     在同一 flex 行挤爆、被侧栏 overflow:hidden 裁掉（桌面 >960px 仍显示文字）。 */
  .engap-history-head .engap-export-trigger {
    width: 32px;
    height: 32px;
    max-width: 32px;
    padding: 0;
    justify-content: center;
  }
  .engap-history-head .engap-export-label {
    display: none;
  }
}

/* 手机端：QR 弹层改为居中 fixed 模态，不再 position:absolute; right:0 贴右
   （旧版导致面板挤在右下角且被视口裁剪，二维码"小到几乎看不见"）。
   尺寸收敛到合理区间，加半透明遮罩聚焦注意力。 */
@media (max-width: 760px) {
  .engap-qr-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%) scale(0.96);
    width: min(92vw, 380px);
    max-width: 92vw;
    max-height: 86vh;
    overflow: auto;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }
  .engap-qr-float.engap-qr-open .engap-qr-panel {
    transform: translate(-50%, -50%) scale(1);
  }
  .engap-qr-item img {
    width: min(64vw, 280px);
    height: min(64vw, 280px);
  }
  /* 模态遮罩：z-index:-1 让它位于 float(80) 内部、trigger/panel 之下，但仍高于页面；
     pointer-events:none 让点击穿透到页面元素 → 触发 document click 监听关闭面板。 */
  .engap-qr-float.engap-qr-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    pointer-events: none;
  }
}

/* ========== Changelog Button & Modal ========== */
#readme-button,
#theme-toggle {
  display: none !important;
}

/* Shared history-video button geometry; detailed colors are declared below. */
.mx-videos-trigger {
  height: 32px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Fallback only: when the header isn't ready yet and the button is briefly
   attached to <body>. Once embedded in #header, the .mx-changelog-in-header
   rules below override these. */
.mx-changelog-float {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 85;
  pointer-events: auto;
}

/* Embedded inside Chainlit's top bar (#header) as a normal flex child of the
   right-side button group, sitting just left of the "说明" button. No
   fixed/absolute positioning — it does not float because the header itself is
   pinned at the top of the chat layout and does not scroll. */
.mx-changelog-float.mx-changelog-in-header {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  z-index: auto;
  display: inline-flex;
  align-items: center;
}

.mx-changelog-trigger {
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f766e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(8px);
  transition: box-shadow 0.2s, background 0.2s;
}

.mx-changelog-trigger:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  background: #fff;
}

.mx-changelog-trigger .mx-changelog-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0f766e;
  display: inline-block;
}

.mx-changelog-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mx-qr-fadein 200ms ease;
}

.mx-changelog-card {
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 32px 36px 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  max-width: 440px;
  width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.mx-changelog-card .mx-qr-close {
  top: 10px;
  right: 12px;
}

.mx-changelog-header {
  text-align: center;
  margin-bottom: 4px;
}

.mx-changelog-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin: 0 0 4px;
}

.mx-changelog-header p {
  font-size: 12px;
  color: #334155;
  margin: 0;
}

.mx-changelog-body {
  overflow-y: auto;
  flex: 1;
  margin-top: 12px;
}

.mx-changelog-version {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.mx-changelog-version:first-child {
  padding-top: 4px;
}

.mx-changelog-version:last-child {
  border-bottom: none;
}

.mx-changelog-version-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0f766e;
  margin-bottom: 8px;
}

.mx-changelog-version-date {
  font-size: 12px;
  color: #334155;
  font-weight: 400;
}

.mx-changelog-item {
  font-size: 13px;
  line-height: 1.6;
  color: #444;
  padding: 3px 0;
}

@media (max-width: 640px) {
  .mx-changelog-float {
    top: 60px;
    right: 12px;
  }

  .mx-changelog-trigger {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
  }

  .mx-changelog-card {
    padding: 24px 20px 20px;
    max-width: 95vw;
  }
}

/* 手机端顶部自定义按钮：videos/research 此前无 mobile compact 规则，
   与 changelog/kline(已压缩) 不一致 → 4 个按钮在 #header 里挤爆。
   统一压到 28px 高/10px 内边距/12px 字，与 changelog/kline 对齐。
   #header 允许横向滚动作为兜底，防按钮被裁切（侧滑仍可点到）。 */
@media (max-width: 640px) {
  .mx-changelog-in-header,
  .mx-big-v-opinions-in-header {
    display: none !important;
  }

  .mx-kline-tool-entry {
    display: inline-flex !important;
    flex: 0 0 auto;
  }

  .mx-kline-tool-trigger {
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
  }

  .mx-videos-trigger,
  .mx-research-trigger,
  .mx-big-v-opinions-trigger {
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 12px;
    gap: 3px;
    line-height: 1 !important;
    white-space: nowrap;
  }

  .mx-broadcast-trigger {
    width: 28px;
    height: 28px;
    padding: 3px;
  }

  #header {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  #header::-webkit-scrollbar { display: none; }

}

/* ========== Export Modal ========== */
#engap-export-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
}
#engap-export-modal {
  background: #fff;
  border-radius: 12px;
  width: 520px;
  max-width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.engap-export-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  font-size: 16px;
  font-weight: 600;
}
.engap-export-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  color: #334155;
}
.engap-export-modal-close:hover {
  background: #f0f0f0;
  color: #333;
}
.engap-export-modal-hint {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 12px 20px 8px;
  padding: 10px 12px;
  border: 1px solid rgba(165, 76, 29, 0.12);
  border-radius: 8px;
  background: rgba(165, 76, 29, 0.05);
}
.engap-export-modal-hint-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: #333;
}
.engap-export-modal-hint-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #334155;
}
.engap-export-modal-selectall {
  display: flex;
  align-items: center;
  padding: 8px 20px;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  gap: 8px;
}
.engap-export-modal-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.engap-export-modal-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 20px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
}
.engap-export-modal-item:hover {
  background: #fafafa;
}
.engap-export-modal-item input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}
.engap-export-modal-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.engap-export-modal-user .engap-export-modal-tag {
  background: #e8e8e8;
  color: #555;
}
.engap-export-modal-assistant .engap-export-modal-tag {
  background: #fde8d8;
  color: #a54c1d;
}
.engap-export-modal-text {
  flex: 1;
  color: #444;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.engap-export-modal-footer {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid #eee;
}
.engap-export-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.engap-export-modal-counter {
  flex: 1 1 auto;
  min-width: 72px;
  font-size: 13px;
  color: #334155;
  line-height: 1.45;
  white-space: nowrap;
}
.engap-export-modal-footer .engap-btn {
  width: auto;
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.engap-export-modal-footer .engap-btn-primary {
  background: #a54c1d;
  color: #fff;
}
.engap-export-modal-footer .engap-btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.engap-export-modal-footer .engap-btn-secondary {
  background: #f0f0f0;
  color: #555;
}

/* ===== Registration Modal ===== */
.mx-reg-card {
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 28px 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 500px;
}
.mx-reg-title {
  font-size: 20px;
  font-weight: 800;
  color: #222;
  text-align: center;
}
.mx-reg-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mx-reg-form label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.mx-reg-sub {
  font-size: 12px;
  font-weight: 400;
  color: #334155;
}
.mx-reg-form input:not([type="radio"]) {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
  font-size: 14px;
  outline: none;
  transition: border-color 120ms ease;
  box-sizing: border-box;
}
.mx-reg-form input:not([type="radio"]):focus {
  border-color: rgb(165, 76, 29);
}
.mx-reg-plan-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mx-reg-form .mx-reg-plan {
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: #fafafa;
  cursor: pointer;
}
.mx-reg-paid-option {
  align-items: flex-start !important;
  gap: 8px !important;
  margin-top: 2px;
  padding: 9px 10px;
  border: 1px solid #ead8cd;
  border-radius: 10px;
  background: #fffaf7;
  cursor: pointer;
}
.mx-reg-paid-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: 0 0 16px;
  accent-color: rgb(165, 76, 29);
}
.mx-reg-paid-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.mx-reg-paid-option strong {
  color: #7f351d;
  font-size: 13px;
}
.mx-reg-paid-option em,
.mx-reg-paid-note {
  color: #6b5a52;
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}
.mx-reg-paid-note {
  padding: 10px 12px;
  border: 1px solid #f0c7b6;
  border-radius: 10px;
  background: #fff4ee;
  color: #8f3217;
}
.mx-reg-payment-title--urgent {
  color: #dc2626 !important;
}
.mx-reg-plan input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: 0 0 16px;
  accent-color: rgb(165, 76, 29);
}
.mx-reg-plan span {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.mx-reg-plan strong {
  color: #222;
  font-size: 14px;
  line-height: 1.25;
}
.mx-reg-plan em {
  color: #334155;
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
}
.mx-reg-payment-box {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(165, 76, 29, 0.12);
  border-radius: 12px;
  padding: 10px;
  background: rgba(165, 76, 29, 0.04);
}
.mx-reg-payment-box[hidden],
.mx-reg-paid-note[hidden] {
  display: none !important;
}
.mx-reg-payment-qr-btn {
  display: grid;
  gap: 4px;
  border: none;
  padding: 0;
  background: transparent;
  color: #9f4a2c;
  font-size: 11px;
  font-weight: 700;
  cursor: zoom-in;
  text-align: center;
}
.mx-reg-payment-qr {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(165, 76, 29, 0.12);
}
.mx-reg-payment-copy {
  display: grid;
  gap: 6px;
  color: #555;
  font-size: 13px;
  line-height: 1.5;
}
.mx-reg-payment-copy strong {
  color: #222;
  font-size: 16px;
}
.mx-renew-note {
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
}
.mx-reg-submit {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, rgb(165, 76, 29), rgb(192, 96, 40));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 4px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.mx-reg-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(165, 76, 29, 0.3);
}
.mx-reg-msg {
  font-size: 14px;
  text-align: center;
  min-height: 20px;
  line-height: 1.5;
}
.mx-reg-msg--info { color: #334155; }
.mx-reg-msg--ok { color: #16a34a; }
.mx-reg-msg--err { color: #dc2626; }

@media (max-width: 520px) {
  .mx-reg-card {
    width: calc(100vw - 24px);
    padding: 30px 18px 22px;
  }
  .mx-reg-plan-row {
    grid-template-columns: 1fr;
  }
  .mx-reg-payment-box {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .mx-reg-payment-qr {
    width: min(240px, calc(100vw - 96px));
    height: min(240px, calc(100vw - 96px));
  }
}

.mx-payment-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(0,0,0,0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mx-payment-preview-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border-radius: 18px;
  padding: 38px 36px 28px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0,0,0,0.32);
}
.mx-payment-preview-img {
  width: min(520px, calc(100vw - 72px));
  height: min(520px, calc(100vw - 72px));
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
}

/* ===== Suggested Question Chips ===== */
.mx-question-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mx-question-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(165, 76, 29, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: var(--engap-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 100ms ease;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mx-question-chip:hover {
  background: rgba(165, 76, 29, 0.06);
  border-color: rgba(165, 76, 29, 0.35);
  transform: translateY(-1px);
}

.mx-question-chip:active {
  transform: scale(0.98);
}

.mx-question-chip.mx-chip-mx {
  border-color: rgba(15, 118, 110, 0.2);
  background: rgba(15, 118, 110, 0.04);
}

.mx-question-chip.mx-chip-mx:hover {
  background: rgba(15, 118, 110, 0.1);
  border-color: rgba(15, 118, 110, 0.35);
}

.mx-kline-tool-entry {
  display: inline-flex;
  align-items: center;
}

.mx-kline-tool-trigger {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f766e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  gap: 5px;
  backdrop-filter: blur(8px);
  transition: box-shadow 0.2s, background 0.2s, transform 0.15s;
}

.mx-kline-tool-trigger:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.18);
  transform: translateY(-1px);
}

.mx-kline-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.52);
}

.mx-kline-card {
  position: relative;
  width: min(1680px, calc(100vw - 24px));
  height: min(1040px, calc(100dvh - 24px));
  max-height: calc(100vh - 24px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  background: #f8fbfc;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.32);
  padding: 22px;
}

.mx-kline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-right: 28px;
}

.mx-kline-head h2 {
  margin: 0;
  color: var(--engap-text);
  font-size: 22px;
  line-height: 1.2;
}

.mx-kline-head p {
  margin: 5px 0 0;
  color: var(--engap-muted);
  font-size: 13px;
  line-height: 1.45;
}

.mx-kline-result-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  flex: 0 0 auto;
}

.mx-kline-result-tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #47606b;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.mx-kline-result-tabs button[data-active="true"] {
  background: #0f766e;
  color: #fff;
}

.mx-kline-result-tabs button[data-disabled="true"] {
  cursor: not-allowed;
  background: #f1f5f9;
  color: #334155;
  opacity: 1;
}

.mx-kline-grid {
  display: grid;
  grid-template-columns: clamp(288px, 22vw, 340px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  flex: 1;
}

.mx-kline-panel,
.mx-kline-result {
  min-height: 0;
  border: 1px solid rgba(126, 96, 68, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
}

.mx-kline-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow: hidden;
}

.mx-kline-label {
  color: var(--engap-text);
  font-size: 13px;
  font-weight: 800;
}

.mx-kline-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}

.mx-kline-input-row input,
.mx-kline-input-row button {
  min-height: 38px;
  border-radius: 8px;
  font-size: 14px;
}

.mx-kline-input-row input {
  min-width: 0;
  border: 1px solid rgba(124, 92, 53, 0.16);
  padding: 0 11px;
  background: #fff;
  color: var(--engap-text);
}

.mx-kline-input-row button {
  border: 1px solid #0f766e;
  background: #0f766e;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.mx-kline-input-row button:disabled {
  cursor: wait;
  background: #115e59;
  opacity: 1;
}

.mx-kline-status {
  min-height: 18px;
  color: var(--engap-muted);
  font-size: 12px;
  line-height: 1.45;
}

.mx-kline-status[data-kind="ok"] { color: #15803d; }
.mx-kline-status[data-kind="warn"] { color: #b45309; }
.mx-kline-status[data-kind="err"] { color: #dc2626; }

.mx-kline-candidates {
  display: grid;
  flex: 0 0 auto;
  gap: 6px;
  max-height: 196px;
  overflow-y: auto;
  padding-right: 2px;
}

.mx-kline-candidate,
.mx-kline-cache-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(248, 250, 252, 0.92);
  color: var(--engap-text);
  text-align: left;
  cursor: pointer;
}

.mx-kline-candidate[data-selected="true"] {
  border-color: rgba(15, 118, 110, 0.48);
  background: rgba(15, 118, 110, 0.08);
}

.mx-kline-candidate strong,
.mx-kline-cache-item span {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mx-kline-candidate span,
.mx-kline-cache-item em {
  flex: 0 0 auto;
  color: var(--engap-muted);
  font-size: 12px;
  font-style: normal;
}

.mx-kline-cache-head {
  margin-top: 4px;
  color: var(--engap-text);
  font-size: 12px;
  font-weight: 800;
}

.mx-kline-cache {
  display: grid;
  gap: 6px;
  min-height: 42px;
  overflow-y: auto;
}

.mx-kline-empty,
.mx-kline-placeholder {
  color: var(--engap-muted);
  font-size: 13px;
}

.mx-kline-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow: auto;
}

.mx-kline-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--engap-text);
}

.mx-kline-result-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mx-kline-result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.mx-kline-export-button {
  min-height: 38px;
  border: 1px solid rgba(165, 76, 29, 0.34);
  border-radius: 8px;
  padding: 0 12px;
  background: #a54c1d;
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.mx-kline-export-button:hover {
  background: #8f3f17;
}

.mx-kline-export-button:disabled {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #475569;
  cursor: not-allowed;
}

.mx-kline-result-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mx-kline-result-head span {
  display: block;
  color: var(--engap-muted);
  font-size: 12px;
}

.mx-kline-result-note {
  color: var(--engap-muted);
  font-size: 12px;
}

.mx-kline-image-button {
  display: block;
  width: 100%;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.mx-kline-image {
  width: 100%;
  max-height: 650px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(15, 118, 110, 0.1);
  background: #fff;
}

.mx-kline-report-frame {
  width: 100%;
  min-height: 0;
  flex: 1 1 0;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 8px;
  background: #f5f7fb;
}

.mx-kline-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.86);
}

.mx-kline-preview-card {
  position: relative;
  width: min(98vw, 1800px);
  height: min(96vh, 1100px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.22);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  padding: 14px;
}

.mx-kline-preview-title {
  padding-right: 44px;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 800;
}

.mx-kline-preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(226, 232, 240, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.7);
  color: #f8fafc;
  cursor: pointer;
}

.mx-kline-preview-image {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  cursor: zoom-out;
}

/* Chainlit action button override for suggested questions */
.step .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.step .actions button {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(165, 76, 29, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: var(--engap-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 100ms ease;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step .actions button:hover {
  background: rgba(165, 76, 29, 0.06);
  border-color: rgba(165, 76, 29, 0.35);
  transform: translateY(-1px);
}

@media (max-width: 960px) {
  .mx-question-chip {
    font-size: 12px;
    padding: 6px 12px;
  }

  .step .actions button {
    font-size: 12px;
    padding: 6px 12px;
  }
}

@media (max-width: 760px) {
  .mx-kline-card {
    width: calc(100vw - 24px);
    height: auto;
    max-height: calc(100dvh - 24px);
    padding: 18px 14px 14px;
  }

  .mx-kline-head {
    flex-direction: column;
    padding-right: 24px;
  }

  .mx-kline-grid {
    grid-template-columns: 1fr;
    grid-template-rows: max-content minmax(520px, auto);
    overflow-y: auto;
  }

  .mx-kline-panel {
    overflow: visible;
    min-height: max-content;
  }

  .mx-kline-result {
    min-height: 260px;
  }

  .mx-kline-result-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mx-kline-result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .mx-kline-result-tabs {
    width: 100%;
  }

  .mx-kline-export-button {
    width: 100%;
  }

  .mx-kline-report-frame {
    min-height: 520px;
    flex: 1 0 520px;
  }

  .mx-kline-tool-trigger {
    min-height: 32px;
    padding: 0 9px;
    font-size: 12px;
  }
}

/* ==========================================================================
   历史视频浮层（用户态，近全屏卡片网格 + 无限下滑 + 详情）
   顶栏触发按钮用 indigo(#4f46e5) 与 teal 的「更新」按钮区分；浮层卡片沿用站点
   现有风格（白底、18px 圆角、柔阴影）。设计见 docs/2026-06-26-mx-history-viewer-design.md
   ========================================================================== */
.mx-videos-float {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 85;
  pointer-events: auto;
}
.mx-videos-float.mx-videos-in-header {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  z-index: auto;
  display: inline-flex;
  align-items: center;
}
.mx-videos-trigger {
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(79, 70, 229, 0.20);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #4f46e5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(8px);
  transition: box-shadow 0.2s, background 0.2s, transform 0.15s;
}
.mx-videos-trigger:hover {
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.22);
  background: #fff;
  transform: translateY(-1px);
}
.mx-research-float {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 85;
  pointer-events: auto;
}
.mx-research-float.mx-research-in-header {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  z-index: auto;
  display: inline-flex;
  align-items: center;
}
.mx-research-trigger {
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(139, 79, 36, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #8b4f24;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(8px);
  transition: box-shadow 0.2s, background 0.2s, transform 0.15s;
}
.mx-research-trigger:hover {
  box-shadow: 0 4px 16px rgba(139, 79, 36, 0.20);
  background: #fff;
  transform: translateY(-1px);
}
.mx-big-v-opinions-float {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 85;
  pointer-events: auto;
}
.mx-big-v-opinions-float.mx-big-v-opinions-in-header {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  z-index: auto;
  display: inline-flex;
  align-items: center;
}
.mx-big-v-opinions-trigger {
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(21, 59, 91, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #153b5b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(8px);
  transition: box-shadow 0.2s, background 0.2s, transform 0.15s;
}
.mx-big-v-opinions-trigger:hover {
  box-shadow: 0 4px 16px rgba(21, 59, 91, 0.20);
  background: #fff;
  transform: translateY(-1px);
}

.mx-videos-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: mx-qr-fadein 200ms ease;
}
.mx-videos-card {
  position: relative;
  background: #f8fafc;
  border-radius: 20px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.32);
  width: min(1100px, 100%);
  height: 92vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mx-videos-card .mx-qr-close {
  top: 12px;
  right: 14px;
  z-index: 6;
  background: rgba(255, 255, 255, 0.85);
}
.mx-videos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
  background: #fff;
  border-bottom: 1px solid #e6ebf2;
  flex-shrink: 0;
}
.mx-videos-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  white-space: nowrap;
}
.mx-videos-tools { display: flex; align-items: center; gap: 10px; padding-right: 30px; }
.mx-videos-select {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d6dde6;
  border-radius: 9px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.mx-videos-select:focus { outline: 2px solid rgba(79, 70, 229, 0.35); border-color: #4f46e5; }
/* 试用账号月份锁态：保持可点（弹提示），视觉上弱化 + 锁标 */
.mx-videos-select--locked {
  opacity: 1;
  cursor: not-allowed;
  border-style: dashed;
  border-color: #fbbf24;
  background: #fffbeb;
  color: #92400e;
}

.mx-videos-cta {
  position: relative;
  margin: 14px 22px 0;
  padding: 12px 48px 12px 16px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  color: #3730a3;
  font-size: 12.5px;
  line-height: 1.7;
  flex-shrink: 0;
}
.mx-videos-cta-text { white-space: normal; }
.mx-videos-cta-close {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #3730a3;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.mx-videos-cta-close:hover { background: rgba(79, 70, 229, 0.12); }
.mx-videos-cta-close:focus-visible { outline: 2px solid #4f46e5; outline-offset: 1px; }
.mx-videos-cta-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 14px;
  background: #4f46e5;
  color: #fff !important;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
  transition: background 0.2s, transform 0.15s;
}
.mx-videos-cta-btn:hover { background: #4338ca; transform: translateY(-1px); }

.mx-videos-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px 22px;
}
.mx-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(264px, 1fr));
  gap: 16px;
}
.mx-video-card {
  position: relative;
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  display: flex;
  flex-direction: column;
}
.mx-video-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
  z-index: 2;
  pointer-events: none;
}
.mx-video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.16);
  border-color: #c7d2fe;
}
.mx-video-card-hero {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  overflow: hidden;
}
.mx-video-card-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mx-video-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.mx-video-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mx-video-card-preview {
  font-size: 12.5px;
  color: #334155;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 卡面「重点」列表（来自月 docx，比空 icon 有信息量） */
.mx-video-card-points {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mx-video-point {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #475569;
}
.mx-video-point-n {
  flex: 0 0 auto;
  min-width: 17px;
  height: 17px;
  border-radius: 5px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.mx-video-point-t {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mx-video-point-more {
  font-size: 11.5px;
  color: #334155;
  font-weight: 600;
  padding-left: 24px;
}
.mx-video-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.mx-video-card-date { font-size: 11.5px; color: #334155; font-weight: 700; }
.mx-video-card-time { font-size: 11px; color: #334155; font-weight: 650; margin-left: 2px; }
.mx-video-badge {
  font-size: 11px;
  font-weight: 700;
  color: #4f46e5;
  background: #eef2ff;
  border-radius: 999px;
  padding: 2px 8px;
}
.mx-video-badge-mute {
  color: #334155;
  background: #f1f5f9;
}
.mx-video-badge-paid {
  color: #fff;
  background: #d4a017;
  box-shadow: 0 1px 2px rgba(212, 160, 23, 0.45);
}
.mx-videos-sentinel {
  padding: 22px 0 6px;
  text-align: center;
  color: #334155;
  font-size: 13px;
}
.mx-videos-error { color: #dc2626; font-weight: 600; }
.mx-videos-trial-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px auto 6px;
  padding: 14px 18px;
  max-width: 560px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
  box-shadow: 0 6px 18px rgba(154, 52, 18, 0.08);
}
.mx-videos-trial-upgrade-btn {
  border: none;
  border-radius: 999px;
  background: #9a3412;
  color: #fff7ed;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding: 9px 14px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(154, 52, 18, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.mx-videos-trial-upgrade-btn:hover {
  background: #7c2d12;
  box-shadow: 0 8px 18px rgba(154, 52, 18, 0.22);
  transform: translateY(-1px);
}
.mx-video-detail-loading {
  padding: 60px 0;
  text-align: center;
  color: #334155;
  font-size: 14px;
}

/* 详情视图（浮层内替换网格） */
.mx-video-detail {
  flex: 1;
  overflow-y: auto;
  padding: 18px 26px 30px;
}
.mx-videos-back-top {
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 9px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s;
}
.mx-videos-back-top:hover { background: #e0e7ff; }
.mx-video-detail-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.4;
  margin-bottom: 4px;
}
.mx-video-detail-date { font-size: 13px; color: #334155; font-weight: 700; margin-bottom: 18px; }
.mx-video-sec { margin-bottom: 12px; }
.mx-video-sec h3 {
  font-size: 15px;
  font-weight: 700;
  color: #4f46e5;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #eef2ff;
}
.mx-video-card-img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  object-fit: contain;
}
/* 详情「重点」编号列表 */
.mx-video-keypoints {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: mxkp;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mx-video-keypoints li {
  counter-increment: mxkp;
  position: relative;
  padding: 12px 14px 12px 46px;
  background: #f8fafc;
  border: 1px solid #eef2ff;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: #334155;
}
.mx-video-keypoints li::before {
  content: counter(mxkp);
  position: absolute;
  left: 12px;
  top: 11px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mx-video-badge-hot {
  color: #b91c1c;
  background: #fef2f2;
}
.mx-video-sec-sub {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-left: 6px;
}
/* 详情「观点脉络」竖向时间线（复用 deep_interp 时间轴数据） */
.mx-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mx-tl-node {
  position: relative;
  padding: 11px 14px 11px 38px;
  background: #f8fafc;
  border: 1px solid #eef2ff;
  border-radius: 10px;
}
/* 连接相邻节点的竖向轨道线 */
.mx-tl-node::before {
  content: "";
  position: absolute;
  left: 15px;
  top: -10px;
  bottom: -10px;
  width: 2px;
  background: #e2e8f0;
}
.mx-tl-node:first-child::before { top: 16px; }
.mx-tl-node:last-child::before { bottom: calc(100% - 16px); }
.mx-tl-dot {
  position: absolute;
  left: 10px;
  top: 13px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mx-tl-color, #4f46e5);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--mx-tl-color, #4f46e5);
}
.mx-tl-current {
  background: linear-gradient(180deg, #f5f3ff 0%, #f8fafc 100%);
  border-color: #c4b5fd;
}
.mx-tl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.mx-tl-badge {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--mx-tl-color, #4f46e5);
  padding: 2px 8px;
  border-radius: 6px;
}
.mx-tl-date { font-size: 12px; color: #334155; font-weight: 700; }
.mx-tl-jump {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #4f46e5;
  cursor: pointer;
  user-select: none;
}
.mx-tl-jump:hover { text-decoration: underline; }
.mx-tl-title { font-size: 14px; font-weight: 700; color: #1e293b; line-height: 1.5; margin-bottom: 2px; }
.mx-tl-view { font-size: 13.5px; color: #334155; line-height: 1.65; }
.mx-tl-quote {
  margin-top: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: #334155;
  background: #fffaf3;
  border-left: 3px solid #f0c987;
  border-radius: 4px;
  line-height: 1.6;
}
.mx-video-top-comments {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: mxtc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mx-video-top-comments li {
  counter-increment: mxtc;
  position: relative;
  padding: 8px 12px 8px 42px;
  background: #fff7f3;
  border: 1px solid #fee4d8;
  border-radius: 10px;
}
.mx-video-top-comments li::before {
  content: counter(mxtc);
  position: absolute;
  left: 10px;
  top: 7px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mx-tc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-size: 12.5px;
}
.mx-tc-digg {
  font-weight: 800;
  color: #c2410c;
  background: #ffedd5;
  border-radius: 6px;
  padding: 1px 7px;
}
.mx-tc-user { font-weight: 700; color: #1e293b; }
.mx-tc-reply { color: #334155; font-weight: 650; }
.mx-tc-ts { color: #334155; margin-left: auto; font-weight: 700; }
.mx-tc-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: #334155;
  word-break: break-word;
  white-space: pre-wrap; /* 保留评论内的换行（多行评论，如列表式） */
}
.mx-tc-images {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mx-tc-image {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #fee4d8;
  background: #fff;
  cursor: zoom-in;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mx-tc-image:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}
.mx-md-image {
  display: block;
  max-width: min(100%, 280px);
  max-height: 220px;
  object-fit: contain;
  margin: 8px 0 4px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
}
.mx-image-unavailable {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 280px);
  min-height: 96px;
  margin: 8px 0 4px;
  padding: 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
}
.mx-image-unavailable--thumb {
  width: 96px;
  height: 96px;
  margin: 0;
}
.mx-video-transcript {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.8;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}
.mx-video-interaction {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.75;
  color: #334155;
}
.mx-video-interaction h1, .mx-video-interaction h2, .mx-video-interaction h3,
.mx-video-interaction h4 { color: #1e293b; margin: 12px 0 6px; }
.mx-video-interaction h1 { font-size: 16px; }
.mx-video-interaction h2 { font-size: 15px; color: #4f46e5; }
.mx-video-interaction ul { margin: 6px 0 6px 20px; padding: 0; }
.mx-video-interaction li { margin: 4px 0; }
.mx-video-interaction p { margin: 6px 0; }
.mx-video-empty { padding: 30px; text-align: center; color: #334155; font-size: 14px; }

@media (max-width: 640px) {
  .mx-videos-card { height: 96vh; border-radius: 14px; }
  .mx-videos-header { padding: 14px 16px 12px; }
  .mx-videos-header h2 { font-size: 16px; }
  .mx-videos-tools { padding-right: 28px; }
  .mx-videos-cta { margin: 12px 16px 0; }
  .mx-videos-scroll { padding: 12px 16px 18px; }
  .mx-videos-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .mx-video-detail { padding: 14px 16px 24px; }
}

/* 📊 评论提及个股 chips（Top10 默认 + 展开到 Top100）*/
.mx-tcs-list { display: flex; flex-wrap: wrap; gap: 8px 10px; line-height: 1.6; }
.mx-tcs-chip {
  display: inline-block; padding: 2px 10px; border-radius: 14px;
  background: rgba(255, 138, 0, 0.10); color: #333; font-size: 14px;
}
.mx-tcs-cnt { margin-left: 4px; color: #e67e22; font-weight: 600; }
.mx-tcs-toggle {
  display: inline-block; margin-top: 6px; padding: 2px 12px; border-radius: 12px;
  border: 1px solid #e67e22; background: #fff; color: #e67e22; cursor: pointer; font-size: 13px;
}
.mx-tcs-toggle:hover { background: rgba(255, 138, 0, 0.08); }

/* ===================== 🎧 听先生 音频播放器 ===================== */
.mx-audio-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.mx-audio-card {
  position: relative; background: #f8fafc; border-radius: 20px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.32);
  width: min(640px, 100%); max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.mx-audio-header {
  display: flex; align-items: center; justify-content: space-between;
  /* 右侧留位给绝对定位的 .mx-qr-close (right:14px), 避免月份选择器与关闭按钮重叠 */
  padding: 18px 46px 14px 22px; gap: 12px;
}
.mx-audio-header h2 { margin: 0; font-size: 17px; font-weight: 700; color: #0f172a; }
.mx-videos-listen {
  border: 1px solid #6366f1; background: #fff; color: #4f46e5;
  border-radius: 8px; padding: 4px 10px; font-size: 13px; cursor: pointer;
}
.mx-videos-listen:hover { background: rgba(99, 102, 241, 0.08); }
.mx-videos-listen.mx-disabled { opacity: 0.4; cursor: not-allowed; border-color: #cbd5e1; color: #475569; }
.mx-audio-player { padding: 0 22px 14px; border-bottom: 1px solid #e2e8f0; }
.mx-audio-now { font-size: 13px; color: #475569; margin-bottom: 8px; }
.mx-audio-now-title { color: #0f172a; font-weight: 600; }
.mx-audio-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mx-audio-btn {
  border: 1px solid #cbd5e1; background: #fff; color: #334155;
  border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; min-width: 44px;
}
.mx-audio-btn:hover { background: #f1f5f9; }
.mx-audio-seek { flex: 1 1 160px; min-width: 120px; accent-color: #6366f1; }
.mx-audio-time { font-size: 12px; color: #475569; font-variant-numeric: tabular-nums; }
.mx-audio-speed { border: 1px solid #cbd5e1; border-radius: 8px; padding: 5px 6px; font-size: 13px; background: #fff; color: #334155; }
.mx-audio-timeline {
  display: flex; gap: 4px; overflow-x: auto; padding: 10px 0 2px;
  scrollbar-width: thin;
}
.mx-audio-node {
  flex: 0 0 auto; border: 1px solid #cbd5e1; background: #fff; color: #475569;
  border-radius: 14px; padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.mx-audio-node:hover { background: #eef2ff; border-color: #a5b4fc; }
.mx-audio-node.is-active { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.mx-audio-tracks { overflow-y: auto; padding: 8px 14px 16px; flex: 1 1 auto; }
.mx-audio-track {
  padding: 9px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent;
}
.mx-audio-track:hover { background: #f1f5f9; }
.mx-audio-track.is-active { background: #eef2ff; border-color: #c7d2fe; }
.mx-audio-track-date { font-size: 12px; color: #475569; font-variant-numeric: tabular-nums; }
.mx-audio-track-title { font-size: 13px; color: #0f172a; margin-top: 2px; }
.mx-audio-loading { padding: 18px; text-align: center; color: #475569; font-size: 13px; }
.mx-audio-lock { margin: 12px 22px; padding: 12px 14px; background: #fef3c7; color: #92400e; border-radius: 10px; font-size: 13px; }

/* ====== 信号中心 (右侧多 tab 浮窗) ====== */
.mx-signal-hub { position: fixed; inset: 0 0 0 auto; pointer-events: none; z-index: 70; }
.mx-signal-toggle {
  pointer-events: auto; position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--engap-accent); color: #fff; border: 1px solid var(--engap-sidebar-border);
  border-right: 0; border-radius: 12px 0 0 12px; padding: 12px 8px; cursor: pointer;
  box-shadow: -6px 6px 18px rgba(20, 49, 64, 0.18); font-size: 12px; line-height: 1.3;
  writing-mode: vertical-rl; letter-spacing: 1px;
}
.mx-signal-toggle:hover { background: #0c5d56; }
.mx-signal-toggle-icon { font-size: 16px; writing-mode: horizontal-tb; }
.mx-signal-toggle-label { writing-mode: vertical-rl; }
.mx-signal-dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; border: 1.5px solid #fff; opacity: 0; transition: opacity .2s;
}
.mx-signal-dot[data-has-new="true"] { opacity: 1; }
.mx-signal-panel {
  pointer-events: auto; position: fixed; right: 0; top: 0; height: 100vh; width: 94vw;
  max-width: 94vw; background: var(--engap-sidebar-bg); backdrop-filter: blur(8px);
  border-left: 1px solid var(--engap-sidebar-border); box-shadow: var(--engap-sidebar-shadow);
  display: flex; flex-direction: column; transform: translateX(105%); transition: transform .25s ease;
  color: var(--engap-text); font-size: 14px;
}
.mx-signal-hub[data-open="true"] .mx-signal-panel { transform: translateX(0); }
@media (min-width: 768px) { .mx-signal-panel { width: 50vw; } }


.mx-signal-head {
  flex: 0 0 auto; padding: 14px 16px 10px; border-bottom: 1px solid var(--engap-sidebar-border);
  position: relative;
}
.mx-signal-title { font-size: 16px; font-weight: 700; color: var(--engap-text); }
.mx-signal-sub { font-size: 12px; color: var(--engap-muted); margin-top: 3px; }
.mx-signal-refresh {
  position: absolute; top: 11px; right: 48px; width: 52px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--engap-sidebar-border); border-radius: 6px;
  color: var(--engap-accent); cursor: pointer; font-size: 14px; font-variant-numeric: tabular-nums;
}
.mx-signal-refresh:hover:not(:disabled) { background: rgba(15, 118, 110, 0.1); }
.mx-signal-refresh:disabled { cursor: not-allowed; color: var(--engap-muted); opacity: 0.72; }
.mx-signal-refresh[data-error="true"]:not(:disabled) { color: #b42318; border-color: #d92d20; }
.mx-signal-close {
  position: absolute; top: 12px; right: 12px; background: transparent; border: 0; cursor: pointer;
  font-size: 16px; color: var(--engap-muted); border-radius: 6px; padding: 2px 7px;
}
.mx-signal-close:hover { background: rgba(15, 118, 110, 0.1); color: var(--engap-text); }
.mx-signal-tabs { flex: 0 0 auto; display: flex; gap: 6px; padding: 10px 12px 6px; overflow-x: auto; }
.mx-sig-tab {
  position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  background: #fff; border: 1px solid #e2e8f0; color: var(--engap-muted); border-radius: 999px;
  padding: 5px 11px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.mx-sig-tab:hover { border-color: #cbd5e1; }
.mx-sig-tab.mx-sig-tab-active { background: var(--engap-accent); color: #fff; border-color: var(--engap-accent); }
.mx-sig-tab-icon { font-size: 13px; }
.mx-sig-tab-cnt {
  font-size: 11px; background: rgba(15,118,110,0.12); color: var(--engap-accent);
  border-radius: 8px; padding: 0 6px; font-variant-numeric: tabular-nums;
}
.mx-sig-tab.mx-sig-tab-active .mx-sig-tab-cnt { background: rgba(255,255,255,0.25); color: #fff; }
.mx-sig-tab-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #ef4444; border: 1px solid #fff;
}
.mx-signal-meta {
  flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 16px; background: rgba(15, 118, 110, 0.06); border-bottom: 1px solid var(--engap-sidebar-border);
}
.mx-sig-time { font-size: 12px; color: var(--engap-muted); font-variant-numeric: tabular-nums; }
.mx-sig-phase { color: var(--engap-accent); font-style: normal; font-weight: 600; }
.mx-sig-count { font-size: 12px; color: var(--engap-text); font-weight: 600; }
.mx-signal-body { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 10px 12px 12px; }
/* 全字段密集数据: 可横滑 (用户: 桌面看不全/没法左右滑) */
.mx-sig-fields { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin-top: 6px;
  font-size: 11.5px; max-width: 100%; }
.mx-sig-fields .k { color: var(--engap-muted); white-space: nowrap; }
.mx-sig-fields .v { color: var(--engap-text); font-variant-numeric: tabular-nums; word-break: break-word; }
.mx-sig-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mx-sig-card {
  background: var(--engap-card); border: 1px solid var(--engap-sidebar-border); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 9px;
}
.mx-sig-card-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mx-sig-row-tail { display: inline-flex; align-items: baseline; gap: 8px; }
.mx-sig-name { font-size: 14px; font-weight: 700; color: var(--engap-text); }
.mx-sig-name em { font-style: normal; font-size: 11px; color: var(--engap-muted); font-weight: 400; margin-left: 3px; }
.mx-sig-pct { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mx-sig-up { color: #dc2626; }       /* A股 红涨 */
.mx-sig-down { color: #16a34a; }     /* A股 绿跌 */
.mx-sig-card-meta { font-size: 12px; color: var(--engap-muted); margin-top: 4px; line-height: 1.5; }
.mx-sig-card-act { margin-top: 8px; }
.mx-sig-ask {
  background: var(--engap-accent-soft); color: var(--engap-accent); border: 1px solid #a7d9d0;
  border-radius: 8px; padding: 5px 12px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.mx-sig-ask:hover { background: var(--engap-accent); color: #fff; }
.mx-sig-qs { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.mx-sig-q {
  text-align: left; background: #fff; border: 1px solid #e2e8f0; color: var(--engap-text);
  border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.5; cursor: pointer;
}
.mx-sig-q:hover { background: var(--engap-accent-soft); border-color: var(--engap-accent); }
.mx-sig-empty { padding: 24px 14px; text-align: center; color: var(--engap-muted); font-size: 13px; line-height: 1.7; }
.mx-sig-stale { background: #fef3c7; color: #92400e; border-radius: 10px; margin: 8px 4px; }
.mx-sig-stale span { font-size: 11px; color: #b45309; }
.mx-sig-history-warning {
  display: flex; flex-direction: column; gap: 3px; margin: 0 2px 10px; padding: 9px 11px;
  background: #fff4d6; border: 1px solid #e9b949; border-radius: 8px; color: #7c3f12;
  font-size: 12px; line-height: 1.5;
}
.mx-sig-history-warning strong { color: #a34b13; font-size: 12.5px; }
.mx-sig-b1-switch {
  display: inline-flex; width: fit-content; margin: 0 2px 10px; padding: 3px;
  background: #f1f5f3; border: 1px solid #c9d8d3; border-radius: 8px;
}
.mx-sig-b1-mode {
  border: 0; background: transparent; color: var(--engap-muted); border-radius: 6px;
  padding: 5px 10px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.mx-sig-b1-mode span { margin-left: 3px; font-variant-numeric: tabular-nums; }
.mx-sig-b1-mode:hover { color: var(--engap-accent); }
.mx-sig-b1-mode-active { background: var(--engap-accent); color: #fff; }
.mx-sig-b1-mode-active:hover { color: #fff; }
.mx-sig-section-separator {
  display: flex; align-items: center; gap: 10px; margin: 18px 2px 8px;
  color: #8a4b2e; font-size: 12px; font-weight: 700;
}
.mx-sig-section-separator::before, .mx-sig-section-separator::after {
  content: ""; height: 1px; background: #d8c4b6; flex: 1 1 auto;
}
.mx-sig-section-separator span { white-space: nowrap; }
.mx-sig-sell-list { border-top: 1px solid var(--engap-sidebar-border); }
.mx-sig-sell-row { padding: 10px 8px; border-bottom: 1px solid var(--engap-sidebar-border); }
.mx-sig-profit-row { padding: 10px 8px; border-bottom: 1px solid var(--engap-sidebar-border); }
.mx-sig-sell-empty { padding: 14px 8px; text-align: center; color: var(--engap-muted); font-size: 12px; }
.mx-signal-foot {
  flex: 0 0 auto; padding: 10px 14px; border-top: 1px solid var(--engap-sidebar-border);
  font-size: 11px; color: var(--engap-muted); line-height: 1.55; background: rgba(255,255,255,0.5);
}
.mx-signal-foot b { color: #92400e; }
.mx-sig-cnt { font-size: 12px; color: var(--engap-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.mx-sig-tag { font-size: 11px; font-weight: 700; color: var(--engap-accent); white-space: nowrap; }
.mx-sig-new { color: #dc2626; }
.mx-sig-cont { color: #475569; }
.mx-sig-cat { color: var(--engap-muted); font-style: italic; }

/* ====== 主题雷达 · 龙头实况 ====== */
.mx-tr-card { padding: 10px 12px 8px; }
.mx-tr-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mx-tr-rank {
  flex: 0 0 auto; color: #92400e; background-color: #fff7ed; border: 1px solid #fed7aa;
  border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 800;
}
.mx-tr-head .mx-sig-name { min-width: 0; overflow-wrap: anywhere; }
.mx-tr-followers { margin-left: auto; flex: 0 0 auto; font-size: 11px; color: var(--engap-muted); }
.mx-tr-stats { margin-top: 5px; font-size: 11.5px; color: var(--engap-muted); line-height: 1.5; }
.mx-tr-members { margin-top: 8px; border-top: 1px solid var(--engap-sidebar-border); }
.mx-tr-member {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) max-content; align-items: start;
  gap: 7px; padding: 8px 0; border-bottom: 1px solid var(--engap-sidebar-border);
}
.mx-tr-role {
  margin-top: 1px; border-radius: 5px; padding: 2px 4px; text-align: center;
  font-size: 10px; line-height: 1.35; font-weight: 800;
}
.mx-tr-role-leader { color: #b42318; background-color: #fef2f2; border: 1px solid #fecaca; }
.mx-tr-role-core { color: #1d4ed8; background-color: #eff6ff; border: 1px solid #bfdbfe; }
.mx-tr-stock { min-width: 0; color: var(--engap-text); font-size: 12.5px; line-height: 1.35; }
.mx-tr-stock b { font-size: 13px; }
.mx-tr-stock em, .mx-tr-volume-row em { color: var(--engap-muted); font-style: normal; font-size: 11px; }
.mx-tr-stock small { display: block; margin-top: 3px; color: var(--engap-muted); font-size: 11px; line-height: 1.45; }
.mx-tr-sealed {
  display: inline-block; margin-left: 5px; color: #b42318; background-color: #fef2f2;
  border-radius: 4px; padding: 1px 4px; font-size: 9px; font-style: normal; font-weight: 800;
}
.mx-tr-pct { padding-top: 1px; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mx-tr-no-leader { padding: 10px 0 3px; color: var(--engap-muted); font-size: 12px; }
.mx-tr-volume-list { border-top: 1px solid var(--engap-sidebar-border); }
.mx-tr-volume-row {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) max-content max-content;
  align-items: center; gap: 7px; padding: 8px 4px; border-bottom: 1px solid var(--engap-sidebar-border);
  color: var(--engap-muted); font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.mx-tr-volume-row b { color: var(--engap-text); }
.mx-tr-volume-state { color: #92400e; font-size: 10px; font-weight: 800; }
@media (max-width: 520px) {
  .mx-tr-volume-row { grid-template-columns: 46px minmax(0, 1fr) max-content; }
  .mx-tr-volume-row > span:last-child { grid-column: 2 / 4; }
}

/* ====== 主力资金 横条对比图 (sector_flow) ====== */
.mx-sf-card { padding: 10px 12px; }
.mx-sf-section { margin-top: 8px; }
.mx-sf-hdr { font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.mx-sf-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 11.5px; }
.mx-sf-name { width: 54px; flex: 0 0 54px; color: var(--engap-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-sf-bar-wrap { flex: 1 1 auto; height: 11px; background: rgba(15,23,42,0.07); border-radius: 3px; overflow: hidden; }
.mx-sf-bar { display: block; height: 100%; border-radius: 3px; transition: width .3s; }
.mx-sf-val { width: 58px; flex: 0 0 58px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* sector_flow 曲线 + 双按钮 */
.mx-sig-card-act { display: flex; gap: 8px; flex-wrap: wrap; }
.mx-sf-curve-btn {
  background: #fff; color: var(--engap-accent); border: 1px solid #bfd9d2;
  border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.mx-sf-curve-btn:hover { background: var(--engap-accent-soft); }
.mx-sf-curve-wrap { margin-top: 8px; padding: 8px; background: rgba(255,255,255,0.6); border-radius: 8px; border: 1px solid var(--engap-sidebar-border); }
.mx-sf-curve-title { font-size: 12px; font-weight: 700; color: var(--engap-text); margin-bottom: 4px; }
.mx-sf-curve { width: 100%; height: 86px; display: block; }
.mx-sf-curve-foot { font-size: 11px; color: var(--engap-muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.mx-sf-nocurve { padding: 10px; text-align: center; color: var(--engap-muted); font-size: 12px; line-height: 1.6; }
.mx-sf-chart-img { width: 100%; border-radius: 6px; display: block; margin: 2px 0; border: 1px solid var(--engap-sidebar-border); }
.mx-sig-dim-tag { font-style: normal; font-size: 10px; font-weight: 600; color: #475569; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; padding: 1px 6px; margin-left: 2px; }

/* 紧凑表格 (鱼盆 excel 原样搬) */
.mx-sig-table { border-collapse: collapse; font-size: 11px; width: 100%; white-space: nowrap; }
.mx-sig-table th { background: var(--engap-accent); color: #fff; padding: 3px 6px; text-align: right;
  font-weight: 600; position: sticky; top: 0; z-index: 1; }
.mx-sig-table th:first-child, .mx-sig-table td:first-child { text-align: left; }
.mx-sig-table td { padding: 2px 6px; text-align: right; border-bottom: 1px solid rgba(0,0,0,0.06);
  font-variant-numeric: tabular-nums; color: var(--engap-text); }
.mx-sig-tr-yes { background: rgba(220, 38, 38, 0.06); font-weight: 600; }
.mx-sig-tr-yes td:first-child::before { content: "●"; color: #dc2626; margin-right: 3px; font-size: 8px; }
.mx-sig-tr-gold { background: rgba(220, 38, 38, 0.10); }
.mx-sig-tr-gold td { font-weight: 600; }
.mx-sig-tab { position: relative; }
.mx-sig-tab[data-desc]:hover::after {
  content: attr(data-desc); position: absolute; top: 100%; left: 0; z-index: 100;
  background: #1e293b; color: #fff; padding: 8px 12px; border-radius: 8px;
  font-size: 11px; line-height: 1.5; white-space: normal; width: 280px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3); margin-top: 4px; pointer-events: none;
  font-weight: 400;
}

/* 鱼盆: 状态近期变化 黄色高亮 */
.mx-sig-tr-recent { background: rgba(250, 204, 21, 0.12); }
.mx-sig-tr-recent.mx-sig-tr-yes { background: rgba(250, 204, 21, 0.18); }

/* 信息密度提升 (用户: 太稀疏一屏看不了多少) */
.mx-sig-card { padding: 5px 10px !important; margin-bottom: 4px !important; }
.mx-sig-card-meta { font-size: 11px !important; margin-top: 1px !important; line-height: 1.4 !important; }
.mx-sig-card-row { margin-bottom: 0 !important; }
.mx-sig-table th { padding: 2px 5px !important; font-size: 10.5px !important; }
.mx-sig-table td { padding: 1px 5px !important; font-size: 10.5px !important; }
.mx-sig-name { font-size: 13px !important; }
.mx-sig-pct { font-size: 13px !important; }
.mx-sig-fields { gap: 1px 8px !important; font-size: 11px !important; }
.mx-sig-card-act { margin-top: 4px !important; gap: 6px !important; }
.mx-sig-ask, .mx-sf-curve-btn { padding: 3px 8px !important; font-size: 11px !important; }
.mx-sf-row { margin-bottom: 2px !important; font-size: 11px !important; }
.mx-sf-section { margin-top: 5px !important; }
.mx-sf-hdr { margin-bottom: 3px !important; font-size: 11px !important; }

/* 全局去掉问先生 (用户: 也别问先生了) */
.mx-sig-tooltip {
  position: fixed; z-index: 9999; background: #1e293b; color: #fff;
  padding: 8px 12px; border-radius: 8px; font-size: 11px; line-height: 1.5;
  width: 280px; max-width: 90vw; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  pointer-events: none; display: none; font-weight: 400;
}

/* 字体加大 (用户: 太小了) */
.mx-sig-table th, .mx-sig-table td { font-size: 12px !important; }
.mx-sig-card-meta { font-size: 12px !important; }
.mx-sig-name { font-size: 14px !important; }
.mx-sig-pct { font-size: 14px !important; }
.mx-sig-fields { font-size: 12px !important; gap: 2px 10px !important; }
.mx-sf-row { font-size: 12px !important; }
.mx-sf-hdr { font-size: 12px !important; }
.mx-sig-cnt { font-size: 12px !important; }

/* sector_flow 不显示问先生 (只有查看曲线) */
.mx-sf-card .mx-sig-ask { display: none !important; }

/* 涨跌颜色 !important (修复被 .mx-sig-table td 高优先级覆盖) */
.mx-sig-up { color: #dc2626 !important; }
.mx-sig-down { color: #16a34a !important; }

/* 异动雷达长图: 自然全高嵌入 (width:100% height:auto 由 inline style 给) */
.mx-sf-chart-long { display: block; border-radius: 8px; margin-bottom: 10px;
  border: 1px solid var(--engap-border, #e2e8f0); }
/* 图未生成兜底提示 */
.mx-sf-nocurve { padding: 14px; margin: 0 0 9px; border-radius: 8px;
  background: var(--engap-surface, #f8fafc); color: var(--engap-muted, #64748b);
  font-size: 12px; text-align: center; border: 1px dashed var(--engap-border, #e2e8f0); }
/* 长图点击放大 lightbox */
.mx-sig-chart-overlay { position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.88); display: flex; align-items: flex-start;
  justify-content: center; overflow: auto; padding: 24px 16px; }
.mx-sig-chart-overlay .mx-sig-chart-full { max-width: 1100px; width: 100%;
  height: auto; border-radius: 6px; box-shadow: 0 8px 32px rgba(0,0,0,.5); }
.mx-sig-chart-close { position: fixed; top: 16px; right: 22px; z-index: 10001;
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.18); color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.mx-sig-chart-close:hover { background: rgba(255,255,255,.32); }

/* 公众号文章入口：沿用顶部功能按钮的紧凑尺寸，进入后使用独立阅读器。 */
.mx-wechat-articles-float { display: inline-flex; align-items: center; margin: 0 3px; }
.mx-wechat-articles-trigger {
  min-height: 30px; padding: 0 9px; border: 1px solid var(--engap-border, #d7dee5);
  border-radius: 6px; color: var(--engap-text, #334155); background: var(--engap-surface, #fff);
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.mx-wechat-articles-trigger:hover { border-color: #a75d35; color: #8d452d; background: #fffaf6; }

/* 大盘速览入口（顶栏, 2026-09-13 用户拍板：醒目红底白字，紧贴「更新」右侧第一位） */
.mx-market-dashboard-float { display: inline-flex; align-items: center; margin: 0 5px; }
.mx-market-dashboard-trigger {
  min-height: 30px; padding: 0 13px; border: 1px solid #b91c1c;
  border-radius: 6px; color: #fff; background: linear-gradient(135deg, #e0453a, #b91c1c);
  font-size: 12px; font-weight: 800; letter-spacing: .5px; cursor: pointer;
  box-shadow: 0 1px 6px rgba(201, 49, 49, .40);
}
.mx-market-dashboard-trigger:hover { border-color: #8f1616; color: #fff; background: linear-gradient(135deg, #c93131, #8f1616); box-shadow: 0 1px 8px rgba(201, 49, 49, .55); }
