/* 本地字体 */
@font-face {
  font-family: "Comfortaa";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/comfortaa-500.ttf") format("truetype");
}
@font-face {
  font-family: "Comfortaa";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/comfortaa-700.ttf") format("truetype");
}

:root {
  --bg0: #eef8f4;
  --bg1: #e6f3fa;
  --line: rgba(45, 140, 120, 0.14);
  --text: #1c322e;
  --muted: #6b857e;
  --accent: #2f9d8a;
  --accent-soft: rgba(47, 157, 138, 0.12);
  --danger: #d45d6a;
  --radius: 14px;
  --shadow: 0 10px 28px rgba(45, 100, 90, 0.08);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body, #app {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 8% 0%, rgba(126, 201, 180, 0.35), transparent 55%),
    radial-gradient(800px 420px at 100% 10%, rgba(150, 205, 230, 0.32), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 55%, #f7fcfa);
}
#app { background: transparent; }
[v-cloak] { display: none !important; }

/* ---- login ---- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 24px;
}
.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 360px at 15% 20%, rgba(94, 189, 168, 0.28), transparent 60%),
    radial-gradient(640px 320px at 85% 75%, rgba(130, 190, 220, 0.26), transparent 55%),
    linear-gradient(160deg, #eaf7f2, #e8f4fa 50%, #f5fbf8);
}
.glass {
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  border-radius: 18px;
}
.login-card {
  position: relative;
  width: min(420px, 92vw);
  padding: 28px 28px 22px;
}
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.brand h1 {
  margin: 0;
  font-family: Comfortaa, "PingFang SC", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: #1a3d36;
}
.brand p { margin: 6px 0 0; color: var(--muted); font-size: .86rem; }
.logo-mark {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #5ec4b0, #6eb8d0);
  color: #fff; font-weight: 700; font-family: Comfortaa, sans-serif;
  box-shadow: 0 8px 20px rgba(47, 157, 138, 0.28);
}
.logo-mark.sm { width: 36px; height: 36px; font-size: .85rem; border-radius: 10px; }
.captcha-row { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: center; width: 100%; }
.captcha-img {
  height: 32px; width: 120px; border-radius: 4px; cursor: pointer;
  border: 1px solid #dcdfe6; background: #fff; object-fit: cover;
}
.login-extra { margin: 2px 0 8px; }
.login-btn { width: 100%; margin-top: 4px; }
.msg { min-height: 1.2em; color: var(--danger); font-size: .86rem; margin: 8px 0 0; }

/* ---- layout：左侧固定，右侧独立滚动 ---- */
.layout {
  height: 100vh !important;
  max-height: 100vh;
  overflow: hidden !important;
}
.layout > .el-container {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sider {
  background: rgba(255, 255, 255, 0.86) !important;
  border-right: 1px solid var(--line);
  padding: 12px 8px 16px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  height: 100vh !important;
  overflow: hidden;
  flex-shrink: 0;
}
.sider-brand {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 10px 12px; margin-bottom: 4px;
}
.sider-brand strong {
  display: block;
  font-family: Comfortaa, "PingFang SC", sans-serif;
  font-size: 1rem;
  color: #1a3d36;
}
.sider-brand small { color: var(--muted); font-size: 12px; }

/* 统一菜单高度：Element 默认偏高且易不一致 */
.side-menu {
  border-right: none !important;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: transparent !important;
}
.side-menu.el-menu {
  border-right: none !important;
  background: transparent !important;
}
.side-menu .el-menu-item {
  height: 40px !important;
  line-height: 40px !important;
  margin: 2px 6px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
}
.side-menu .el-menu-item:hover {
  background: rgba(47, 157, 138, 0.08) !important;
}
.side-menu .el-menu-item.is-active {
  background: var(--accent-soft) !important;
  color: #176b5c !important;
  font-weight: 600;
}
.logout-btn { margin: 10px 8px 0; width: calc(100% - 16px); }

.topbar {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.78) !important;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  padding: 0 20px !important;
}
.topbar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1a3d36;
}
.top-right { display: flex; gap: 8px; align-items: center; }
.tenant-config-header { margin-bottom: 8px; }
.tenant-config-name { margin-left: 8px; font-weight: 600; color: #334155; }
.ml8 { margin-left: 8px; }
.page {
  padding: 18px 20px 32px !important;
  background: transparent !important;
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  box-sizing: border-box;
}
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a3d36;
}
.mb8 { margin-bottom: 8px; }
.mt16 { margin-top: 16px; }
.pager-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.cache-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.4;
  font-size: 12px;
}

.stat-card { margin-bottom: 0; }
.stat-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-num {
  font-size: 26px;
  font-family: Comfortaa, sans-serif;
  font-weight: 700;
  color: var(--accent);
}

/* 总览授权条 */
.lic-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}
.lic-banner.is-ok {
  border-color: rgba(47, 157, 138, 0.35);
  background:
    linear-gradient(120deg, rgba(47, 157, 138, 0.12), rgba(255, 255, 255, 0.92) 45%);
}
.lic-banner.is-warn {
  border-color: rgba(212, 93, 106, 0.35);
  background:
    linear-gradient(120deg, rgba(212, 93, 106, 0.10), rgba(255, 255, 255, 0.92) 45%);
}
.lic-banner-main { flex: 1; min-width: 0; }
.lic-banner-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 700;
  color: #1a3d36;
}
.lic-banner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.lic-item {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(45, 140, 120, 0.10);
}
.lic-k {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.lic-v {
  font-size: 18px;
  font-weight: 700;
  color: #1a3d36;
  word-break: break-all;
  line-height: 1.35;
}
@media (max-width: 960px) {
  .lic-banner { flex-direction: column; align-items: stretch; }
  .lic-banner-grid { grid-template-columns: 1fr; }
}
.hint { margin: 0; color: var(--muted); line-height: 1.7; font-size: 14px; }
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar .search-input {
  width: 320px;
  max-width: 100%;
}
.toolbar .lang-select {
  width: 200px;
  max-width: 100%;
}
.toolbar-spacer { flex: 1; min-width: 8px; }
/* 搜索区控件略放大，查询按钮更醒目 */
.toolbar .el-input,
.toolbar .el-select {
  --el-component-size: 36px;
}
.toolbar .el-input__wrapper {
  min-height: 36px;
  font-size: 14px;
}
.toolbar .el-select .el-select__wrapper {
  min-height: 36px;
  font-size: 14px;
}
.toolbar .el-button {
  min-height: 36px;
  padding: 8px 18px;
  font-size: 14px;
}
.toolbar .el-button--primary.is-query,
.toolbar .btn-query {
  min-width: 88px;
  font-weight: 600;
}
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mb14 { margin-bottom: 14px; }

.btn-copy-account {
  color: #fff !important;
  background-color: #2f9d8a !important;
  border-color: #2f9d8a !important;
  height: 32px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
.btn-copy-account:hover,
.btn-copy-account:focus {
  color: #fff !important;
  background-color: #278f7d !important;
  border-color: #278f7d !important;
}
.drag-handle {
  cursor: grab;
  user-select: none;
  color: #6b7280;
  font-size: 14px;
  letter-spacing: -2px;
  padding: 4px 6px;
  display: inline-block;
}
.drag-handle:active { cursor: grabbing; }
.cfg-hosts-cell { display: flex; align-items: center; gap: 8px; }
.cfg-percent-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cfg-percent-suffix {
  color: var(--el-text-color-secondary, #909399);
  font-size: 13px;
  min-width: 1em;
}

/* 表格操作按钮：始终可见、对比清晰（避免 link 按钮在自定义主题下“看不见字”） */
.op-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.op-btns .el-button {
  margin: 0 !important;
  height: 28px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  line-height: 26px !important;
}
.op-btns .el-button--primary:not(.is-disabled) {
  color: #fff !important;
  background-color: #2f9d8a !important;
  border-color: #2f9d8a !important;
}
.op-btns .el-button--primary:not(.is-disabled):hover,
.op-btns .el-button--primary:not(.is-disabled):focus {
  color: #fff !important;
  background-color: #278f7d !important;
  border-color: #278f7d !important;
}
.op-btns .el-button--primary.is-disabled,
.op-btns .el-button--primary.is-disabled:hover,
.op-btns .el-button--primary.is-disabled:focus {
  color: #fff !important;
  background-color: #2f9d8a !important;
  border-color: #2f9d8a !important;
  opacity: 0.5 !important;
}
.op-btns .el-button--danger:not(.is-disabled) {
  color: #fff !important;
  background-color: #d45d6a !important;
  border-color: #d45d6a !important;
}
.op-btns .el-button--danger:not(.is-disabled):hover,
.op-btns .el-button--danger:not(.is-disabled):focus {
  color: #fff !important;
  background-color: #c04b58 !important;
  border-color: #c04b58 !important;
}
.op-btns .el-button--danger.is-disabled,
.op-btns .el-button--danger.is-disabled:hover,
.op-btns .el-button--danger.is-disabled:focus {
  color: #fff !important;
  background-color: #d45d6a !important;
  border-color: #d45d6a !important;
  opacity: 0.5 !important;
}
.op-btns .el-button--info {
  color: #1a3d36 !important;
  background-color: #e8f4f1 !important;
  border-color: #b7d9d0 !important;
}
.op-btns .el-button--info:hover,
.op-btns .el-button--info:focus {
  color: #176b5c !important;
  background-color: #d7efe8 !important;
  border-color: #2f9d8a !important;
}
.op-btns .el-button.is-plain {
  --el-button-bg-color: #fff;
}
/* 引擎「测试」：loading 图标放在文字右侧（Element Plus 默认在左侧） */
.op-btns .engine-test-btn.is-loading {
  flex-direction: row-reverse;
  gap: 6px;
}
.ait-dropdown-caret {
  margin-left: 4px;
  font-style: normal;
  opacity: 0.75;
}
.ait-admin-form .el-form-item {
  margin-bottom: 16px;
}
.ait-admin-form .hint {
  line-height: 1.5;
}
.cfg-switch-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}
.cfg-op-hint {
  color: var(--muted);
  font-size: 12px;
}
.pre {
  white-space: pre-wrap;
  color: var(--muted);
  background: #f5faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  margin: 0 0 12px;
}

/* Element 主题微调：小清新
 * 实心 primary 强制白字青绿底；排除 plain/link/text/disabled，避免浅色字叠深色底、禁用态被 !important 盖成「可点」 */
.el-button--primary:not(.is-plain):not(.is-link):not(.is-text):not(.is-disabled) {
  color: #fff !important;
  background-color: #2f9d8a !important;
  border-color: #2f9d8a !important;
}
.el-button--primary:not(.is-plain):not(.is-link):not(.is-text):not(.is-disabled):hover,
.el-button--primary:not(.is-plain):not(.is-link):not(.is-text):not(.is-disabled):focus {
  color: #fff !important;
  background-color: #278f7d !important;
  border-color: #278f7d !important;
}
.el-button--primary.is-plain:not(.is-disabled) {
  color: #176b5c !important;
  background-color: #e8f4f1 !important;
  border-color: #9fd5ca !important;
}
.el-button--primary.is-plain:not(.is-disabled):hover,
.el-button--primary.is-plain:not(.is-disabled):focus {
  color: #fff !important;
  background-color: #2f9d8a !important;
  border-color: #2f9d8a !important;
}
.el-button--primary.is-link:not(.is-disabled),
.el-button--primary.is-text:not(.is-disabled) {
  color: #2f9d8a !important;
  background-color: transparent !important;
  border-color: transparent !important;
}
.el-button--primary.is-link:not(.is-disabled):hover,
.el-button--primary.is-link:not(.is-disabled):focus,
.el-button--primary.is-text:not(.is-disabled):hover,
.el-button--primary.is-text:not(.is-disabled):focus {
  color: #176b5c !important;
}
/* 禁用态：保留主题色但降透明度，避免看起来仍可点击 */
.el-button--primary.is-disabled:not(.is-plain):not(.is-link):not(.is-text),
.el-button--primary.is-disabled:not(.is-plain):not(.is-link):not(.is-text):hover,
.el-button--primary.is-disabled:not(.is-plain):not(.is-link):not(.is-text):focus {
  color: #fff !important;
  background-color: #2f9d8a !important;
  border-color: #2f9d8a !important;
  opacity: 0.5 !important;
}
.el-button--primary.is-plain.is-disabled,
.el-button--primary.is-plain.is-disabled:hover,
.el-button--primary.is-plain.is-disabled:focus {
  color: #176b5c !important;
  background-color: #e8f4f1 !important;
  border-color: #9fd5ca !important;
  opacity: 0.5 !important;
}
.el-button--primary.is-link.is-disabled,
.el-button--primary.is-link.is-disabled:hover,
.el-button--primary.is-link.is-disabled:focus,
.el-button--primary.is-text.is-disabled,
.el-button--primary.is-text.is-disabled:hover,
.el-button--primary.is-text.is-disabled:focus {
  color: #2f9d8a !important;
  background-color: transparent !important;
  border-color: transparent !important;
  opacity: 0.5 !important;
}
.el-input__inner:focus,
.el-textarea__inner:focus {
  border-color: #2f9d8a !important;
}
.el-select .el-input.is-focus .el-input__inner {
  border-color: #2f9d8a !important;
}
.el-switch.is-checked .el-switch__core {
  border-color: #2f9d8a !important;
  background-color: #2f9d8a !important;
}
.el-checkbox__input.is-checked .el-checkbox__inner,
.el-radio__input.is-checked .el-radio__inner {
  border-color: #2f9d8a !important;
  background: #2f9d8a !important;
}
.el-card {
  border-radius: 12px !important;
  border-color: var(--line) !important;
}
.el-table {
  border-radius: 10px;
}
/*
 * 列宽交给 Element Plus（width/min-width + 拖拽调整）。
 * 禁止再用 col:nth-child + !important 锁死百分比，否则：
 * 1) 列宽与内容不符  2) 表头拖拽改宽无效
 */
.el-table.ait-table {
  width: 100%;
}
.el-table.ait-table .el-table__body-wrapper {
  overflow-x: auto;
}
.el-table .col-index,
.el-table .col-index .cell {
  text-align: center !important;
  vertical-align: middle !important;
}
.el-table.ait-table .cell {
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 拖拽分隔线更易点中 */
.el-table.ait-table .el-table__column-resize-proxy {
  background-color: var(--brand, #2f9d8a);
}
.el-table.ait-table th.el-table__cell {
  user-select: none;
}
.el-dialog { border-radius: 12px; }
/*
 * 引擎弹窗：定高 + 仅 form 滚动。
 * Element Plus 默认 .el-overlay / .el-overlay-dialog 均为 overflow:auto，
 * 且 .el-dialog 有 margin-bottom:50px，整窗略超视口时会出现双滚动条。
 */
.el-overlay:has(.el-dialog.engine-dlg),
.el-overlay-dialog:has(.el-dialog.engine-dlg) {
  overflow: hidden !important;
}
.el-dialog.engine-dlg {
  --engine-dlg-width: 1280px;
  --el-dialog-margin-top: 2vh;
  width: var(--engine-dlg-width) !important;
  max-width: calc(100vw - 24px);
  /* 定高（不是只 max-height），flex 子项才能正确收缩出滚动条 */
  height: calc(100vh - 4vh) !important;
  max-height: calc(100vh - 4vh) !important;
  margin: 2vh auto !important; /* 覆盖 EP 默认 margin … auto 50px */
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box;
}
.el-dialog.engine-dlg .el-dialog__header {
  padding: 14px 18px 10px;
  margin-right: 0;
  flex: 0 0 auto;
}
/*
 * 双滚动条根因：.el-dialog__body 与 form.engine-form 同时 overflow:auto。
 * form 上写 overflow-x:hidden 时，按 CSS 规范 overflow-y 会算成 auto，再叠一层。
 * 策略：body 只做裁剪容器，唯一滚动层放在 form。
 */
.el-dialog.engine-dlg .el-dialog__body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding-top: 8px;
  padding-bottom: 4px;
}
.el-dialog.engine-dlg .el-dialog__footer {
  flex: 0 0 auto;
  padding: 10px 18px 16px;
}
.el-dialog.engine-dlg.is-maximized,
.el-dialog.engine-dlg.is-fullscreen {
  width: 100% !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border-radius: 0;
  /* EP .is-fullscreen 默认 overflow:auto，会与内容区叠出第二条 */
  overflow: hidden !important;
}
.el-dialog.engine-dlg.is-maximized .el-dialog__body,
.el-dialog.engine-dlg.is-fullscreen .el-dialog__body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
}

/* 导出私有化：宽弹窗 + 两列，可放大还原 */
.el-overlay:has(.el-dialog.onprem-export-dlg),
.el-overlay-dialog:has(.el-dialog.onprem-export-dlg) {
  overflow: hidden !important;
}
.el-dialog.onprem-export-dlg {
  --onprem-export-dlg-width: 980px;
  --el-dialog-margin-top: 4vh;
  width: var(--onprem-export-dlg-width) !important;
  max-width: calc(100vw - 24px);
  height: calc(100vh - 8vh) !important;
  max-height: calc(100vh - 8vh) !important;
  margin: 4vh auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box;
}
.el-dialog.onprem-export-dlg .el-dialog__header {
  padding: 14px 18px 10px;
  margin-right: 0;
  flex: 0 0 auto;
}
.el-dialog.onprem-export-dlg .el-dialog__body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding-top: 6px;
  padding-bottom: 8px;
  overscroll-behavior: contain;
}
.el-dialog.onprem-export-dlg.is-maximized,
.el-dialog.onprem-export-dlg.is-fullscreen {
  width: 100% !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border-radius: 0;
}
.el-dialog.onprem-export-dlg.is-maximized .el-dialog__body,
.el-dialog.onprem-export-dlg.is-fullscreen .el-dialog__body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
}
.onprem-export-lead {
  margin: 0 0 8px;
  line-height: 1.55;
}
.onprem-export-meta {
  margin: 0 0 14px;
  line-height: 1.5;
  padding: 10px 12px;
  background: #f7f9fc;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.onprem-export-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: #606266;
  word-break: break-word;
}
.onprem-export-form .el-form-item {
  margin-bottom: 14px;
}
.onprem-export-form .el-form-item__label {
  white-space: nowrap;
}
.onprem-export-num {
  width: 100%;
}
.onprem-export-num.el-input-number {
  width: 100%;
}
.onprem-export-num .el-input__wrapper {
  width: 100%;
}
.onprem-export-section-title {
  margin: 6px 0 10px;
  padding-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #303133);
  border-top: 1px solid #eef0f4;
}
.onprem-export-section-title.is-first {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.onprem-export-opt-block {
  margin: 0 0 12px;
  padding: 10px 12px 8px;
  background: #fafbfc;
  border: 1px solid #eef0f4;
  border-radius: 8px;
}
.onprem-export-opt-caption {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #909399;
  letter-spacing: 0.02em;
}
.onprem-export-switch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}
.onprem-export-switch-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 38px;
  padding: 8px 12px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 8px;
}
.onprem-export-switch-item > span {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: #303133;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 开关在左、文案在右，整项包在卡片内，避免开关贴上下一项标签 */
.onprem-export-switch-item .el-switch {
  flex: 0 0 auto;
}
.onprem-export-ports {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e4e7ed;
}
.onprem-export-port-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.onprem-export-port-item.onprem-export-port-model {
  grid-column: 1 / -1;
  max-width: 360px;
}
.onprem-export-port-lbl {
  flex: 0 0 84px;
  font-size: 12px;
  color: #606266;
  white-space: nowrap;
}
.onprem-export-port-item.onprem-export-port-model .onprem-export-port-lbl {
  flex-basis: 96px;
}
.onprem-export-port-num {
  flex: 1 1 auto;
  width: auto !important;
  max-width: 160px;
}
.onprem-export-port-num.el-input-number {
  width: 100%;
  max-width: 160px;
}
.onprem-export-jdk-hint,
.onprem-export-field-hint {
  margin: 4px 0 0;
  line-height: 1.45;
}
.onprem-export-alert {
  margin: 0 0 12px;
}
.onprem-export-progress {
  margin: 4px 0 12px;
  padding: 10px 12px;
  background: #f7f9fc;
  border-radius: 6px;
}
.onprem-export-progress-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.onprem-export-result-banner {
  margin: 0 0 10px;
}
.onprem-export-result {
  line-height: 1.7;
  word-break: break-all;
}
.onprem-export-dl-hint {
  margin-top: 6px;
  color: #666;
}
@media (max-width: 900px) {
  .el-dialog.onprem-export-dlg {
    --onprem-export-dlg-width: calc(100vw - 16px);
  }
  .onprem-export-form .el-col {
    max-width: 100%;
    flex: 0 0 100%;
  }
  .onprem-export-switch-grid,
  .onprem-export-ports {
    grid-template-columns: 1fr;
  }
  .onprem-export-port-item.onprem-export-port-model {
    max-width: none;
  }
  .onprem-export-port-lbl {
    flex-basis: 72px;
  }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .onprem-export-switch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.engine-dlg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 32px;
  padding-right: 0;
}
.engine-dlg-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 32px;
}
.engine-dlg-header-actions,
.ait-dlg-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  flex-shrink: 0;
  height: 32px;
}
.engine-dlg-hdr-btn,
.ait-dlg-max-btn.engine-dlg-hdr-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  line-height: 1;
  vertical-align: middle;
  flex: 0 0 32px;
}
.engine-dlg-hdr-btn:hover,
.ait-dlg-max-btn.engine-dlg-hdr-btn:hover {
  background: rgba(47, 157, 138, 0.12);
  color: var(--accent);
}
.engine-dlg-hdr-btn.is-close:hover {
  background: rgba(212, 93, 106, 0.12);
  color: var(--danger);
}
.engine-dlg-ico {
  display: block;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  position: relative;
  margin: 0 !important;
  flex-shrink: 0;
}
.engine-dlg-ico-max {
  border: 1.5px solid currentColor;
  border-radius: 1px;
}
.engine-dlg-ico-restore {
  border: 1.5px solid currentColor;
  border-radius: 1px;
  width: 10px;
  height: 10px;
  /* 用定位代替 margin，避免与放大/关闭垂直错位 */
  box-shadow: 3px -3px 0 -1px #fff, 3px -3px 0 0 currentColor;
  background: #fff;
  position: relative;
  top: 1px;
  left: -1px;
}
.engine-dlg-ico-close::before,
.engine-dlg-ico-close::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
}
.engine-dlg-ico-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.engine-dlg-ico-close::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* 普通弹窗：放大 + 系统关闭 同一行水平对齐 */
.el-dialog__header {
  position: relative;
  display: flex !important;
  align-items: center !important;
  min-height: 32px;
  padding-right: 76px !important; /* 放大32 + 关闭32 + 间距 */
  box-sizing: border-box;
}
.el-dialog__header .el-dialog__title {
  line-height: 32px;
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}
.el-dialog__header .ait-dlg-header-actions {
  position: absolute;
  top: 50%;
  right: 40px; /* 紧贴关闭按钮左侧 */
  transform: translateY(-50%);
  margin: 0;
  height: 32px;
  z-index: 2;
}
.el-dialog__header .ait-dlg-header-actions.is-solo {
  right: 4px;
}
.el-dialog__header:not(:has(.el-dialog__headerbtn)) {
  padding-right: 44px !important;
}
.el-dialog__headerbtn {
  top: 50% !important;
  right: 4px !important;
  width: 32px !important;
  height: 32px !important;
  transform: translateY(-50%);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 16px !important;
  z-index: 2;
}
.el-dialog__headerbtn .el-dialog__close {
  font-size: 16px !important;
}
/* 自定义头（引擎/导出）不需要为系统关闭留空 */
.el-dialog.engine-dlg .el-dialog__header,
.el-dialog.onprem-export-dlg .el-dialog__header {
  padding-right: 14px !important;
}
.engine-form {
  --engine-label-width: 140px;
  max-width: 100%;
  /* 勿单独写 overflow-x:hidden：会把 overflow-y 算成 auto，叠出第二滚动条 */
  overflow: visible;
}
.el-dialog.engine-dlg .engine-form {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto; /* 引擎弹窗唯一纵向滚动层 */
  overscroll-behavior: contain;
  padding-right: 2px;
}
.engine-form .el-row {
  max-width: 100%;
}
.engine-form .el-col {
  min-width: 0;
}
.engine-form .el-form-item {
  margin-bottom: 14px;
  max-width: 100%;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
}
/* 多行：标签贴顶，避免和 textarea 垂直居中错位 */
.engine-form .el-form-item:has(.el-textarea),
.engine-form .el-form-item:has(.engine-prompt-area) {
  align-items: flex-start;
}
.engine-form .el-form-item:has(.el-textarea) .el-form-item__label,
.engine-form .el-form-item:has(.engine-prompt-area) .el-form-item__label {
  padding-top: 4px !important;
  line-height: 22px !important;
  height: auto !important;
}
.engine-form .el-form-item__label {
  white-space: nowrap;
  height: auto !important;
  line-height: 32px !important;
  padding: 0 12px 0 0 !important;
  justify-content: flex-end;
  align-items: center;
  box-sizing: border-box;
}
/* 多语种长标签：放宽列宽后仍可能超长 → 允许换行，避免被裁切 */
.engine-form--label-wrap .el-form-item {
  align-items: flex-start;
}
.engine-form--label-wrap .el-form-item__label {
  /* EP 默认 display:inline-flex + flex-wrap:nowrap，长文本不会折行只会撑破/裁切 */
  display: inline-flex !important;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
  height: auto !important;
  white-space: normal;
  line-height: 1.3 !important;
  padding-top: 6px !important;
  word-break: break-word;
  overflow-wrap: break-word;
  text-align: right;
}
.engine-form--label-wrap .el-form-item__content {
  min-height: 32px;
  padding-top: 0;
}
.engine-form .el-form-item__content {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 32px;
  line-height: 32px;
}
.engine-form .el-input,
.engine-form .el-select,
.engine-form .el-input-number,
.engine-form .el-textarea,
.engine-form .engine-num {
  width: 100%;
  max-width: 100%;
}
.engine-form .el-input-number.engine-num .el-input__wrapper {
  width: 100%;
}
.engine-form .el-textarea .el-textarea__inner {
  line-height: 1.5;
}
.engine-form-hint {
  margin: 0 0 10px;
  padding: 0 4px 0 var(--engine-label-width, 140px);
  line-height: 1.45;
  box-sizing: border-box;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.engine-form-hint.is-inline {
  padding-left: 4px;
}
@media (max-width: 768px) {
  .engine-form-hint { padding-left: 4px; }
}
.el-form--label-top .el-form-item__label {
  padding: 0 0 4px;
  line-height: 1.2;
  color: var(--muted);
}

/* 开关行：标签与开关垂直居中 */
.engine-form .engine-form-switch.el-form-item {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
}
.engine-form .engine-form-switch .el-form-item__label {
  height: auto !important;
  line-height: 32px !important;
  padding-bottom: 0 !important;
  white-space: nowrap;
}
.engine-form .engine-form-switch .el-form-item__content {
  display: flex;
  align-items: center;
  min-height: 32px;
  line-height: 32px;
}
/* 必须写在开关默认样式之后，否则 nowrap/align-items:center 会盖掉换行 */
.engine-form--label-wrap .engine-form-switch.el-form-item {
  align-items: flex-start;
}
.engine-form--label-wrap .engine-form-switch .el-form-item__label {
  white-space: normal;
  line-height: 1.3 !important;
  padding-top: 6px !important;
  display: inline-flex !important;
  flex-wrap: wrap;
  min-width: 0;
}
.engine-form--label-wrap .engine-form-switch .el-form-item__content {
  padding-top: 4px;
}
.engine-form .engine-form-switch.is-placeholder {
  visibility: hidden;
  pointer-events: none;
}
.engine-form .engine-form-actions .el-form-item__content {
  margin-left: 0 !important;
  justify-content: flex-start;
}
.engine-map-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.engine-dlg-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
}
.docs-work-footer {
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.docs-dl-layout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

/* body class 兜底（不依赖 :has，兼容旧内核/缓存） */
body.ait-engine-dlg-open .el-overlay,
body.ait-engine-dlg-open .el-overlay-dialog {
  overflow: hidden !important;
}

@media (max-width: 960px) {
  html, body, #app { height: auto; overflow: auto; }
  .layout {
    display: block !important;
    height: auto !important;
    max-height: none;
    overflow: visible !important;
  }
  .sider {
    width: 100% !important;
    height: auto !important;
    overflow: visible;
  }
  .page {
    overflow: visible !important;
    height: auto !important;
  }
}

.ml8 { margin-left: 8px; }


.lbl-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 32px;
  height: 32px;
}
/* 引擎弹窗多语种换行：取消固定高度，否则泰文长标签仍被裁切 */
.engine-form--label-wrap .lbl-with-tip {
  height: auto;
  min-height: 20px;
  max-width: 100%;
  line-height: 1.3;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
}
.tip-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(47, 157, 138, 0.45);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  user-select: none;
  background: rgba(47, 157, 138, 0.08);
  flex-shrink: 0;
}
.tip-q:hover {
  background: rgba(47, 157, 138, 0.18);
}
.tip-pop {
  max-width: 320px;
  line-height: 1.55;
  font-size: 13px;
}
.engine-advanced {
  width: 100%;
  border: none;
}
.engine-advanced .el-collapse-item__header {
  font-size: 13px;
  color: var(--muted);
  height: 36px;
  line-height: 36px;
  border: none;
  background: transparent;
}
.engine-advanced .el-collapse-item__wrap {
  border: none;
}
.engine-advanced .el-collapse-item__content {
  padding-bottom: 4px;
}

.engine-prompt-area textarea {
  min-height: 160px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.5;
}
.runtime-log-tail {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 10px 12px;
  background: #0f1720;
  color: #d7e2ee;
  font-size: 12px;
  line-height: 1.45;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 弹窗放大 / 拖拽辅助：仅 body 滚动，避免与遮罩双滚动条 */
.el-dialog.ait-dlg-maximized,
.el-dialog.is-maximized {
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.el-dialog.ait-dlg-maximized .el-dialog__body,
.el-dialog.is-maximized .el-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.el-overlay-dialog:has(.el-dialog.is-maximized),
.el-overlay-dialog:has(.el-dialog.ait-dlg-maximized) {
  overflow: hidden;
}
/* 缓存工具栏「更多」 */
.ait-toolbar-more { margin-left: 4px; }

/* 术语库：库 Tab + 库操作与词条工具栏分层 */
.glossary-lib-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin-bottom: 12px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
}
.glossary-lib-tabs {
  flex: 1 1 280px;
  min-width: 0;
}
.glossary-lib-tabs .el-tabs__header {
  margin: 0;
}
.glossary-lib-tabs .el-tabs__nav-wrap::after {
  height: 1px;
  background-color: transparent;
}
.glossary-lib-tabs .el-tabs__item {
  color: var(--muted);
  font-weight: 500;
}
.glossary-lib-tabs .el-tabs__item.is-active {
  color: #1a3d36 !important;
  font-weight: 700;
}
.glossary-lib-tabs .el-tabs__active-bar {
  background-color: #2f9d8a !important;
  height: 3px !important;
  border-radius: 2px 2px 0 0;
}
.glossary-lib-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding-bottom: 6px;
}
.glossary-lib-actions .el-button--primary:not(.is-plain) {
  color: #fff !important;
  background-color: #2f9d8a !important;
  border-color: #2f9d8a !important;
  font-weight: 600;
}
.glossary-lib-actions .el-button--primary:not(.is-plain):hover,
.glossary-lib-actions .el-button--primary:not(.is-plain):focus {
  background-color: #278f7d !important;
  border-color: #278f7d !important;
}
.ait-caret { margin-left: 4px; font-size: 12px; opacity: .75; }

/* 文档翻译工作弹窗 */
.el-overlay:has(.el-dialog.docs-work-dlg),
.el-overlay-dialog:has(.el-dialog.docs-work-dlg) {
  overflow: hidden !important;
}
.el-dialog.docs-work-dlg {
  max-width: calc(100vw - 24px);
  height: calc(100vh - 4vh) !important;
  max-height: calc(100vh - 4vh) !important;
  margin: 2vh auto !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.el-dialog.docs-work-dlg:not(.is-maximized):not(.is-fullscreen):not(.vision-work-dlg) {
  width: min(1600px, calc(100vw - 32px)) !important;
}
.el-dialog.vision-work-dlg:not(.is-maximized):not(.is-fullscreen) {
  width: min(1400px, calc(100vw - 32px)) !important;
}
.el-dialog.docs-work-dlg.is-maximized,
.el-dialog.docs-work-dlg.is-fullscreen {
  width: 100% !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border-radius: 0;
  overflow: hidden !important;
}
.el-dialog.docs-work-dlg .el-dialog__header {
  flex: 0 0 auto;
  padding: 14px 18px 10px;
  margin-right: 0;
  padding-right: 14px !important;
}
.el-dialog.docs-work-dlg .el-dialog__body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px;
  padding-top: 6px;
}
.el-dialog.docs-work-dlg .el-dialog__footer {
  flex: 0 0 auto;
  padding: 10px 18px 16px;
}
.docs-work-toolbar,
.work-dlg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
/* 文档/图片/语音工作弹窗：统一分行工具栏 */
.work-dlg-toolbar {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
}
.work-dlg-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.work-dlg-toolbar-main {
  justify-content: space-between;
}
.work-dlg-toolbar-filters {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.work-dlg-file-picker {
  flex: 1 1 280px;
  min-width: 0;
}
.work-lang-select {
  width: 210px !important;
}
.work-lang-arrow {
  color: var(--muted, #64748b);
  font-size: 14px;
  user-select: none;
  flex: 0 0 auto;
}
.work-ocr-select,
.work-asr-backend-select {
  width: 160px !important;
}
.work-docs-glossary-select {
  width: 260px !important;
}
.work-docs-glossary-ids {
  width: 180px !important;
}
.work-docs-email {
  width: 220px !important;
}
.work-dlg-select-empty {
  padding: 12px 14px;
  color: var(--muted, #64748b);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.docs-work-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.docs-work-meta {
  color: var(--muted, #64748b);
  font-size: 13px;
}
.docs-work-viewbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.docs-work-viewbar-label {
  font-size: 13px;
  color: var(--muted, #64748b);
}
.docs-work-format-note {
  margin: 0;
  flex: 1 1 180px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docs-work-preview {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #f8fafb;
  padding: 0;
  overscroll-behavior: contain;
}
.docs-work-empty {
  color: var(--muted, #64748b);
  font-size: 13px;
  line-height: 1.6;
  padding: 28px 14px;
  text-align: center;
}
.vision-preview-tabs {
  padding: 10px 12px 0;
}
.vision-file-picker {
  flex: 1 1 280px;
  min-width: 0;
}
.vision-lang-arrow {
  color: var(--muted, #64748b);
  font-size: 14px;
  user-select: none;
}
.vision-work-status {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.docs-work-meta-filename {
  max-width: min(42vw, 360px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vision-work-progress {
  flex: 1 1 160px;
  min-width: 120px;
  max-width: 320px;
}
.vision-work-error {
  flex: 1 1 100%;
  color: #e11d48;
}
.vision-preview-error {
  margin-left: 8px;
  color: #e11d48;
}
.vision-work-preview {
  min-height: min(62vh, 560px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.vision-side-sync {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 14px;
  flex: 1 1 auto;
  min-height: min(58vh, 540px);
  height: 100%;
  padding: 12px;
  box-sizing: border-box;
  align-items: stretch;
}
.vision-side-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.vision-side-col-result {
  background: linear-gradient(180deg, #f8fcfd 0%, #fff 100%);
}
.vision-side-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 251, 0.95);
}
.vision-preview-tools,
.vision-img-viewer-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.vision-preview-tool-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.vision-preview-tool-btn:hover {
  border-color: #0891b2;
  color: #0e7490;
}
.vision-preview-tool-btn.is-primary {
  background: #0891b2;
  border-color: #0891b2;
  color: #fff;
}
.vision-preview-tool-scale {
  min-width: 44px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
}
.vision-preview-zoom-tip {
  margin-left: auto;
  font-size: 12px;
  color: #94a3b8;
}
.vision-side-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  position: relative;
  display: block;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.vision-side-scroll.is-uploadable {
  padding: 0;
  overflow: hidden;
}
.vision-side-scroll.is-drop-target {
  outline: 2px dashed #0891b2;
  outline-offset: -6px;
  background: rgba(8, 145, 178, 0.06);
}
.vision-source-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 220px;
  margin: 0;
  padding: 24px 16px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: #475569;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.vision-source-dropzone:hover,
.vision-side-scroll.is-drop-target .vision-source-dropzone {
  background: linear-gradient(180deg, #ecfeff 0%, #e0f2fe 100%);
  color: #0e7490;
}
.vision-source-dropzone-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.vision-source-dropzone-hint {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}
.vision-source-drop-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 145, 178, 0.55);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  pointer-events: none;
  z-index: 2;
}
.vision-result-pane {
  position: relative;
}
.vision-preview-stage {
  width: 100%;
  margin: 0 auto;
  line-height: 0;
  position: relative;
}
.vision-preview-img-wrap {
  padding: 8px 12px 14px;
  text-align: center;
  max-height: min(62vh, 520px);
  overflow: auto;
}
.vision-preview-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  object-position: top center;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}
.vision-preview-img-zoomable {
  cursor: zoom-in;
}
.vision-preview-img-zoomable:hover {
  box-shadow: 0 2px 10px rgba(8, 145, 178, 0.22);
}
.vision-img-viewer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
}
.vision-img-viewer-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.vision-img-viewer-title {
  font-size: 14px;
  font-weight: 600;
}
.vision-img-viewer-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}
.vision-img-viewer-stage:active {
  cursor: grabbing;
}
.vision-img-viewer-img {
  max-width: 92vw;
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  user-select: none;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform;
}
.vision-img-viewer-hint {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 18px 14px;
  text-align: center;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.75);
}
.vision-preview-img-ghost {
  opacity: 0.35;
  filter: saturate(0.85) blur(0.2px);
}
.vision-result-pane.is-translating .vision-preview-stage {
  position: relative;
  z-index: 0;
}
.vision-scan-overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  bottom: 12px;
  pointer-events: none;
  overflow: hidden;
  border-radius: 6px;
  z-index: 1;
}
.vision-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #0891b2 20%, #22d3ee 50%, #0891b2 80%, transparent);
  box-shadow: 0 0 12px rgba(8, 145, 178, 0.55);
  animation: vision-scan-move 2.2s ease-in-out infinite;
}
.vision-scan-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 145, 178, 0.06), transparent 35%, transparent 65%, rgba(8, 145, 178, 0.05));
  animation: vision-scan-pulse 2.2s ease-in-out infinite;
}
@keyframes vision-scan-move {
  0% { top: 6%; opacity: 0.35; }
  50% { opacity: 1; }
  100% { top: 94%; opacity: 0.35; }
}
@keyframes vision-scan-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}
.vision-translating-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0e7490;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(8, 145, 178, 0.15);
  z-index: 2;
}
.vision-translating-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0891b2;
  animation: vision-dot-pulse 1s ease-in-out infinite;
}
@keyframes vision-dot-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.55; }
  50% { transform: scale(1.15); opacity: 1; }
}
.vision-text-preview {
  padding: 12px 14px 16px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.vision-text-block {
  max-height: min(32vh, 280px);
  margin-bottom: 14px;
}
@media (max-width: 900px) {
  .vision-side-sync {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
}
.docs-side-wrap {
  min-width: 0;
}
.docs-side-heads {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 14px 8px;
  background: #f8fafb;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 0 #f8fafb;
}
.docs-side-head {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #eef2f6;
  border-radius: 6px;
  padding: 6px 10px;
}
.docs-side-rows {
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.docs-side-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}
.docs-side-row .docs-seg {
  margin-bottom: 0;
  height: 100%;
  box-sizing: border-box;
}
.docs-seg {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  font-size: 13px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.docs-seg-src { color: #475569; }
.docs-seg-dst { color: #0f172a; }
.docs-stack-list {
  padding: 12px 14px;
}
.docs-stack-item {
  margin-bottom: 12px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.08);
}
.docs-stack-item .docs-seg { margin-bottom: 6px; }
.docs-seg-tag {
  display: inline-block;
  min-width: 22px;
  margin-right: 8px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  background: #e2e8f0;
  color: #475569;
  vertical-align: top;
}
.docs-seg-tag.is-dst {
  background: rgba(47, 157, 138, 0.16);
  color: #1a6b5c;
}
.docs-only-list {
  padding: 12px 14px;
}
.docs-only-list .docs-seg {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 0;
  padding-left: 2px;
  padding-right: 2px;
}
@media (max-width: 900px) {
  .docs-side-heads,
  .docs-side-row,
  .docs-side-paired .docs-side-row { grid-template-columns: 1fr; }
}

/* 文档译 / 术语导入 统一文件选择 */
.ait-file-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}
.ait-file-picker {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.ait-file-name {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted, #64748b);
  font-size: 13px;
  line-height: 32px;
}

/* 权限点穿梭 */
.ait-perm-picker {
  display: flex;
  gap: 12px;
  min-height: 360px;
  align-items: stretch;
}
.ait-perm-picker-left,
.ait-perm-picker-right {
  flex: 1;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 10px;
  overflow: auto;
  max-height: 420px;
}
.ait-perm-picker-mid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
}
.ait-perm-picker-title {
  font-weight: 600;
  margin-bottom: 8px;
}
.ait-perm-picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px dashed #eee;
}

/* ---- density compact ---- */
html.density-compact .side-menu .el-menu-item {
  height: 32px !important;
  line-height: 32px !important;
  font-size: 12px !important;
}
html.density-compact .page {
  padding: 12px 14px 24px !important;
}
html.density-compact .topbar {
  padding: 0 14px !important;
}
html.density-compact .el-table .cell {
  padding-top: 4px;
  padding-bottom: 4px;
}

.col-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

/* ---- docs side-by-side：成对行 + 单滚动条（对齐，无双栏比例同步抖动） ---- */
.docs-side-sync {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  box-sizing: border-box;
}
.docs-side-paired {
  min-height: 0;
}
.docs-side-paired .docs-side-heads {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 8px 10px 6px;
  background: #f8fafb;
}
.docs-side-paired .docs-side-head {
  margin-bottom: 0;
}
.docs-side-scroll-paired {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 10px 12px;
  border: 0;
  background: transparent;
}
.docs-side-paired .docs-side-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 8px;
}
.docs-side-paired .docs-sync-seg {
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 2.8em;
  margin-bottom: 0;
  box-sizing: border-box;
  /* 靠 grid stretch 等高；勿用 height:100%+margin，否则会撑破行高导致左右对不齐 */
}
.docs-side-paired .docs-seg-dst {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.docs-seg-body {
  flex: 1 1 auto;
  min-width: 0;
}
.docs-seg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 0 0 auto;
  align-items: center;
}
.docs-seg-action-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #2f9d8a;
  background: #fff;
  color: #146857;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.docs-seg-action-btn:hover,
.docs-seg-action-btn:focus {
  background: rgba(47, 157, 138, 0.12);
  outline: none;
}
.docs-seg-action-btn.is-retry {
  border-color: #94a3b8;
  color: #334155;
}
.docs-seg-action-btn.is-retry:hover,
.docs-seg-action-btn.is-retry:focus {
  background: #f1f5f9;
}
.docs-stack-item .docs-seg-actions {
  margin-top: 6px;
  margin-left: 30px;
}
.docs-side-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.docs-side-sync .docs-side-head {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #eef2f6;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
}
.docs-side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
}
.docs-sync-seg {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 2.8em;
}
.ait-perm-tags { margin-bottom: 8px; }

.help-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.help-setup-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
}
.help-setup-card .el-card__body {
  padding: 14px 16px;
}
.help-setup-card-hd {
  display: flex;
  align-items: center;
  gap: 8px;
}
.help-setup-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2f9d8a;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.help-setup-card .op-btns .el-button--primary,
.help-usage-tabs .op-btns .el-button--primary {
  color: #fff !important;
  background-color: #2f9d8a !important;
  border-color: #2f9d8a !important;
  font-weight: 600 !important;
}
.help-setup-card .op-btns .el-button--primary:hover,
.help-setup-card .op-btns .el-button--primary:focus,
.help-usage-tabs .op-btns .el-button--primary:hover,
.help-usage-tabs .op-btns .el-button--primary:focus {
  color: #fff !important;
  background-color: #278f7d !important;
  border-color: #278f7d !important;
}
.help-usage-list {
  margin: 0 0 14px;
  padding-left: 1.25rem;
  line-height: 1.65;
  color: #334155;
}
.help-usage-list li + li {
  margin-top: 6px;
}

