
/* 主题变量 */
:root{
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-weak: rgba(245,246,250,.86);
  --text: #222;
  --text-weak: #666;
  --text-mute: #999;
  --primary: #1e88e5;
  --radius-lg: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 6px 18px rgba(30,50,80,.08);
  --sticky-offset: 74px;
  --modebar-fixed-top: 40px;

  /* —— 控件宽度（方案B） —— */
  --filter-field-width: 220px;         /* 动态筛选区每个框宽度 */
  --topbar-addfilters-width: 160px;    /* 顶栏 Add Filters 宽度 */
  --legend-dims-width: 150px;          /* 右侧 Legend Dims 宽度 */
  --filter-menu-min: 900px;            /* 下拉面板最小宽度 */
}

html, body, #react-entry-point, #_dash-app-content { height: 100%; }
body{
  margin:0; color:var(--text); background:var(--bg);
  font-family:"Inter","IBM Plex Sans","Segoe UI",Arial,sans-serif;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}

/* 其它主题（与你当前一致） */
.t5-app.theme-deepgray{
  --bg:#0f1420; --surface:#121a2a; --surface-weak:rgba(24,31,50,.72);
  --text:#e8edf6; --text-weak:#b7c1d6; --text-mute:#7d8797; --primary:#64b5f6;
  --shadow-sm:0 1px 2px rgba(0,0,0,.35); --shadow-md:0 10px 24px rgba(0,0,0,.35);
}

/* 深灰主题下，Plotly 图例文字颜色使用主题文字色（白） */
.t5-app.theme-deepgray .js-plotly-plot .legend text{
  fill: var(--text) !important; /* var(--text) 在 deepgray 下是 #e8edf6 */
}


.t5-app.theme-gray{ --bg:#eef0f3; --surface:#fafbfc; --surface-weak:rgba(240,242,246,.86); --text:#1f2329; --text-weak:#585f6f; --text-mute:#8b93a4; --primary:#5a6d85; }
.t5-app.theme-blue{ --bg:#eef6ff; --surface:#ffffff; --surface-weak:rgba(230,242,255,.86); --text:#162d3d; --text-weak:#4e6e8e; --text-mute:#7c98b2; --primary:#3b82f6; }
.t5-app.theme-green{ --bg:#edf8f2; --surface:#ffffff; --surface-weak:rgba(226,246,236,.86); --text:#0f2a1f; --text-weak:#3a6a55; --text-mute:#6d8f80; --primary:#22c55e; }
.t5-app.theme-pink{ --bg:#fff0f6; --surface:#ffffff; --surface-weak:rgba(255,235,245,.86); --text:#3a1f2a; --text-weak:#8a5a6f; --text-mute:#b28898; --primary:#ec4899; }

/* 容器与标题、页脚 */
.t5-app{ padding:8px 14px 24px; }
.page-title{ text-align:center; }
.footer{ text-align:center; color:var(--text-weak); font-size:12px; margin-top:30px; padding-bottom:20px; }
h1,h3{ margin:0; }
h1{ margin:10px 0 6px; font-size:28px; letter-spacing:.2px; }
h3{ font-size:18px; color:var(--text-weak); margin-bottom:14px; }

/* 顶部工具栏（一级粘性） */
.topbar{
  position:sticky; top:0; z-index:30;
  display:flex; align-items:flex-start; gap:12px;
  padding:10px; border-radius:var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm);
  border: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
}
.topbar .left{ display:flex; align-items:center; flex-wrap:wrap; gap:8px 10px; }
.soft-label{ color: var(--text-weak); }

/* 顶栏 Add Filters 宽度（方案B） */
#add-filter-dd{ width: var(--topbar-addfilters-width) !important; }

/* 按钮（包含 Clear Filters） */
#refresh-btn,#pixel-scale-btn,#theme-btn,#export-btn,#clear-filters-btn{
  height:34px; padding:0 12px; border-radius:10px;
  background: var(--surface); color: var(--text);
  border:1px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
}
#refresh-btn:hover,#pixel-scale-btn:hover,#theme-btn:hover,#export-btn:hover,#clear-filters-btn:hover{
  filter:brightness(1.03); box-shadow:var(--shadow-md); transform:translateY(-1px);
}

/* 筛选区（二级粘性） */
.filters-sticky{
  position:sticky; top:var(--sticky-offset); z-index:25;
  padding:6px 10px; background:transparent;
  color: var(--text);
}
/* .filters-row{ display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin-bottom:8px; } */

/* 同一行内把右侧的 legend-dims-panel 顶到最右侧 */
.filters-row.filters-row--legend-right{ display:flex; align-items:center; }
.filters-row.filters-row--legend-right .legend-dims-panel{ margin-left:auto; }



.filters-title{ font-weight:600; font-size:11px; margin-right:6px; color: var(--text-weak); }
.filters-title.spaced{ margin-left:20px; }
.filters-empty{ color:var(--text-weak); }

/* 每个筛选块的宽度（方案B） */
.filter-row{ width: var(--filter-field-width); background: var(--surface); border-radius: var(--radius-sm);
  padding: 6px 6px 4px; box-shadow: var(--shadow-sm);
  border: 1px solid color-mix(in srgb, var(--text) 6%, transparent); color: var(--text);
}
.filter-label{ font-size:11px; color:var(--text-weak); margin-bottom:4px; }

/* 右侧 Legend Dims 面板 */
.legend-dims-panel{
  margin-left:auto; display:flex; align-items:center; gap:6px;
}
#legend-dims-dd{ width: var(--legend-dims-width) !important; }

/* 下拉控件样式与面板宽度 */
.filter-row .Select-control,
#add-filter-dd .Select-control,
#legend-dims-dd .Select-control{
  min-height:28px; height:28px; border-radius: var(--radius-sm);
  border:1px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow:none; background: var(--surface); color: var(--text);
}
.filter-row .Select-placeholder,
.filter-row .Select-value-label,
#add-filter-dd .Select-placeholder,
#add-filter-dd .Select-value-label,
#legend-dims-dd .Select-placeholder,
#legend-dims-dd .Select-value-label{
  font-size:12px; color:var(--text-weak); line-height:26px;
}
.Select-menu-outer, .Select-menu {
  background: var(--surface) !important;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent) !important;
  max-height: 56vh !important;
  min-width: var(--filter-menu-min) !important;
  white-space: nowrap !important;
  color: var(--text) !important;
}
.Select-option, .VirtualizedSelectOption, .Select-value{
  white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
  line-height: 26px !important; height: 26px !important; font-size: 12px !important; color: var(--text) !important;
}
.Select-option.is-focused{ background: color-mix(in srgb, var(--primary) 8%, var(--surface) 92%) !important; }
.Select-option.is-selected{ background: color-mix(in srgb, var(--primary) 16%, var(--surface) 84%) !important; }

/* 顶部右上角 chips 图例 */
.legend{ margin-left:auto; }
#legend-box{
  padding:8px 10px; border-radius:12px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--text);
}

/* 公告区 */
#notice-ticker{
  width:100%; padding:8px 10px; margin:8px 0 10px;
  background: var(--surface-weak);
  border:1px solid color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  color: var(--text);
}

/* 图表容器 & 固定 modebar */
#map-graph{
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
}
.js-plotly-plot .modebar{
  position: fixed !important;
  /* top: var(--modebar-fixed-top) !important; */
  top: 40px !important;
  right: 24px !important;
  z-index: 100 !important;
  opacity: 1 !important;
  background: color-mix(in srgb, var(--surface) 92%, transparent) !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow-sm) !important;
  color: var(--text) !important;
}
/* .js-plotly-plot .modebar{
  position: absolute !important;
  top: 8px !important;
  right: 12px !important;
} */



/* —— Import 按钮（dcc.Upload 包裹的子按钮） —— */
#import-upload > button{
  background: var(--btn-bg, var(--surface));
  color: var(--btn-fg, var(--text));
  border: 1px solid var(--btn-bd, color-mix(in srgb, var(--text) 14%, transparent));
  border-radius: 10px;
  height: 32px;
  line-height: 30px;
  padding: 0 12px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform .06s ease, filter .12s ease, border-color .12s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
#import-upload > button:hover{
  filter: brightness(1.05);
  border-color: color-mix(in srgb, var(--text) 24%, transparent);
}
#import-upload > button:active{
  transform: translateY(1px);
}
#import-upload > button:focus{
  outline: 2px solid color-mix(in srgb, var(--text) 22%, transparent);
  outline-offset: 1px;
}

/* 上传输入本体通常隐藏，这里确保不占位 */
#import-upload input[type="file"]{
  display: none;
}

/* 导入反馈小字更柔和，跟随主题 */
#import-feedback{
  color: color-mix(in srgb, var(--text) 80%, transparent);
  font-size: 12px;
}

/* 深色/多主题下的按钮变量（若你已在别处定义了这些变量，可省略） */
.t5-app.theme-deepgray{
  --btn-bg: #20242b;
  --btn-fg: #e8edf6;
  --btn-bd: rgba(255,255,255,.16);
}
.t5-app.theme-gray{
  --btn-bg: #f2f3f5;
  --btn-fg: #222;
  --btn-bd: rgba(0,0,0,.12);
}
.t5-app.theme-blue{
  --btn-bg: #eef5ff;
  --btn-fg: #133457;
  --btn-bd: rgba(19,52,87,.22);
}
.t5-app.theme-green{
  --btn-bg: #eefaf1;
  --btn-fg: #0f3b23;
  --btn-bd: rgba(15,59,35,.22);
}
.t5-app.theme-pink{
  --btn-bg: #fff0f6;
  --btn-fg: #521b41;
  --btn-bd: rgba(82,27,65,.22);
}



/* 让 Import CSV/Excel 看起来与 Export data 完全一致 —— 放在 theme.css 末尾 */
#import-upload button,
#import-upload > button{
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* 悬停效果与 Export data 一致 */
#import-upload button:hover,
#import-upload > button:hover{
  filter: brightness(1.03);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* 焦点态（可选） */
#import-upload button:focus,
#import-upload > button:focus{
  outline: 2px solid color-mix(in srgb, var(--text) 22%, transparent);
  outline-offset: 1px;
}

/* 隐藏真实文件输入，保持布局干净 */
#import-upload input[type="file"]{
  display: none;
}







/* 小屏优化 */
@media (max-width:1100px){
  :root{ --sticky-offset: 60px; --modebar-fixed-top: 40px; }
}


/* 顶层覆盖弹窗 */
.modal-root{
  position: fixed;           /* 脱离文档流，覆盖全屏 */
  inset: 0;                  /* top/right/bottom/left = 0 */
  display: none;             /* 通过回调切换为 flex */
  align-items: center;       /* 垂直居中 */
  justify-content: center;   /* 水平居中 */
  background: rgba(0,0,0,.35);
  z-index: 2000;             /* 高于 Plotly modebar 等 */
}
/* 当 style="display:flex" 时显示（由回调控制） */
.modal-root[style*="display: flex"]{ display: flex; }

/* 弹窗卡片主体 */
.modal-card{
  background: var(--surface, #fff);
  color: var(--text, #222);
  padding: 14px 16px;
  border-radius: 12px;
  min-width: 520px;
  max-width: 90vw;     /* 防止超宽 */
  max-height: 80vh;    /* 防止超高 */
  overflow: auto;      /* 超出滚动 */
  box-shadow: 0 12px 36px rgba(0,0,0,.35);
}



/* —— 导入预览宽表对齐与可读性 —— */
.preview-wide-table {
  max-height: 60vh;             /* 高一点，减少滚动 */
  overflow: auto;
}
.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;          /* 与 Python 侧一致，确保列宽固定 */
}
.import-preview-table th,
.import-preview-table td{
  text-align: left;             /* ★表头与数据统一为左对齐 */
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  white-space: nowrap;          /* ★不换行 */
  overflow: hidden;             /* ★超出隐藏 */
  text-overflow: ellipsis;      /* ★显示省略号 */
  vertical-align: top;
  max-width: 280px;             /* 可按需调整列宽上限 */
}
.import-preview-table thead th{
  position: sticky;             /* （可选）表头吸顶 */
  top: 0;
  background: color-mix(in srgb, var(--surface) 92%, var(--text) 8%);
  z-index: 1;
}
.import-preview-table tbody tr:nth-child(odd){
  background: color-mix(in srgb, var(--surface) 95%, var(--text) 5%);
}



/* —— 导入预览宽表（容器） —— */
.preview-wide-table{
  max-height: 70vh;
  overflow: auto;                /* 横纵向滚动 */
  padding: 4px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}

/* —— 表格主体 —— */
.import-preview-table{
  border-collapse: collapse;
  table-layout: auto;            /* 列宽自适应 */
  width: max-content;            /* 由内容决定宽度（容器负责滚动） */
  min-width: 100%;
  font-size: 13px;
}

.import-preview-table th,
.import-preview-table td{
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  padding: 6px 8px;
  vertical-align: top;
  min-width: 140px;              /* 给每列一个基线宽度，可自调 */
}

/* 表头：允许换行，最多三行，溢出省略 */


/*  */
/* 表头 th 保持 table-cell 语义，不改 display */
.import-preview-table thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--surface) 92%, var(--text) 8%);
  text-align: left;
  white-space: normal;    /* 允许换行 */
  overflow: hidden;       /* 避免内容溢出 */
  line-height: 1.25;
}

/* 多行截断放到 th 内层包裹元素上，不影响 table 布局 */
.import-preview-table thead th .th-wrap{
  display: -webkit-box;
  -webkit-line-clamp: 3;      /* ★最多三行 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}





/* 数据：强制单行，超出省略，鼠标悬停看 title */
.import-preview-table tbody td{
  white-space: nowrap;           /* ★单行 */
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

/* 斑马线（可选） */
.import-preview-table tbody tr:nth-child(odd){
  background: color-mix(in srgb, var(--surface) 95%, var(--text) 5%);
}





/* 让 Import 与工具栏按钮一致（含 Export data） */
#refresh-btn,
#pixel-scale-btn,
#theme-btn,
#export-btn,
#clear-filters-btn,
#import-upload-wrap button{
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
#refresh-btn:hover,
#pixel-scale-btn:hover,
#theme-btn:hover,
#export-btn:hover,
#clear-filters-btn:hover,
#import-upload-wrap button:hover{
  filter: brightness(1.03);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}



/* 顶层遮罩：全屏覆盖、置中 */
.modal-root{
  position: fixed;
  inset: 0;
  display: none;                 /* 回调切换为 flex */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  z-index: 2000;
}
.modal-root[style*="display: flex"]{ display: flex; }

/* 弹窗卡片：不滚动，内部再分区 */
.modal-card{
  background: var(--surface, #fff);
  color: var(--text, #222);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,.35);
  max-width: min(96vw, 1200px);
  max-height: 86vh;
  width: auto;
  padding: 14px 16px;

  display: flex;
  flex-direction: column;
  overflow: hidden;              /* ★ 关键：卡片本身不滚动 */
}

/* 标题/摘要/页脚 */
.modal-title{ margin: 0 0 6px; }
.modal-summary{ margin-bottom: 8px; }
.modal-footer{ margin-top: 10px; text-align: right; }

/* 唯一的滚动容器：既纵向又横向 */
.modal-body{
  flex: 1 1 auto;
  overflow: auto;                /* ★ 唯一滚动层：垂直 + 水平 */
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: 8px;
  padding: 6px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

/* 预览宽表容器：不再滚动，由 .modal-body 负责滚动 */
.preview-wide-table{
  overflow: visible !important;  /* ★ 取消自身滚动 */
  max-height: none !important;   /* ★ 不限高 */
  padding: 0;
  border: 0;
  background: transparent;
}

/* 表格：列宽自适应 + 可横向滚动（由父容器产生滚动条） */
.import-preview-table{
  border-collapse: collapse;
  table-layout: auto;            /* ★ 自适应列宽 */
  width: max-content;            /* 宽度由内容决定 */
  min-width: 100%;
  font-size: 13px;
}

/* 表头与单元格：样式同之前（要点保留） */
.import-preview-table th,
.import-preview-table td{
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  padding: 6px 8px;
  vertical-align: top;
  min-width: 140px;
}
.import-preview-table thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--surface) 92%, var(--text) 8%);
  text-align: left;
  white-space: normal;    /* 表头可换行 */
  overflow: hidden;
  line-height: 1.25;
}
/* 表头多行截断放在内层 th-wrap（避免打破 table 布局） */
.import-preview-table thead th .th-wrap{
  display: -webkit-box;
  -webkit-line-clamp: 3;      /* 最多三行 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 数据单行省略（鼠标悬停看 title） */
.import-preview-table tbody td{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

/* 斑马线（可选） */
.import-preview-table tbody tr:nth-child(odd){
  background: color-mix(in srgb, var(--surface) 95%, var(--text) 5%);
}


.import-preview-table tbody td:first-child,
.import-preview-table thead th:first-child{
  position: sticky;
  left: 0;
  z-index: 2; /* 确保盖住后面列 */
  background: color-mix(in srgb, var(--surface) 96%, var(--text) 4%);
}



/* 让 Download Logs 与前面的按钮保持一致风格 */
#refresh-btn,
#pixel-scale-btn,
#theme-btn,
#export-btn,
#clear-filters-btn,
#import-upload-wrap button,
#download-logs-btn{
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
#refresh-btn:hover,
#pixel-scale-btn:hover,
#theme-btn:hover,
#export-btn:hover,
#clear-filters-btn:hover,
#import-upload-wrap button:hover,
#download-logs-btn:hover{
  filter: brightness(1.03);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}



/* 页脚上方操作条：右对齐 */
.above-footer-actions{
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 10px 0 6px 0;  /* 和主体/页脚留点间距 */
}

/* 让 Download Logs 与 Import/Export 按钮同风格（若已存在同组选择器，可确保包含 #download-logs-btn） */
#refresh-btn,
#pixel-scale-btn,
#theme-btn,
#export-btn,
#clear-filters-btn,
#export-pdf-btn,
#import-upload-wrap button,
#download-logs-btn{
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
#refresh-btn:hover,
#pixel-scale-btn:hover,
#theme-btn:hover,
#export-btn:hover,
#clear-filters-btn:hover,
#export-pdf-btn:hover,
#import-upload-wrap button:hover,
#download-logs-btn:hover{
  filter: brightness(1.03);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}



/* 
#fixed-filters-area, #filters-area { display:flex; flex-wrap:wrap; gap:8px; }
#fixed-filters-area > *, #filters-area > * { flex: 0 0 100%; max-width: 100%; } */




#fixed-filters-area, #filters-area { display:flex; flex-wrap:wrap; gap:8px; }
#fixed-filters-area > *, #filters-area > * { flex: 0 0 100%; max-width: 100%; }
/* 顶部功能按钮容器：紧跟标题，单行不换行，溢出隐藏 */



.t5-header-controls {
    display: flex;
    align-items: stretch;   /* 让子项高度跟随父容器 */
    flex-wrap: nowrap;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;       /* 窗口变窄时，右侧超出部分隐藏 */
    height: 100%;
    margin-left: 150px;     /* 距离标题 150 像素 */
  }
  
  /* 顶部按钮统一尺寸：宽 180px，高铺满标题栏 */
  .t5-header-btn {
    width: 120px;
    height: 100%;           /* 铺满标题栏高度 */
    padding: 0 12px;
  }
  

  /* ===== 顶部第一行：标题三列（左：logo+标题 / 中：功能按钮 / 右：用户按钮） ===== */
.t5-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;                 /* 你的标题栏高度 */
    background: #fff;
  }
  
  /* 中间功能按钮容器：紧跟标题右移 150px，单行不换行，溢出隐藏 */
  .t5-header-controls {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;             /* 变窄时右侧按钮裁掉，不换行 */
    height: 60px;                 /* 按钮行高度 = 60 */
    margin-left: 100px;           /* 和标题间距（可调） */
  }
  






  /* 顶部按钮公用样式：高度 60；宽度由各自 style/类控制
  .t5-header-btn {
    height: 60px;
    padding: 0 12px;


    
  } */
  
  /* 用户按钮/头像容器：与按钮同高、居中 */
  .t5-user-wrap {
    display: flex;
    align-items: center;
    height: 60px;
  }
  
  /* /===== 顶部第二行：Super Filter / Multi / Contains / Add Filters / 计数 ===== */
  /* .t5-header-subrow { */
    /* display: flex; */
    /* align-items: center; */
    /* gap: 8px; */
    /* white-space: nowrap; */
    /* overflow: hidden;             不换行，超出即裁掉 */
    /* height: 42px;                 第二行高度（可调） */
    /* background: #fff; */
  /* } */
  
  /* 常用固定宽度工具类（可自行追加/修改） */
  .t5-w-90  { width: 90px;  }
  .t5-w-100 { width: 100px; }
  .t5-w-105 { width: 105px; }
  .t5-w-110 { width: 110px; }
  .t5-w-115 { width: 115px; }
  .t5-w-150 { width: 150px; }
  .t5-w-300 { width: 300px; }
  
  /* ===== 消息提示 + 图例：一行两列，不换行 ===== */
  .t5-notice-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    margin: 8px 0;
    background: #fff;
  }
  .t5-notice-cell { flex: 1 1 auto; min-width: 240px; } /* 左：占剩余 */
  .t5-legend-cell { flex: 0 0 320px; }                  /* 右：固定宽（可改） */
  


.filters-title{ font-weight:600; font-size:11px; margin-right:6px; color: var(--text-weak); }
.filters-title.spaced{ margin-left:20px; }
.filters-empty{ color:var(--text-weak); }





/* 左侧栏内：两个区都改为竖向单列 */
#left-sidebar #fixed-filters-area,
#left-sidebar #filters-area{
  display: flex !important;
  flex-direction: column !important;
  gap: 8px;
}

/* 直接子项与常见包裹块都占满一行 */
#left-sidebar #fixed-filters-area > *,
#left-sidebar #filters-area > *,
#left-sidebar .filter-row{
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
}

/* 下拉/输入控件在左栏也撑满 */
#left-sidebar .Select-control,
#left-sidebar input[type="text"]{
  width: 100% !important;
}




/* === 左侧栏筛选区强制竖向单列（优先级很高） === */
#left-sidebar #fixed-filters-area,
#left-sidebar #filters-area {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
}

#left-sidebar #fixed-filters-area > *,
#left-sidebar #filters-area > * {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
}

/* AntD 常见“横向”元兜底：把它们都扭成竖排 */
#left-sidebar #fixed-filters-area .ant-form-inline,
#left-sidebar #filters-area .ant-form-inline,
#left-sidebar #fixed-filters-area .ant-space-horizontal,
#left-sidebar #filters-area .ant-space-horizontal,
#left-sidebar #fixed-filters-area .ant-row,
#left-sidebar #filters-area .ant-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
}

#left-sidebar #fixed-filters-area .ant-form-item,
#left-sidebar #filters-area .ant-form-item,
#left-sidebar #fixed-filters-area .ant-col,
#left-sidebar #filters-area .ant-col,
#left-sidebar #fixed-filters-area .ant-space-item,
#left-sidebar #filters-area .ant-space-item {
  width: 100% !important;
  max-width: 100% !important;
  margin-right: 0 !important; /* 覆盖 inline form 的右间距 */
}

/* dcc.Dropdown / Input 等在左栏也铺满 */
#left-sidebar #fixed-filters-area .Select,
#left-sidebar #filters-area .Select,
#left-sidebar #fixed-filters-area input[type="text"],
#left-sidebar #filters-area input[type="text"] {
  width: 100% !important;
  display: block !important;
}









/* 覆盖 Graph 容器默认行为，确保填满剩余高度 */
#right-pane .dash-graph {
  height: 100% !important;
}

/* 模态框作为覆盖层显示，避免撑高页面 */
.modal-root {
  position: fixed; inset: 0; display: none;
}
.modal-root[style*="display: block"] { display: flex !important; align-items: center; justify-content: center; }
.modal-card { max-height: 80vh; overflow: auto; }









/* 下拉消息面板：头部下方；左 240px 到右边；与头部风格一致 */
.messages-panel {
  position: fixed;
  top: 50px;      /* ← 和你的全局吸顶 header 高度一致 */
  left: 300px;    /* ← 和左侧栏宽度一致 */
  right: 0;
  z-index: 1000;  /* 盖过主图 & topbar，但低于全屏 modal */
  display: none;
}

.messages-inner {
  background: #fff;
  border-bottom: 1px solid #eaeaea;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  padding: 12px 16px;
  max-height: 50vh;   /* 下拉最大高度 */
  overflow: auto;     /* 内容滚动 */
  box-sizing: border-box;
}

.messages-title { font-weight: 600; margin-bottom: 8px; }
.messages-body  { display: block; }














/* 整行：与你的 topbar 风格一致的高度/间距 */
.legend-message-row {
  display: flex;
  align-items: center;      /* 垂直居中 */
  gap: 12px;
  height: 40px;            /* 你想要的行高 */
  padding: 0 12px;
  box-sizing: border-box;
}

/* 左侧：Legend Filters 固定宽度、内容靠左 */
.legend-filter-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;          /* 固定内容宽度 */
}

/* 右侧：消息区占剩余宽度，隐藏溢出，用于跑马灯 */
.legend-message-marquee {
  flex: 1 1 auto;          /* 占满剩余宽度 */
  overflow: hidden;        /* 只显示可视区域 */
  white-space: nowrap;     /* 单行滚动 */
}

/* 跑马灯内容：右→左滚动 */
.marquee-content {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
  animation-name: t5-marquee-rtl;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: 20s;              /* 默认 20s，可在回调里动态覆盖 */
  padding-left: 100%;                    /* 起始在可视区右外侧 */
}

/* 右→左关键帧 */
@keyframes t5-marquee-rtl {
  0%   { transform: translateX(0%);     }
  100% { transform: translateX(-100%);  }
}

/* 可选：鼠标悬停时暂停滚动 */
.legend-message-marquee:hover .marquee-content {
  animation-play-state: paused;
}



.legend-message-row{
  display:flex; align-items:center; gap:12px;
  height:40px; padding:0 12px; box-sizing:border-box;
}
.legend-filter-left{ display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.legend-message-marquee{ flex:1 1 auto; overflow:hidden; white-space:nowrap; }
.marquee-content{
  display:inline-block; white-space:nowrap; will-change:transform;
  animation-name:t5-marquee-rtl; animation-timing-function:linear;
  animation-iteration-count:infinite; animation-duration:20s;
  padding-left:100%;
}
@keyframes t5-marquee-rtl{
  0%{ transform: translateX(0%); }
  100%{ transform: translateX(-100%); }
}
.legend-message-marquee:hover .marquee-content{ animation-play-state: paused; }



/* 左侧栏让 Add Filters 下拉控件铺满整行 */
#left-sidebar #add-filter-dd { width: 100% !important; }
#left-sidebar #add-filter-dd .Select,
#left-sidebar #add-filter-dd .Select-control {
  width: 100% !important;
  min-width: 0 !important;
}
#left-sidebar .soft-label { display: block; } /* 标题独占一行、更稳 */






/* 一行容器（与 topbar 风格一致） */
.legend-message-row{
  display:flex; align-items:center; gap:12px;
  height:40px; padding:0 12px; box-sizing:border-box;
}

/* 左 500 宽的 Legend Filters 不变 */
.legend-filter-left{ display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.legend-filter-left input, .legend-filter-left .Select, .legend-filter-left .Select-control{ height: 28px; }

/* 右侧消息：只显示文字，不要框，不要背景，不要 padding */
.legend-message-marquee{
  flex:1 1 auto;
  overflow:hidden;            /* 仅隐藏水平溢出，用于跑马灯 */
  white-space:nowrap;
  border:none; background:transparent; padding:0; box-shadow:none;
  line-height:40px;           /* 让文字在 40px 高度里居中 */
}

/* 跑马灯文字：右→左滚动 */
.marquee-content{
  display:inline-block; white-space:nowrap; will-change:transform;
  animation-name:t5-marquee-rtl; animation-timing-function:linear;
  animation-iteration-count:infinite; animation-duration:20s;  /* 可调 */
  padding-left:100%;          /* 起点在可视区域右边外 */
}

/* 关键帧 */
@keyframes t5-marquee-rtl { 0%{transform:translateX(0%);} 100%{transform:translateX(-100%);} }

/* 悬停可暂停（可选） */
.legend-message-marquee:hover .marquee-content{ animation-play-state: paused; }



.legend-message-marquee{ flex:1 1 auto; overflow:hidden; white-space:nowrap; line-height:40px; }
.marquee-content{
  display:inline-block; white-space:nowrap; will-change:transform;
  animation:t5-marquee-rtl 20s linear infinite; padding-left:100%;
}
@keyframes t5-marquee-rtl{ 0%{transform:translateX(0%)} 100%{transform:translateX(-100%)} }




/* 一行容器 */
.legend-message-row{ display:flex; align-items:center; gap:12px; height:40px; padding:0 12px; box-sizing:border-box; }
.legend-filter-left{ display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.legend-message-marquee{
  flex:1 1 auto; overflow:hidden; position:relative; white-space:nowrap; border:none; background:transparent; padding:0; line-height:15px;
}
/* 无缝轨道：双份文本 + 平移动画（不再使用 padding-left 技术） */
.marquee-track{
  display:inline-block; white-space:nowrap; will-change:transform;
  animation: t5-marquee 20s linear infinite;     /* 时长可被回调动态覆盖 */
}
@keyframes t5-marquee { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }  /* 因为双份文本，位移 50% 恰好无缝 */
.legend-message-marquee:hover .marquee-track{ animation-play-state: paused; }




/* 右下区域整链路都给到 100% 高，防止中间某层卡住高度 */
#right-pane,
#right-pane > div,
#right-pane .t5-app {
  height: 100%;
}

/* 图表宿主（flex:1）必须可收缩，Graph 本体必须 100% 高 */
#right-pane .graph-area {
  flex: 1 1 auto;
  min-height: 0;     /* ← 非常关键，允许在父容器内收缩 */
  overflow: hidden;
}

/* 最保险：Dash/Plotly 的容器也强制 100% 高度 */
#right-pane .dash-graph,
#right-pane .js-plotly-plot {
  height: 100% !important;
  width: 100% !important;
}




/* 把 top:40px 改回变量版 */
.t5-app .js-plotly-plot .modebar{
  position: fixed !important;
  top: var(--modebar-fixed-top) !important;
  right: 24px !important;
  z-index: 120 !important;
}




/* 整行本来就是 40px 高度居中 */
.legend-message-row { display:flex; align-items:center; height:40px; }

/* 只调这一处下拉的 React-Select 内部高度，确保与行高和 label 居中对齐 */
.legend-filter-left .legend-dd .Select-control{
  height: 22px;          /* 你要的控件高度，可以改 32px */
  min-height: 24px;
}
.legend-filter-left .legend-dd .Select-placeholder,
.legend-filter-left .legend-dd .Select-value{
  line-height: 20px;     /* 文本垂直居中 */
}
.legend-filter-left .legend-dd .Select-input{
  height: 20px;
}


/* 控件本体宽度（容器、外壳、控制条）都锁到 500px */
.legend-filter-left .legend-dd,
.legend-filter-left .legend-dd .Select,
.legend-filter-left .legend-dd .Select-control{
  width: 500px !important;
  max-width: 500px !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

/* 弹出菜单宽度 = 500px；并贴齐输入框左侧 */
.legend-filter-left .legend-dd .Select-menu-outer{
  width: 100px !important;
  max-width: 100px !important;
  min-width: 0 !important;
  left: 0 !important;
  right: auto !important;
}

/* 可选：限制菜单高度，出现滚动条而不是撑大 */
.legend-filter-left .legend-dd .Select-menu-outer{
  max-height: 40px;             /* 按需调整 */
  overflow-y: auto;
}





#pa-graph .modebar-container {
  position: absolute !important;  /* 相对于图容器定位 */
  top: 8px !important;            /* 距主图内容区上边 8px */
  right: 8px !important;          /* 锚定主图右上角，不再靠左 */
  left: auto !important;
  bottom: auto !important;
  z-index: 10;                    /* 保证在曲线之上，但不会盖住右侧表格 */
}

/* 兜底：确保容器有定位上下文（一般 Plotly 自带，这里加一层保险） */
#pa-graph .js-plotly-plot,
#pa-graph .plot-container {
  position: relative;
}