﻿  :root {
    --lf-sticky-header-height: 56px;
    --lf-sticky-nav-height: 52px;
    --primary: #409EFF;
    --primary-light: #ecf5ff;
    --primary-dark: #337ecc;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #303133;
    --text-secondary: #909399;
    --border: #e4e7ed;
    --bg-secondary: #f0f2f5;
  }

  [data-theme="dark"] {
    --primary: #60a5fa;
    --primary-light: #1e3a5f;
    --primary-dark: #3b82f6;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --border: #334155;
    --bg-secondary: #1a2438;
  }

  /* Hide Vue template syntax until app is mounted to prevent i18n key flashes */
  [v-cloak] { visibility: hidden !important; }
  #app[v-cloak] + #app-loading-fallback {
    display: flex;
  }
  #app-loading-fallback {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    color: #909399;
    font-size: 14px;
    z-index: 9999;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
  }

  /* ========== Auth Pages ========== */
  .auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a56db 0%, #3b82f6 40%, #60a5fa 100%);
  }
  .auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
    padding: 40px 36px;
    width: 400px;
    max-width: 92vw;
  }
  .auth-card .auth-logo {
    text-align: center;
    margin-bottom: 32px;
  }
  .auth-card .auth-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a56db;
    letter-spacing: 0.5px;
  }
  .auth-card .auth-logo p {
    font-size: 14px;
    color: #909399;
    margin-top: 4px;
  }
  .auth-card .el-input { margin-bottom: 16px; }
  .auth-card .auth-btn { margin-bottom: 12px;
    width: 100%;
    margin-top: 8px;
    height: 42px;
    font-size: 15px;
  }
  .auth-card .auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #909399;
  }
  .auth-card .auth-switch a {
    color: #409EFF;
    cursor: pointer;
    text-decoration: none;
    margin-left: 4px;
  }
  .auth-card .auth-switch a:hover { text-decoration: underline; }
  .auth-card .auth-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: #409EFF;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
  }
  .auth-card .auth-link:hover { text-decoration: underline; }
  .auth-card .auth-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 2px;
  }
  .auth-card .auth-recovery-link { font-size: 12px; }

  /* ========== App Header ========== */
  .app-header {
    background: linear-gradient(135deg, #1a56db 0%, #3b82f6 50%, #60a5fa 100%);
    color: #fff;
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .app-header .logo {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
  }
  .app-header .logo svg { width: 28px; height: 28px; }

  .provider-runtime-notice {
    margin: 12px auto 0;
    width: min(1200px, calc(100% - 32px));
    padding: 10px 14px;
    border: 1px solid #f3c97a;
    border-radius: 6px;
    background: #fff8e6;
    color: #8a5a00;
    font-size: 13px;
  }
  [data-theme="dark"] .provider-runtime-notice {
    border-color: #805f22;
    background: #332a18;
    color: #f4cf7b;
  }

  /* User info area */
  .header-user {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .header-user .user-name {
    font-size: 14px;
    font-weight: 500;
  }
  .header-profile-btn {
    border: 0;
    padding: 6px 8px;
    color: inherit;
    background: transparent;
    font: inherit;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
  }
  .header-profile-btn:hover { text-decoration: underline; }
  .header-profile-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
  .header-user .plan-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .plan-badge.FREE { background: rgba(255,255,255,0.2); color: #fff; }
  .plan-badge.BASIC { background: rgba(255,255,255,0.25); color: #fff; border: 1px solid rgba(255,255,255,0.4); }
  .plan-badge.PRO { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1a1a2e; }

  .quota-mini {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }
  .quota-mini .quota-text {
    font-size: 11px;
    color: rgba(255,255,255,0.85);
  }
  .quota-summary {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.4;
  }
  .quota-mini .quota-summary {
    color: rgba(255,255,255,0.72);
    font-size: 10px;
    white-space: nowrap;
  }
  .quota-mini .quota-bar-wrap {
    width: 100px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
  }
  .quota-mini .quota-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
  }
  .quota-bar-fill.safe { background: #67c23a; }
  .quota-bar-fill.warn { background: #e6a23c; }
  .quota-bar-fill.danger { background: #f56c6c; }

  .header-upgrade-btn {
    border: 1px solid rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.14);
    color: #fff;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
  }
  .header-upgrade-btn:hover {
    background: rgba(255,255,255,0.24);
  }

  .header-logout {
    border: 0;
    background: transparent;
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
  }
  .header-logout:hover { color: #fff; background: rgba(255,255,255,0.15); }
  .header-logout:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

  .upgrade-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    padding: 24px;
  }
  .upgrade-dialog {
    width: 420px;
    max-width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
    padding: 22px;
  }
  .upgrade-dialog-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
  }
  .upgrade-dialog-subtitle {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
  }
  .upgrade-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 18px 0;
  }
  .upgrade-option {
    min-height: 86px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    color: var(--text);
  }
  .upgrade-option strong {
    font-size: 16px;
  }
  .upgrade-option span {
    font-size: 12px;
    color: var(--text-secondary);
  }
  .upgrade-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
  }
  .upgrade-option.pro strong {
    color: #b7791f;
  }
  .upgrade-option:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }

  .language-switcher {
    position: fixed;
    top: 12px;
    right: 24px;
    z-index: 220;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.16);
    color: #fff;
    font-size: 12px;
    backdrop-filter: blur(8px);
  }
  .language-switcher select {
    height: 28px;
    min-width: 104px;
    border: 1px solid rgba(255,255,255,0.36);
    border-radius: 6px;
    background: rgba(255,255,255,0.95);
    color: var(--text);
    padding: 0 8px;
    font-size: 12px;
    outline: none;
  }
  .header-user {
    padding-right: 176px;
  }
  @media (max-width: 760px) {
    .language-switcher {
      right: 10px;
      top: 10px;
    }
    .header-user {
      padding-right: 138px;
      gap: 8px;
    }
    .quota-mini {
      display: none;
    }
  }

  /* ========== Tabs ========== */
  .tab-btn {
    padding: 14px 28px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
  }
  .tab-btn:hover { color: var(--primary); }
  .tab-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }
  .tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
  .app-tab-strip {
    position: sticky;
    top: var(--lf-sticky-header-height);
    z-index: 90;
  }

  .main-container { max-width: 1280px; margin: 0 auto; padding: 28px 24px 48px; }

  .wf-template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 6px; }
  .wf-template-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; transition: all .15s ease; font: inherit; color: #303133; }
  .wf-template-card:hover { border-color: #409EFF; box-shadow: 0 2px 8px rgba(64,158,255,.12); }
  .wf-template-card.active { border-color: #409EFF; background: linear-gradient(180deg, #eaf3ff, #d7eaff); box-shadow: inset 0 0 0 1px #409EFF, 0 4px 14px rgba(64,158,255,.26); }
  .wf-check { position: absolute; top: -1px; right: -1px; display: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 0 10px 0 10px; background: #409EFF; color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
  .wf-template-card.active .wf-check { display: block; }
  .wf-ico { font-size: 18px; line-height: 1; }
  .wf-title { font-weight: 600; font-size: 13px; }
  .wf-template-card.active .wf-title { color: #1d5fae; }
  .wf-desc { font-size: 11px; color: #909399; line-height: 1.4; }
  .wf-template-card.active .wf-desc { color: #5a8fce; }
  .wf-meta { font-size: 11px; line-height: 1.6; color: #606266; background: #f4f6f8; border-radius: 999px; padding: 0 8px; }
  .wf-template-card.active .wf-meta { color: #1d5fae; background: #fff; }
  .wf-run-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 2px 0 12px; font-size: 12px; color: #606266; }
  .wf-run-label { font-weight: 600; color: #303133; }
  .wf-run-chip { border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; background: #fafcff; color: #5a6b82; }
  .wf-run-chain { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-left: auto; }
  .wf-stage { font-size: 11px; color: #909399; }
  .wf-stage + .wf-stage::before { content: '→'; margin-right: 5px; color: #c0c4cc; }
  .wf-stage.is-mode { color: #1d5fae; font-weight: 600; }
  .comment-dialog-input { flex: 1; width: 100%; min-height: 84px; resize: vertical; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; }

  /* 批注弹窗：覆盖全局 .native-btn{width:100%}，让"添加批注"按钮只取内容宽度，
     从而把整行空间让给 textarea（flex:1），解决按钮撑满、输入框被挤成细条的问题 */
  .comment-input-row { display: flex; gap: 10px; align-items: stretch; margin-top: 12px; }
  .comment-add-btn { width: auto !important; flex: 0 0 auto; white-space: nowrap; padding: 10px 22px !important; font-size: 14px !important; align-self: stretch; }
  .comment-resolve-btn { width: auto !important; flex: 0 0 auto; padding: 2px 10px !important; font-size: 11px !important; }
  .comment-seg-preview { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-size: 12px; }
  .comment-seg-preview .cs-label { color: #8b949e; margin-bottom: 4px; }
  .comment-seg-preview .cs-text { color: var(--text); white-space: pre-wrap; line-height: 1.5; max-height: 84px; overflow: auto; }
  .comment-item.comment-new { animation: commentPop 0.6s ease; box-shadow: 0 0 0 2px #409EFF inset; }
  @keyframes commentPop { 0% { transform: scale(0.96); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }

  /* ========== 视图模式切换（表格 / 专注审校） ========== */
  .view-mode-switch {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
  }
  .view-mode-switch .view-mode-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
  }
  .view-mode-switch .view-mode-btn + .view-mode-btn { border-left: 1px solid var(--border); }
  .view-mode-switch .view-mode-btn:hover { background: #f4f6f9; }
  .view-mode-switch .view-mode-btn.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
  }

  /* ========== 专注审校面板 ========== */
  .focus-review {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 18px;
    background: #fff;
  }
  .focus-review-head {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
  }
  .focus-review-position { display: flex; align-items: baseline; gap: 8px; }
  .focus-review-position .focus-seg-index {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
  }
  .focus-review-position .focus-seg-total { color: var(--text-secondary); font-size: 14px; }
  .focus-review-position .focus-progress-text {
    margin-left: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg);
    border-radius: 12px;
    padding: 3px 10px;
  }
  .focus-block { margin-bottom: 14px; }
  .focus-block-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
  }
  .focus-source {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: 8px;
    padding: 12px 14px;
  }
  .focus-context { margin-bottom: 14px; opacity: 0.75; }
  .focus-context-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
  .focus-context-text {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    border-left: 2px solid var(--border);
    padding-left: 10px;
  }
  .focus-target {
    width: 100%;
    min-height: 140px;
    font-size: 16px;
    line-height: 1.8;
    font-family: inherit;
    color: var(--text);
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcfd;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .focus-target:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(64,158,255,0.2);
    background: #fff;
  }
  .focus-hints { margin-bottom: 14px; }
  .focus-hint {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.6;
    padding: 6px 10px;
    border-radius: 6px;
    background: #fffbeb;
    margin-bottom: 6px;
  }
  .focus-hint .focus-hint-severity {
    flex: none;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 8px;
    background: #fde68a;
    color: #92400e;
  }
  .focus-hint .focus-hint-severity.error { background: #fecaca; color: #991b1b; }
  .focus-hint .focus-hint-severity.unknown { background: #e5e7eb; color: #374151; }
  .focus-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .focus-shortcut-hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
  }
  .auto-repair-action {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--primary);
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    cursor: pointer;
    flex: none;
  }
  .auto-repair-action:hover { background: var(--primary-light); }

  /* ========== 上传卡片折叠态（有任务结果时） ========== */
  .upload-collapsed-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafbfc;
    font-size: 13px;
    color: var(--text-secondary);
  }
  .upload-collapsed-bar .upload-collapsed-file {
    color: var(--text);
    font-weight: 600;
  }
  .upload-collapsed-bar .upload-collapsed-lang {
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
  }

  /* ========== Sticky Action Toolbar ========== */
  .result-actions-sticky {
    position: sticky;
    top: calc(var(--lf-sticky-header-height) + var(--lf-sticky-nav-height));
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    box-sizing: border-box;
    padding: 14px 18px;
    margin: -8px -18px 20px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  }
  .toolbar-status-group,
  .toolbar-summary-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    min-width: 0;
  }
  .toolbar-status-group { justify-content: space-between; }
  .toolbar-summary-group { justify-content: flex-end; }
  .qa-summary-compact { display: none; }
  .toolbar-action-groups {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr) auto;
    align-items: center;
    gap: 8px 12px;
    min-width: 0;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .toolbar-action-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
  }
  .toolbar-action-group + .toolbar-action-group {
    padding-left: 12px;
    border-left: 1px solid var(--border);
  }
  .toolbar-action-group .el-select { max-width: 100%; }
  @media (max-width: 1100px) {
    .toolbar-action-groups { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .toolbar-action-group:nth-child(3) { grid-column: 1 / -1; }
    .toolbar-action-group:nth-child(4) { grid-column: 2; justify-content: flex-end; }
    .toolbar-action-group:nth-child(3) { border-left: 0; padding-left: 0; }
  }
  @media (max-width: 640px) {
    .result-actions-sticky { padding: 8px 10px; margin: -4px -12px 16px; gap: 6px; }
    .toolbar-status-group,
    .toolbar-summary-group {
      justify-content: flex-start;
      flex-wrap: nowrap;
      overflow-x: auto;
      overflow-y: hidden;
      white-space: nowrap;
      scrollbar-width: thin;
      -webkit-overflow-scrolling: touch;
    }
    .qa-summary-full { display: none; }
    .toolbar-summary-group .qa-summary-compact {
      display: inline-flex;
      flex: 0 1 auto;
      min-width: 0;
      padding: 4px 8px;
      font-size: 12px;
      line-height: 1.25;
      white-space: nowrap;
    }
    .toolbar-action-groups {
      display: flex;
      flex-wrap: nowrap;
      gap: 6px;
      overflow-x: auto;
      overflow-y: hidden;
      padding: 6px 0 4px;
      scrollbar-width: auto;
      scrollbar-color: var(--primary) var(--bg-secondary);
      -webkit-overflow-scrolling: touch;
      scroll-snap-type: x proximity;
    }
    .toolbar-action-groups::-webkit-scrollbar { height: 8px; }
    .toolbar-action-groups::-webkit-scrollbar-track { background: var(--bg-secondary); border-radius: 999px; }
    .toolbar-action-groups::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 999px; }
    .toolbar-action-groups:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
    .toolbar-action-group,
    .toolbar-action-group:nth-child(3),
    .toolbar-action-group:nth-child(4) {
      flex: 0 0 auto;
      justify-content: flex-start;
      flex-wrap: nowrap;
      gap: 6px;
      padding: 0 6px 0 0;
      border-left: 0;
      border-top: 0;
      scroll-snap-align: start;
    }
    .toolbar-action-group .el-button,
    .toolbar-action-group .el-dropdown,
    .toolbar-action-group .el-select,
    .toolbar-action-group .el-select .el-input,
    .toolbar-action-group .el-select .el-input__wrapper,
    .toolbar-action-group .select-all-label,
    .toolbar-status-group .view-mode-btn {
      min-height: 40px;
    }
    .toolbar-action-group .el-button,
    .toolbar-action-group .el-dropdown .el-button { padding-top: 0; padding-bottom: 0; }
    .toolbar-action-group .el-select .el-input,
    .toolbar-action-group .el-select .el-input__wrapper { height: 40px; }
    .toolbar-action-group .select-all-label { display: inline-flex; align-items: center; white-space: nowrap; }
    .toolbar-summary-group { gap: 6px; }
    .result-actions-sticky .seg-progress { flex: 0 0 auto; padding: 5px 10px; }
  }
  .result-actions-sticky .seg-progress {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--bg);
    border-radius: 16px;
  }
  .result-actions-sticky .seg-progress strong { color: var(--primary); font-weight: 600; }
  .result-actions-sticky .divider {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 4px;
  }

  /* ========== Result Layout (table + minimap) ========== */
  .result-layout {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 20px;
    align-items: start;
  }
  .result-layout.with-minimap-hidden {
    grid-template-columns: 1fr 0;
  }
  .result-layout .table-area { min-width: 0; }
  .result-layout .minimap-area {
    position: sticky;
    top: 84px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 12px;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
  }
  .minimap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
  }
  .minimap-header .toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
  }
  .minimap-header .toggle-btn:hover { color: var(--primary); }
  .minimap-list {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 4px;
  }
  .minimap-cell {
    aspect-ratio: 1;
    min-height: 22px;
    border-radius: 4px;
    font-size: 10px;
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
    background: #c0c4cc;
    border: none;
    padding: 0;
  }
  .minimap-cell:hover { transform: scale(1.15); box-shadow: 0 0 0 2px var(--primary); z-index: 2; }
  .minimap-cell.active { box-shadow: 0 0 0 2px var(--primary); transform: scale(1.05); }
  .minimap-cell.status-done { background: #67c23a; }
  .minimap-cell.status-approved { background: #16a34a; }
  .minimap-cell.status-edited { background: #409EFF; }
  .minimap-cell.status-tm { background: #909399; }
  .minimap-cell.status-tm-fuzzy { background: #b8826e; }
  .minimap-cell.status-qa-error { background: #f56c6c; }
  .minimap-cell.status-qa-warn { background: #e6a23c; }
  .minimap-cell.status-failed { background: #dc2626; }

  .minimap-legend {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    font-size: 11px;
    color: var(--text-secondary);
  }
  .minimap-legend .legend-row {
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .minimap-legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
  }

  /* ========== Segment Filter Bar ========== */
  .seg-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0 14px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 10px;
  }
  .seg-filter-bar .filter-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-right: 4px;
  }
  .seg-filter-bar .filter-pill {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 18px;
    padding: 5px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .seg-filter-bar .filter-pill:hover { border-color: var(--primary); color: var(--primary); }
  .seg-filter-bar .filter-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 500;
  }
  .seg-filter-bar .filter-pill .count {
    margin-left: 4px;
    font-size: 11px;
    opacity: 0.85;
  }

  /* ========== Virtual Scroll Container ========== */
  .vscroll-container {
    position: relative;
    max-height: calc(100vh - 240px);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
  }
  .vscroll-spacer { width: 100%; }
  .vscroll-viewport { position: relative; width: 100%; }
  .vscroll-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
  }
  .vscroll-empty .emoji { font-size: 48px; opacity: 0.4; display: block; margin-bottom: 8px; }

  /* ========== Result Layout (Mobile) ========== */
  @media (max-width: 960px) {
    .result-layout { grid-template-columns: 1fr; }
    .result-layout .minimap-area { position: static; max-height: none; }
    .minimap-list { grid-template-columns: repeat(8, 1fr); }
  }

  .card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
    padding: 28px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s;
  }
  .card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.06); }
  .card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .card-title::before {
    content: '';
    display: inline-block;
    width: 4px; height: 18px;
    background: var(--primary);
    border-radius: 2px;
  }

  .production-line-console-card {
    border: 1px solid rgba(64, 158, 255, 0.18);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  }
  .production-line-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 4px 0 14px;
  }
  .production-line-summary-card {
    min-height: 96px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
  }
  .production-line-summary-card.tone-active { border-color: #93c5fd; background: #eff6ff; }
  .production-line-summary-card.tone-ready { border-color: #86efac; background: #f0fdf4; }
  .production-line-summary-card.tone-review { border-color: #fcd34d; background: #fffbeb; }
  .production-line-summary-card.tone-idle { border-color: #e5e7eb; background: #f9fafb; }
  .production-line-summary-card.tone-attention { border-color: #fca5a5; background: #fef2f2; }
  .production-line-summary-card .summary-label {
    color: var(--text-secondary);
    font-size: 12px;
  }
  .production-line-summary-card .summary-value {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
  }
  .production-line-summary-card .summary-note {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
  }
  .pipeline-overall-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid;
  }
  .pipeline-overall-badge.tone-active { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
  .pipeline-overall-badge.tone-ready { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
  .pipeline-overall-badge.tone-attention { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
  .pipeline-overall-badge.tone-idle { color: #6b7280; background: #f3f4f6; border-color: #e5e7eb; }

  .pipeline-stage-grid {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .pipeline-stage-wrapper {
    flex: 1 1 0;
    min-width: 110px;
    display: flex;
    align-items: stretch;
    position: relative;
  }
  .pipeline-stage-wrapper.has-connector::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 16px;
    height: 2px;
    background: #e5e7eb;
    transform: translateY(-50%);
    z-index: 0;
  }
  .pipeline-stage-card {
    flex: 1;
    min-height: 92px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    margin-right: 16px;
    position: relative;
    z-index: 1;
    transition: all 0.2s ease;
  }
  .pipeline-stage-card.tone-success { border-color: #bbf7d0; background: #f0fdf4; }
  .pipeline-stage-card.tone-active { border-color: #3b82f6; background: #eff6ff; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12); }
  .pipeline-stage-card.tone-attention { border-color: #fca5a5; background: #fef2f2; }
  .pipeline-stage-card.tone-pending { border-color: #e5e7eb; background: #f9fafb; }
  .pipeline-stage-card.active { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12); }
  .pipeline-stage-card.complete { border-color: #bbf7d0; }
  .pipeline-stage-card.attention { border-color: #fca5a5; }
  .pipeline-stage-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    margin-bottom: 6px;
  }
  .tone-success .pipeline-stage-icon { background: #dcfce7; color: #166534; }
  .tone-active .pipeline-stage-icon { background: #dbeafe; color: #1d4ed8; }
  .tone-attention .pipeline-stage-icon { background: #fee2e2; color: #b91c1c; }
  .tone-pending .pipeline-stage-icon { background: #f3f4f6; color: #9ca3af; }
  .pipeline-stage-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
  }
  .pipeline-stage-status {
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
  }
  @keyframes segment-flash {
    0% { background-color: rgba(59, 130, 246, 0.35); }
    60% { background-color: rgba(59, 130, 246, 0.12); }
    100% { background-color: transparent; }
  }
  .segment-flash {
    animation: segment-flash 1.4s ease-out;
  }
  .pipeline-stage-message {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
  }
  @media (max-width: 768px) {
    .pipeline-stage-grid { gap: 8px; flex-wrap: wrap; }
    .pipeline-stage-wrapper { flex: 1 1 calc(50% - 8px); min-width: auto; }
    .pipeline-stage-wrapper.has-connector::after { display: none; }
    .pipeline-stage-card { margin-right: 0; }
  }
  .pipeline-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }
  .pipeline-next-action {
    flex: 1;
    min-width: 240px;
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.6;
  }
  .pipeline-next-action.attention {
    border-color: #fecaca;
    border-left-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
  }
  .pipeline-action-button {
    width: auto;
    padding: 8px 14px;
  }

  .term-help {
    margin: 12px 0 16px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
    clear: both;
  }
  .term-task-source-notice {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--lf-text-2);
    font-size: 13px;
    line-height: 1.6;
  }
  .term-task-source-notice .native-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 4px 9px;
    font-size: 12px;
  }
  .term-action-bar {
    display: flex;
    gap: 12px;
    padding-top: 4px;
    padding-bottom: 8px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
  }
  .term-action-bar .el-button {
    flex-shrink: 0;
  }
  .term-stepper {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 4px;
  }
  .term-step {
    flex: 1 1 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    min-width: 0;
  }
  .term-step-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(64, 158, 255, 0.3);
  }
  .term-step-body { min-width: 0; }
  .term-step-title {
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 4px;
  }
  .term-step-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
  }
  .term-step-arrow {
    display: flex;
    align-items: center;
    color: #c0c4cc;
    font-size: 20px;
    padding: 0 6px;
    flex-shrink: 0;
  }
  .extracted-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }
  @media (max-width: 768px) {
    .term-stepper { flex-wrap: wrap; }
    .term-step { flex: 1 1 100%; }
    .term-step-arrow { display: none; }
  }
  .term-import-hint {
    margin: -4px 0 8px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
  }
  .term-import-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 10px;
    margin-bottom: 16px;
    align-items: start;
  }
  .native-btn.secondary {
    background: #fff;
    color: var(--primary);
    border: 1px solid #bfdbfe;
  }
  .native-btn.secondary:hover { background: #eff6ff; }
  .native-btn.attention {
    background: #dc2626;
    color: #fff;
    border: 1px solid #dc2626;
    font-weight: 600;
  }
  .native-btn.attention:hover { background: #b91c1c; border-color: #b91c1c; }
  .term-file-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: auto;
    padding: 10px 20px;
  }
  .term-file-button input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
  }

  /* TM import card — clear, prominent import panel that stands out from the toolbar */
  .tm-import-card {
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: linear-gradient(180deg, #f5f9ff 0%, #ffffff 100%);
    padding: 16px 18px 18px;
    margin-top: 16px;
    box-shadow: 0 1px 2px rgba(30, 64, 124, 0.05);
  }
  .tm-import-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }
  .tm-import-card__title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
  }
  .tm-import-card__icon {
    font-size: 20px;
    line-height: 1.25;
    flex: 0 0 auto;
  }
  .tm-import-card__title-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
  }
  .tm-import-card__title-sub {
    margin-top: 5px;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 680px;
  }
  .tm-import-link {
    flex: 0 0 auto;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 6px;
    white-space: nowrap;
  }
  .tm-import-link:hover { text-decoration: underline; }
  .tm-import-textarea {
    width: 100%;
    min-height: 104px;
    margin-bottom: 12px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
  }
  .tm-import-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
  }
  .tm-import-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .tm-import-label {
    font-size: 12px;
    color: var(--text-secondary);
  }
  .tm-import-field .native-input { width: 168px; }
  .tm-import-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-left: auto;
  }
  .tm-file-name {
    margin-left: 6px;
    font-size: 12px;
    opacity: 0.85;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tm-import-result {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-size: 13px;
    line-height: 1.5;
  }
  .tm-import-result__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
  }
  @media (max-width: 768px) {
    .tm-import-actions { margin-left: 0; width: 100%; }
    .tm-import-field { flex: 1 1 140px; }
    .tm-import-field .native-input { width: 100%; }
  }

  .demo-onboarding {
    margin: 28px auto 0;
    max-width: 860px;
    text-align: left;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fbff;
    padding: 18px;
  }
  .demo-onboarding-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
  }
  .demo-onboarding-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
  }
  .demo-onboarding-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
  }
  .demo-download-link {
    width: auto;
    min-width: 132px;
    text-align: center;
    padding: 9px 16px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .demo-step-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
  .demo-step {
    min-height: 122px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
  }
  .demo-step span {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
  }
  .demo-step strong {
    display: block;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 6px;
  }
  .demo-step p {
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-secondary);
  }
  .demo-boundary {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    line-height: 1.6;
  }
  @media (max-width: 860px) {
    .demo-step-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  @media (max-width: 560px) {
    .demo-onboarding-header {
      align-items: stretch;
      flex-direction: column;
    }
    .demo-download-link {
      width: 100%;
    }
    .demo-step-grid {
      grid-template-columns: 1fr;
    }
  }

  .upload-area {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.25s;
    cursor: pointer;
    background: #fafbfc;
  }
  .upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
  }
  .upload-area .upload-icon { font-size: 48px; color: var(--primary); margin-bottom: 12px; }
  .upload-area .upload-text { font-size: 15px; color: var(--text-secondary); margin-bottom: 4px; }
  .upload-area .upload-hint { font-size: 13px; color: #c0c4cc; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
  .format-capabilities-trigger { margin-top: 10px; width: auto; padding: 4px 8px; font-size: 12px; }
  .format-capabilities-intro { margin: 0 0 12px; color: var(--text-secondary); line-height: 1.5; }
  .format-capability-list { display: grid; gap: 0; }
  .format-capability-row { display: grid; grid-template-columns: minmax(110px, 150px) minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
  .format-capability-row:last-child { border-bottom: 0; }
  .format-capability-detail { color: var(--text-secondary); font-size: 13px; line-height: 1.55; }
  @media (max-width: 640px) {
    .format-capability-row { grid-template-columns: 1fr; gap: 4px; }
  }

  .file-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--primary-light);
    border-radius: 8px;
  }
  .file-selected .file-icon { font-size: 22px; }
  .file-selected .file-name { font-weight: 500; color: var(--primary-dark); }
  .file-selected .file-remove { color: #f56c6c; cursor: pointer; font-size: 18px; margin-left: 8px; }

  .lang-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
  .lang-row .el-select { width: 180px; }
  .lang-swap {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary);
    transition: all 0.2s;
    flex-shrink: 0;
  }
  .lang-swap:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
  .translate-btn-wrap { margin-left: auto; }
  .progress-wrap { margin-top: 20px; }

  .result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 8px;
  }
  .result-table th {
    background: #f8f9fb;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--border);
  }
  .result-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 14px;
    line-height: 1.65;
  }
  .result-table tr:last-child td { border-bottom: none; }
  .result-table tr:hover td { background: #fafbfc; }
  .result-table .col-check { width: 40px; text-align: center; }
  .result-table .col-index { width: 56px; text-align: center; color: var(--text-secondary); font-weight: 500; }
  .result-table .col-source { width: 38%; color: #555; }
  .result-table .col-target { width: 42%; }
  .result-table .col-actions { width: 110px; text-align: center; }

  /* 译员必须一眼看出这里可编辑：常驻浅底 + 细边框 + 文本光标 */
  .target-edit {
    border: 1px solid var(--border);
    background: #fbfcfd;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.65;
    color: var(--text);
    width: 100%;
    min-height: 40px;
    resize: vertical;
    padding: 6px 8px;
    border-radius: 6px;
    outline: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: text;
  }
  .target-edit:hover { background: #f4f6f9; border-color: #c0c4cc; }
  .target-edit:focus {
    background: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(64,158,255,0.2);
    cursor: text;
  }
  .target-edit.edited { background: #fefce8; border-color: #fde68a; }

  /* 行内次要操作：静默但不移除，保证既有选择器与自动化用例仍可点击 */
  .row-secondary-actions {
    display: inline-flex;
    align-items: center;
    opacity: 0.15;
    transition: opacity 0.15s ease;
  }
  /* 核心 AI 操作常驻可见（不随 hover 隐藏），保证可发现性 */
  .row-primary-actions {
    display: inline-flex;
    align-items: center;
    opacity: 1;
  }
  .unsaved-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    padding: 2px 10px;
    border-radius: 10px;
    margin-right: 6px;
  }
  [data-theme="dark"] .unsaved-badge {
    color: #fcd34d;
    background: #451a03;
    border-color: #92400e;
  }
  .result-table tr:hover .row-secondary-actions,
  .result-table tr:focus-within .row-secondary-actions {
    opacity: 1;
  }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
  }
  .status-badge.translated { background: #f0fdf4; color: #16a34a; }
  .status-badge.edited   { background: #fefce8; color: #ca8a04; }
  .status-badge.tm-hit { background: #eef2ff; color: #4f46e5; margin-left: 6px; }
  .status-badge.tm-fuzzy { background: #fff7ed; color: #c2410c; margin-left: 6px; }
  .status-badge.tm-team { background: #f0fdfa; color: #0d9488; margin-left: 6px; }
  .status-badge.st-approved { background: #f0fdf4; color: #16a34a; }
  .status-badge.st-pending { background: #f3f4f6; color: #6b7280; }
  .status-badge.st-failed { background: #fef2f2; color: #dc2626; }
  .status-badge.st-draft { background: #fffbeb; color: #d97706; }
  .status-badge.st-kept { background: #eff6ff; color: #2563eb; }
  .status-badge.review-status-badge { margin-left: 6px; }
  .status-badge.review-status-auto-approved { background: #ecfdf5; color: #047857; }
  .status-badge.review-status-qa-unchecked { background: #eff6ff; color: #1d4ed8; }
  .status-badge.review-status-escalated { background: #fff1f2; color: #be123c; }

  .btn-confirmed.el-button {
    background: #67c23a !important;
    border-color: #67c23a !important;
    color: #fff !important;
  }
  .btn-confirmed.el-button:hover {
    background: #5daf34 !important;
    border-color: #5daf34 !important;
  }

  .pricing-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
    background: #f8fafc;
  }
  .pricing-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
  }
  .pricing-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
  .pricing-card-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 4px; line-height: 1.6; }
  .tm-summary-badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 999px;
    padding: 4px 10px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 600;
  }
  .pricing-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
  }
  .pricing-option {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
  }
  .pricing-option-name { font-size: 13px; color: var(--text-secondary); }
  .pricing-option-price { font-size: 24px; font-weight: 700; color: var(--primary); margin-top: 4px; }
  .pricing-option-note { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }

  .result-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
  }

  /* QA Panel Styles */
  .qa-header-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
  }
  .qa-header-bar .qa-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 500;
  }
  .qa-summary-badge.qa-has-errors { background: #fef2f2; color: #dc2626; }
  .qa-summary-badge.qa-warnings-only { background: #fffbeb; color: #d97706; }
  .qa-summary-badge.qa-clean { background: #f0fdf4; color: #16a34a; }

  .quality-grade-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
  }
  .quality-grade-badge.quality-grade-a { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
  .quality-grade-badge.quality-grade-b { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
  .quality-grade-badge.quality-grade-c { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
  .quality-grade-badge.quality-grade-d { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

  .qa-row-dot.term-issue {
    background: #9333ea;
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.25);
  }

  .term-issue-segment {
    color: #9333ea;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
  }

  .qa-row-highlight { position: relative; }
  .qa-row-highlight.has-qa-error::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #dc2626;
  }
  .qa-row-highlight.has-term-issue::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #9333ea;
  }
  .qa-row-highlight.has-qa-warning::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: #f59e0b;
  }

  .source-text {
    white-space: pre-wrap;
    word-break: break-word;
  }

  .pdf-ocr-provenance {
    box-sizing: border-box;
    max-width: 100%;
    padding-inline-end: 16px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
  }

  .image-ocr-review-provenance {
    box-sizing: border-box;
    max-width: 100%;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .image-orientation-review {
    box-sizing: border-box;
    max-width: 100%;
    margin-top: 6px;
    padding: 6px 8px;
    border-inline-start: 3px solid var(--lf-warning);
    border-radius: 3px;
    background: var(--lf-warning-light);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .lf-term-highlight {
    background: #fef08a;
    color: #713f12;
    border-radius: 3px;
    padding: 0 2px;
    box-shadow: inset 0 -1px 0 #facc15;
  }
  .qa-row-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
  }
  .qa-row-dot.error { background: #dc2626; }
  .qa-row-dot.warning { background: #f59e0b; }

  .qa-panel {
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fafbfc;
  }
  .qa-panel-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .qa-issue-item {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid;
    background: #fff;
  }
  .qa-issue-item.error { border-left-color: #dc2626; background: #fef2f2; }
  .qa-issue-item.warning { border-left-color: #f59e0b; background: #fffbeb; }
  .qa-issue-item.unknown { border-left-color: #64748b; background: #f8fafc; }
  .qa-issue-type {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 4px;
    margin-right: 8px;
  }
  .qa-issue-type.error { background: #fecaca; color: #dc2626; }
  .qa-issue-type.warning { background: #fde68a; color: #d97706; }
  .qa-issue-type.unknown { background: #e2e8f0; color: #334155; }
  .qa-issue-spans {
    font-size: 13px;
    margin-top: 4px;
    line-height: 1.6;
  }
  .qa-issue-spans .span-label { color: var(--text-secondary); font-size: 12px; }
  .qa-issue-spans .span-text { background: #e5e7eb; padding: 1px 6px; border-radius: 3px; font-size: 12px; }
  .qa-issue-spans .span-text.error-hl { background: #fecaca; }
  .qa-issue-suggestion {
    font-size: 13px;
    margin-top: 6px;
    color: #059669;
    font-style: italic;
  }

  .auto-repair-panel {
    margin-top: 8px;
    padding: 8px 10px;
    border-left: 3px solid #10b981;
    background: #ecfdf5;
    border-radius: 4px;
    font-size: 12px;
  }
  .auto-repair-title {
    font-weight: 700;
    color: #047857;
    margin-bottom: 4px;
  }
  .auto-repair-hint {
    color: #6b7280;
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 6px;
  }
  .target-term-warning {
    margin-top: 6px;
    padding: 5px 8px;
    border-left: 3px solid #f59e0b;
    background: #fffbeb;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.6;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }
  .ttw-label {
    color: #b45309;
    font-weight: 700;
    flex: 0 0 auto;
  }
  .ttw-item {
    color: #92400e;
    background: #fef3c7;
    border-radius: 3px;
    padding: 1px 5px;
  }
  .auto-repair-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    line-height: 1.5;
  }
  .auto-repair-type {
    flex: 0 0 auto;
    color: #047857;
    font-weight: 600;
  }
  .auto-repair-text { color: #065f46; }

  /* AI Suggestions Panel (side panel) */
  .suggestions-panel {
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    background: #f0f9ff;
  }
  .suggestions-panel-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1e40af;
  }
  .suggestion-item {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #dbeafe;
    background: #fff;
    position: relative;
  }
  .suggestion-text {
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 4px;
    line-height: 1.5;
  }
  .suggestion-reason {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
  }

  /* Select-all label in toolbar */
  .select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    margin-right: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    transition: all 0.15s;
  }
  .select-all-label:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
  }

  .review-queue-panel {
    border: 1px solid #fed7aa;
    background: #fff7ed;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
  }
  .review-queue-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
  }
  .review-queue-title {
    font-size: 14px;
    font-weight: 700;
    color: #9a3412;
  }
  .review-queue-summary {
    margin-top: 3px;
    font-size: 12px;
    color: #c2410c;
  }
  .review-queue-count {
    min-width: 30px;
    height: 30px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fb923c;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
  }
  .export-readiness-gate {
    margin-bottom: 10px;
    border-radius: 6px;
    background: #ffedd5;
    color: #9a3412;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
  }
  .export-readiness-gate.ready {
    background: #dcfce7;
    color: #166534;
  }
  .review-group-title {
    margin: 12px 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: #9a3412;
    letter-spacing: .3px;
  }
  .review-group-title-clickable {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    width: 100%;
    padding: 4px 6px;
    color: inherit;
    font: inherit;
    text-align: left;
    border-radius: 6px;
    background: #fff;
    border: 1px dashed #fdba74;
  }
  .review-group-title-clickable:hover { background: #fffaf5; }
  .review-group-title-clickable:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
  .review-group-toggle {
    font-weight: 600;
    color: #ea580c;
    font-size: 11px;
  }
  .review-queue-list {
    display: grid;
    gap: 8px;
  }
  .review-queue-list--hints { margin-top: 4px; }
  .review-queue-item {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ffedd5;
    border-radius: 6px;
    background: #fff;
    padding: 6px 8px;
  }
  .review-queue-item.hint { border-style: dashed; background: #fffaf2; }
  .review-queue-item:hover { border-color: #fb923c; background: #fffaf5; }
  .review-queue-item.approved { border-color: #bbf7d0; background: #f0fdf4; opacity: .72; }
  .review-queue-row {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    grid-template-columns: 48px 72px minmax(180px, 1fr);
    gap: 8px;
    align-items: center;
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--text);
    font-family: inherit;
    padding: 2px 0;
  }
  .review-queue-row-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
  }
  .review-queue-segment {
    font-weight: 700;
    color: #9a3412;
  }
  .review-queue-severity {
    justify-self: start;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
  }
  .review-queue-severity.high { background: #fee2e2; color: #dc2626; }
  .review-queue-severity.medium { background: #fef3c7; color: #d97706; }
  .review-queue-severity.low { background: #e0f2fe; color: #0369a1; }
  .review-queue-reason {
    min-width: 0;
    color: var(--text);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .review-queue-item.approved .review-queue-reason { text-decoration: line-through; opacity: .6; }

  /* ===== 人工审校队列 侧边抽屉 ===== */
  .review-sidebar-root { position: fixed; right: 0; top: 0; bottom: 0; z-index: 1000; pointer-events: none; }
  .review-sidebar-root > * { pointer-events: auto; }

  /* 折叠把手（右缘竖条） */
  .review-sidebar-handle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 36px;
    padding: 14px 4px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    cursor: pointer;
    color: #9a3412;
    font-family: inherit;
  }
  .review-sidebar-handle:hover { background: #fff7ed; }
  .review-sidebar-handle-icon { font-size: 16px; line-height: 1; }
  .review-sidebar-handle-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
  }
  .review-sidebar-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* 展开抽屉 */
  .review-sidebar-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 360px;
    max-width: 88vw;
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 24px rgba(0,0,0,.16);
    display: flex;
    flex-direction: column;
    z-index: 1001;
  }
  .review-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: #fff7ed;
  }
  .review-sidebar-title { font-size: 14px; font-weight: 700; color: #9a3412; }
  .review-sidebar-summary { margin-top: 2px; font-size: 12px; color: #c2410c; }
  .review-sidebar-close {
    flex: 0 0 auto;
    width: 28px; height: 28px;
    border: 0; border-radius: 6px;
    background: transparent;
    color: #9a3412;
    font-size: 15px;
    cursor: pointer;
  }
  .review-sidebar-close:hover { background: rgba(154,52,18,.12); }
  .review-sidebar-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 14px 16px 20px;
  }
  .review-sidebar-body .review-queue-count { float: right; }
  .review-sidebar-body .review-group-title:first-of-type { margin-top: 4px; }

  .review-drawer-enter-active, .review-drawer-leave-active { transition: transform .25s ease; }
  .review-drawer-enter-from, .review-drawer-leave-to { transform: translateX(100%); }

  /* ===== 通用右侧抽屉（段检查 / 协作 / 报告），与审校抽屉互斥 ===== */
  .aux-drawer-root { position: fixed; right: 0; top: 0; bottom: 0; z-index: 1000; pointer-events: none; }
  .aux-drawer-root > * { pointer-events: auto; }

  /* 折叠把手（右缘竖条） */
  .aux-drawer-handle {
    position: fixed;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 34px;
    padding: 14px 4px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    cursor: pointer;
    color: #1d4ed8;
    font-family: inherit;
  }
  .aux-drawer-handle:hover { background: #eff6ff; }
  .aux-drawer-handle-icon { font-size: 16px; line-height: 1; }
  .aux-drawer-handle-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
  }
  .aux-handle-avatars { display: flex; flex-direction: column; gap: 3px; }
  .aux-handle-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: #fff;
    border: 2px solid var(--card-bg);
  }
  .aux-handle-avatar.self { outline: 2px solid #1d4ed8; }

  /* 展开抽屉 */
  .aux-drawer-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 360px;
    max-width: 88vw;
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 24px rgba(0,0,0,.16);
    display: flex;
    flex-direction: column;
    z-index: 1001;
  }
  .aux-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: #eff6ff;
  }
  .aux-drawer-title { font-size: 14px; font-weight: 700; color: #1d4ed8; }
  .aux-drawer-close {
    flex: 0 0 auto;
    width: 28px; height: 28px;
    border: 0; border-radius: 6px;
    background: transparent;
    color: #1d4ed8;
    font-size: 15px;
    cursor: pointer;
  }
  .aux-drawer-close:hover { background: rgba(29,78,216,.12); }
  .aux-drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 16px 20px; }

  /* 审校抽屉：术语组徽标 */
  .review-sidebar-badge--term { background: #d97706; }
  .review-queue-list--terms .review-queue-reason { font-size: 12px; }

  /* ===== 回到顶部按钮 ===== */
  .back-to-top-btn {
    position: fixed;
    right: 24px;
    bottom: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--primary);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
    z-index: 990;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease, background .15s ease;
  }
  .back-to-top-btn:hover { transform: translateY(-2px); background: var(--primary-dark); }
  .back-to-top-arrow { font-weight: 700; }
  .delivery-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    white-space: nowrap;
  }
  .delivery-badge.ready {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
  }

  .memory-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
  }
  .memory-dashboard-header .native-btn {
    width: auto;
    min-width: 84px;
    padding: 9px 16px;
    font-size: 13px;
  }
  .memory-dashboard-subtitle {
    margin: -10px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
  }
  .memory-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
  }
  .memory-stat {
    min-height: 82px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
  }
  .memory-stat span {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 12px;
  }
  .memory-stat strong {
    display: block;
    color: var(--primary-dark);
    font-size: 28px;
    line-height: 1;
  }
  .memory-management-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 150px 150px auto auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
  }
  .memory-management-toolbar .native-input {
    padding: 9px 12px;
    font-size: 13px;
  }
  .memory-management-toolbar .native-btn {
    width: auto;
    min-width: 78px;
    padding: 9px 14px;
    font-size: 13px;
    white-space: nowrap;
  }
  .memory-management-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }
  .memory-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    color: var(--text-secondary);
    font-size: 13px;
  }
  .memory-pagination .native-btn {
    width: auto;
    min-width: 88px;
  }
  .memory-page-info {
    color: var(--text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .memory-management-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
  }
  .memory-management-title small {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
  }
  .memory-empty,
  .memory-error {
    padding: 28px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: #fafbfc;
    color: var(--text-secondary);
    line-height: 1.7;
    text-align: center;
  }
  .memory-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
  }
  .memory-list {
    display: grid;
    gap: 12px;
  }
  .memory-entry {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
  }
  .memory-entry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 12px;
  }
  .memory-entry-actions {
    justify-content: flex-start;
  }
  .memory-entry-actions .native-btn {
    width: auto;
    margin-left: auto;
  }
  .memory-entry.retired {
    border-color: #e5e7eb;
    background: #fafafa;
  }
  .memory-entry-text {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .memory-entry-text div {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 6px;
    background: #f8fafc;
  }
  .memory-entry-text span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 12px;
  }
  .memory-entry-text p {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
  }
  .status-badge.retired { background: #f3f4f6; color: #6b7280; }
  .native-btn.subtle {
    min-width: 64px;
    padding: 6px 12px;
    font-size: 12px;
  }
  .native-btn.danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
  }
  .native-btn.danger:hover {
    background: #fee2e2;
  }

  .app-footer { text-align: center; padding: 20px; color: #c0c4cc; font-size: 13px; }

  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: #d9dce0; border-radius: 3px; }

  @media (max-width: 768px) {
    .billing-plan-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .billing-plan-card { min-width: 0; }
    .billing-orders-table-wrap { overflow: visible !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
    .billing-orders-table { width: 100% !important; min-width: 0 !important; border-collapse: separate !important; }
    .billing-orders-table thead { display: none; }
    .billing-orders-table tbody { display: grid; gap: 10px; }
    .billing-orders-table tbody tr:not(.billing-orders-empty-row) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
    .billing-orders-table tbody tr:not(.billing-orders-empty-row) td { display: block !important; min-width: 0; padding: 8px 0 !important; border: 0 !important; overflow-wrap: anywhere; text-align: left !important; }
    .billing-orders-table tbody tr:not(.billing-orders-empty-row) td::before { display: block; margin-bottom: 4px; color: var(--lf-text-3); content: attr(data-label); font-size: 11px; }
    .billing-orders-table tbody tr:not(.billing-orders-empty-row) td:first-child,
    .billing-orders-table .billing-order-actions { grid-column: 1 / -1; }
    .billing-order-action-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
    .billing-order-action-buttons .native-btn { width: auto; min-height: 32px; flex: 1 1 auto; }
    .billing-orders-empty-row { display: block; }
    .billing-orders-empty-row td { display: block; border: 0 !important; padding: 24px 12px !important; }
    .main-container { padding: 16px 12px 32px; }
    .card { padding: 18px; }
    .result-layout,
    .result-layout.with-minimap-hidden { grid-template-columns: minmax(0, 1fr); }
    .result-layout .minimap-area { position: static; max-height: none; }
    .term-import-row { grid-template-columns: 1fr; }
    .lang-row { flex-direction: column; align-items: stretch; }
    .lang-row .el-select { width: 100%; }
    .lang-swap { align-self: center; transform: rotate(90deg); }
    .translate-btn-wrap { margin-left: 0; margin-top: 8px; }
    .result-table .col-source, .result-table .col-target { width: auto; }
    .result-actions { flex-direction: column; }
    .review-queue-row { grid-template-columns: 42px 66px 1fr; }
    .review-queue-item { flex-wrap: wrap; }
    .review-queue-row-actions { width: 100%; justify-content: flex-end; }
    .memory-dashboard-header { flex-direction: column; }
    .memory-dashboard-header .native-btn { width: 100%; }
    .memory-management-toolbar,
    .memory-stats-grid,
    .memory-entry-text { grid-template-columns: 1fr; }
    .memory-management-toolbar .native-btn { width: 100%; }
    .memory-entry-actions .native-btn {
      width: 100%;
      margin-left: 0;
    }
    .auth-card { padding: 32px 24px; }
  }

  /* Mobile review enhancements */
  @media (max-width: 768px) {
    .table-area { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .result-table { min-width: 600px; }
    .result-table th, .result-table td { padding: 8px 6px; font-size: 13px; }
    .target-edit { font-size: 14px; min-height: 44px; }
    .result-actions .el-button, .review-queue-action .el-button,
    .result-actions button, .review-queue-action button { min-height: 36px; min-width: 36px; }
    .card-title { font-size: 15px; flex-wrap: wrap; }
    .minimap-list { grid-template-columns: repeat(12, 1fr); gap: 3px; }
    .minimap-cell { height: 20px; }
    .lang-row .el-select { width: 100% !important; }
    .qa-panel { position: static !important; width: 100% !important; max-height: none !important; }
    .suggestion-sidebar { position: static !important; width: 100% !important; max-height: 300px; }
    .app-header { padding: 8px 12px; }
    .app-header .el-button { padding: 6px 10px; font-size: 13px; }
    .segment-row { flex-direction: column; }
    .segment-row .seg-num { margin-bottom: 4px; }
  }

  @media (max-width: 480px) {
    :root { --lf-sticky-header-height: 88px; }
    .app-header { height: auto; min-height: 56px; padding: 8px; }
    .header-user { min-width: 0; padding-right: 106px; gap: 4px; }
    .header-user .user-name { display: none; }
    .header-user .plan-badge { padding: 2px 6px; }
    .header-upgrade-btn { padding: 4px 6px; }
    .header-profile-btn { padding: 4px 3px; font-size: 12px; }
    .header-logout { margin-left: 0; padding: 4px; }
    .app-tab-strip { width: 100%; max-width: 100%; box-sizing: border-box; justify-content: flex-start !important; }
    .main-container { padding: 8px 6px 24px; }
    .card { padding: 12px; margin-bottom: 12px; }
    .auth-card { padding: 20px 16px; }
    .upload-area { padding: 24px 12px; }
    .result-table { min-width: 500px; }
    .result-table th, .result-table td { padding: 6px 4px; font-size: 12px; }
    .lang-row { gap: 6px; }
    .lang-row span { font-size: 13px; }
    .el-button--large { padding: 8px 14px; font-size: 14px; }
    .review-sidebar-handle,
    .aux-drawer-handle {
      box-sizing: border-box;
      width: 44px;
      min-width: 44px;
      height: 44px;
      min-height: 44px;
      padding: 0;
      justify-content: center;
      border-radius: 10px 0 0 10px;
    }
    .review-sidebar-handle-label,
    .aux-drawer-handle-label { display: none; }
    .aux-handle-avatars { flex-direction: row; gap: 0; }
    .aux-handle-avatar:not(:first-child) { display: none; }
    .review-sidebar-badge {
      position: absolute;
      top: -5px;
      right: 26px;
      min-width: 16px;
      height: 16px;
      padding: 0 3px;
      font-size: 10px;
    }

    /* Keep source and editable target readable on phones without widening the page. */
    .result-table.translation-segments-table {
      display: block;
      width: 100%;
      min-width: 0;
      table-layout: fixed;
      border-spacing: 0;
    }
    .translation-segments-table colgroup { display: none; }
    .translation-segments-table tbody { display: grid; gap: 10px; }
    .translation-segments-table tbody tr {
      display: grid;
      grid-template-columns: 32px minmax(0, 1fr);
      align-items: center;
      padding: 8px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--card-bg);
    }
    .translation-segments-table tbody td {
      display: block;
      box-sizing: border-box;
      width: auto;
      min-width: 0;
      padding: 6px 2px;
      border: 0;
      text-align: left;
    }
    .translation-segments-table tbody .col-check { grid-column: 1; grid-row: 1; }
    .translation-segments-table tbody .col-index { grid-column: 2; grid-row: 1; }
    .translation-segments-table tbody .col-source,
    .translation-segments-table tbody .col-target,
    .translation-segments-table tbody .col-actions { grid-column: 1 / -1; }
    .translation-segments-table tbody .col-source { grid-row: 2; }
    .translation-segments-table tbody .col-target { grid-row: 3; }
    .translation-segments-table tbody .col-actions {
      grid-row: 4;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 4px;
      padding-top: 8px;
      border-top: 1px solid var(--border);
    }
    .translation-segments-table .col-source::before,
    .translation-segments-table .col-target::before,
    .translation-segments-table .col-actions::before {
      display: block;
      margin-bottom: 5px;
      color: var(--text-secondary);
      font-size: 11px;
      font-weight: 700;
      line-height: 1.4;
      content: attr(data-label);
    }
    .translation-segments-table .col-actions::before { flex: 0 0 100%; }
    .translation-segments-table .source-text {
      display: block;
      overflow-wrap: anywhere;
      word-break: normal;
      line-height: 1.55;
    }
    .translation-segments-table .target-edit {
      display: block;
      box-sizing: border-box;
      width: 100%;
      min-height: 88px;
    }
    .translation-segments-table tbody .col-actions > .el-button,
    .translation-segments-table tbody .row-primary-actions .el-button {
      box-sizing: border-box;
      min-width: 44px;
      min-height: 44px;
      padding: 0;
    }
    .translation-segments-table .row-primary-actions,
    .translation-segments-table .row-secondary-actions {
      display: inline-flex;
      flex-wrap: wrap;
      opacity: 1;
      visibility: visible;
    }
  }

  @media (max-width: 360px) {
    .header-upgrade-btn {
      flex: 0 0 32px;
      width: 32px;
      min-width: 32px;
      height: 32px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0;
      line-height: 1;
    }
    .header-upgrade-btn::before { content: '\2197'; font-size: 17px; }
    .header-upgrade-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  }

  /* Native fallback inputs (always visible, no Element Plus dependency) */
  .native-input {
    width: 100%; padding: 12px 16px; font-size: 15px;
    border: 2px solid #dcdfe6; border-radius: 8px; outline: none;
    box-sizing: border-box; transition: border-color 0.2s;
    background: #fff; color: #333; font-family: inherit;
  }
  .native-input:focus { border-color: #409EFF; }
  .native-input::placeholder { color: #c0c4cc; }
  .native-btn {
    width: 100%; padding: 12px; font-size: 16px; font-weight: 600;
    background: #409EFF; color: #fff; border: none; border-radius: 8px;
    cursor: pointer; transition: background 0.2s; letter-spacing: 0.5px;
    font-family: inherit;
  }
  .native-btn:hover { background: #337ecc; }
  .native-btn:active { background: #2a6cb8; }

  /* Footgun guard: .native-btn defaults to width:100%, which is fine for standalone
     form/card buttons but blows out siblings when dropped into a flex row (dialog
     footers, toolbars) — squeezing the textarea/input to a thin strip. Any .native-btn
     that is a direct child of a display:flex container now sizes to its content.
     Intentional full-width buttons keep their inline style="width:100%", which still
     wins by specificity. New dialogs using the flex-row pattern are safe by default. */
  [style*="display:flex"] > .native-btn,
  [style*="display: flex"] > .native-btn { width: auto; flex: 0 0 auto; }

  /* =*=*=* Utility layout classes (replace recurring inline styles) =*=*=* */
  /* Flex action rows. Inherits the .native-btn footgun guard above, so buttons
     inside size to content instead of stretching. */
  .btn-row { display: flex; gap: 10px; align-items: center; }
  .btn-row--end { justify-content: flex-end; }
  .btn-row--between { justify-content: space-between; }
  .btn-row--wrap { flex-wrap: wrap; }
  /* Buttons inside a .btn-row size to content (mirrors the inline flex footgun guard) */
  .btn-row > .native-btn { width: auto; flex: 0 0 auto; }
  /* Vertical form stacks (login/register etc.) */
  .stack-form { display: flex; flex-direction: column; gap: 12px; }
  /* Card padding helper used across panels */
  .panel-pad { padding: 20px; }
  /* Inline text link styled as a quiet action */
  .text-link { color: #409eff; cursor: pointer; }
  .text-link:hover { text-decoration: underline; }

  /* =*=*=* P1: Projects & Compare =*=*=* */
  .project-card { transition: box-shadow 0.2s; }
  .project-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
  .status-badge.status-draft { background: #f5f7fa; color: #909399; }
  .status-badge.status-in_progress { background: #ecf5ff; color: #409EFF; }
  .status-badge.status-review { background: #fdf6ec; color: #e6a23c; }
  .status-badge.status-done { background: #f0fdf4; color: #67c23a; }
  .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.45); z-index: 1000; display: flex; align-items: center; justify-content: center; }
  .modal-card { background: #fff; border-radius: 12px; padding: 28px; width: 440px; max-width: 92vw; max-height: 85vh; overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,0.15); }
  .compare-card { transition: box-shadow 0.2s; }
  .compare-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
  .compare-translation { max-height: 200px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }

  /* ========== Dark Mode Overrides ========== */
  [data-theme="dark"] body {
    background: var(--bg);
    color: var(--text);
  }
  [data-theme="dark"] .app-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e40af 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  }
  [data-theme="dark"] .card {
    background: var(--card-bg);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.3);
  }
  [data-theme="dark"] .card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.4);
  }
  [data-theme="dark"] .vscroll-container {
    background: var(--card-bg);
    border-color: var(--border);
  }
  [data-theme="dark"] .result-table th {
    background: #0f172a;
    color: var(--text-secondary);
    border-bottom-color: var(--border);
  }
  [data-theme="dark"] .result-table td {
    border-bottom-color: var(--border);
  }
  [data-theme="dark"] .result-table tr:hover td {
    background: #334155;
  }
  [data-theme="dark"] .target-edit {
    color: var(--text);
    background: #0b1220;
    border-color: var(--border);
  }
  [data-theme="dark"] .target-edit:hover {
    background: #334155;
  }
  [data-theme="dark"] .target-edit:focus {
    background: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(96,165,250,0.3);
  }
  [data-theme="dark"] .target-edit.edited {
    background: #3f3f06;
    color: #fde047;
  }
  [data-theme="dark"] .result-actions-sticky {
    background: rgba(30, 41, 59, 0.96);
    border-color: var(--border);
  }
  [data-theme="dark"] .seg-filter-bar {
    background: var(--bg);
  }
  [data-theme="dark"] .seg-filter-bar .filter-pill {
    background: var(--card-bg);
    border-color: var(--border);
    color: var(--text);
  }
  [data-theme="dark"] .seg-filter-bar .filter-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
  }
  [data-theme="dark"] .upload-area {
    background: #0f172a;
    border-color: var(--border);
  }
  [data-theme="dark"] .upload-area:hover,
  [data-theme="dark"] .upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
  }
  [data-theme="dark"] .lang-swap {
    background: var(--card-bg);
    border-color: var(--border);
    color: var(--primary);
  }
  [data-theme="dark"] .pricing-card,
  [data-theme="dark"] .pricing-option {
    background: #0f172a;
    border-color: var(--border);
  }
  [data-theme="dark"] .memory-stat {
    background: #0f172a;
    border-color: var(--border);
  }
  [data-theme="dark"] .memory-entry {
    background: var(--card-bg);
    border-color: var(--border);
  }
  [data-theme="dark"] .memory-entry-text div {
    background: #0f172a;
  }
  [data-theme="dark"] .memory-empty,
  [data-theme="dark"] .memory-error {
    background: #0f172a;
    border-color: var(--border);
  }
  [data-theme="dark"] .native-input {
    background: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
  }
  [data-theme="dark"] .native-input:focus {
    border-color: var(--primary);
  }
  [data-theme="dark"] .native-btn.secondary {
    background: var(--card-bg);
    color: var(--primary);
    border-color: var(--primary);
  }
  [data-theme="dark"] .native-btn.secondary:hover {
    background: var(--primary-light);
  }
  [data-theme="dark"] .native-btn.attention {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
  }
  [data-theme="dark"] .native-btn.attention:hover {
    background: #ef4444;
    border-color: #ef4444;
  }
  [data-theme="dark"] .pipeline-stage-card.tone-success { background: #064e3b; border-color: #22c55e; }
  [data-theme="dark"] .pipeline-stage-card.tone-active { background: #1e3a8a; border-color: #3b82f6; }
  [data-theme="dark"] .pipeline-stage-card.tone-attention { background: #450a0a; border-color: #f87171; }
  [data-theme="dark"] .pipeline-stage-card.tone-pending { background: #1f2937; border-color: #4b5563; }
  [data-theme="dark"] .pipeline-stage-wrapper.has-connector::after { background: #374151; }
  [data-theme="dark"] .tone-success .pipeline-stage-icon { background: #14532d; color: #86efac; }
  [data-theme="dark"] .tone-active .pipeline-stage-icon { background: #1e40af; color: #bfdbfe; }
  [data-theme="dark"] .tone-attention .pipeline-stage-icon { background: #7f1d1d; color: #fecaca; }
  [data-theme="dark"] .tone-pending .pipeline-stage-icon { background: #374151; color: #9ca3af; }
  [data-theme="dark"] .pipeline-next-action { background: #1e3a8a; border-color: #3b82f6; color: #bfdbfe; }
  [data-theme="dark"] .tm-import-card {
    background: linear-gradient(180deg, #122036 0%, var(--card-bg) 100%);
    border-color: #1e3a5f;
    box-shadow: none;
  }
  [data-theme="dark"] .tm-import-card__title-sub { color: var(--text-secondary); }
  [data-theme="dark"] .tm-import-result {
    background: #052e2b;
    border-color: #065f46;
    color: #6ee7b7;
  }
  [data-theme="dark"] .tm-import-result__icon { background: #059669; color: #ecfdf5; }
  [data-theme="dark"] .pipeline-next-action.attention { background: #450a0a; border-color: #f87171; color: #fecaca; }
  [data-theme="dark"] .pipeline-overall-badge.tone-active { background: #1e3a8a; border-color: #3b82f6; color: #bfdbfe; }
  [data-theme="dark"] .pipeline-overall-badge.tone-ready { background: #064e3b; border-color: #22c55e; color: #86efac; }
  [data-theme="dark"] .pipeline-overall-badge.tone-attention { background: #450a0a; border-color: #f87171; color: #fecaca; }
  [data-theme="dark"] .pipeline-overall-badge.tone-idle { background: #1f2937; border-color: #4b5563; color: #9ca3af; }
  [data-theme="dark"] @keyframes segment-flash {
    0% { background-color: rgba(96, 165, 250, 0.45); }
    60% { background-color: rgba(96, 165, 250, 0.18); }
    100% { background-color: transparent; }
  }
  [data-theme="dark"] .demo-onboarding {
    background: #0f172a;
    border-color: var(--border);
  }
  [data-theme="dark"] .demo-step {
    background: var(--card-bg);
    border-color: var(--border);
  }
  [data-theme="dark"] .demo-step span {
    background: var(--primary-light);
    color: var(--primary);
  }
  [data-theme="dark"] .status-badge.translated { background: #064e3b; color: #6ee7b7; }
  [data-theme="dark"] .status-badge.edited { background: #3f3f06; color: #fde047; }
  [data-theme="dark"] .status-badge.tm-hit { background: #1e1b4b; color: #a5b4fc; }
  [data-theme="dark"] .status-badge.tm-fuzzy { background: #431407; color: #fb923c; }
  [data-theme="dark"] .status-badge.tm-team { background: #042f2e; color: #5eead4; }
  [data-theme="dark"] .status-badge.st-approved { background: #064e3b; color: #6ee7b7; }
  [data-theme="dark"] .status-badge.st-pending { background: #334155; color: var(--text-secondary); }
  [data-theme="dark"] .status-badge.st-failed { background: #450a0a; color: #fca5a5; }
  [data-theme="dark"] .status-badge.st-draft { background: #451a03; color: #fcd34d; }
  [data-theme="dark"] .status-badge.st-kept { background: #1e3a8a; color: #93c5fd; }
  [data-theme="dark"] .status-badge.review-status-auto-approved { background: #064e3b; color: #6ee7b7; }
  [data-theme="dark"] .status-badge.review-status-escalated { background: #4c0519; color: #fda4af; }
  [data-theme="dark"] .status-badge.status-draft { background: #334155; color: var(--text-secondary); }
  [data-theme="dark"] .status-badge.status-in_progress { background: #1e3a5f; color: var(--primary); }
  [data-theme="dark"] .status-badge.status-review { background: #451a03; color: #fb923c; }
  [data-theme="dark"] .status-badge.status-done { background: #064e3b; color: #6ee7b7; }
  [data-theme="dark"] .review-queue-panel {
    background: #431407;
    border-color: #9a3412;
  }
  [data-theme="dark"] .review-queue-title { color: #fb923c; }
  [data-theme="dark"] .review-queue-summary { color: #fdba74; }
  [data-theme="dark"] .review-queue-item {
    background: var(--card-bg);
    border-color: #7c2d12;
  }
  [data-theme="dark"] .review-queue-item:hover {
    background: #431407;
    border-color: #fb923c;
  }
  [data-theme="dark"] .review-queue-item.approved {
    background: #064e3b;
    border-color: #065f46;
  }
  [data-theme="dark"] .export-readiness-gate {
    background: #7c2d12;
    color: #fdba74;
  }
  [data-theme="dark"] .export-readiness-gate.ready {
    background: #064e3b;
    color: #6ee7b7;
  }
  [data-theme="dark"] .review-sidebar-handle { background: var(--card-bg); border-color: var(--border); color: #fb923c; }
  [data-theme="dark"] .review-sidebar-handle:hover { background: #1e293b; }
  [data-theme="dark"] .review-sidebar-panel { background: var(--card-bg); border-left-color: var(--border); }
  [data-theme="dark"] .review-sidebar-header { background: #431407; border-color: #9a3412; }
  [data-theme="dark"] .review-sidebar-title { color: #fb923c; }
  [data-theme="dark"] .review-sidebar-summary { color: #fdba74; }
  [data-theme="dark"] .review-sidebar-close { color: #fb923c; }
  [data-theme="dark"] .review-sidebar-close:hover { background: rgba(251,146,60,.15); }
  [data-theme="dark"] .aux-drawer-handle { background: var(--card-bg); border-left-color: var(--border); color: #93c5fd; }
  [data-theme="dark"] .aux-drawer-handle:hover { background: #172554; }
  [data-theme="dark"] .aux-drawer-panel { background: var(--card-bg); border-left-color: var(--border); }
  [data-theme="dark"] .aux-drawer-header { background: #172554; border-color: #1e3a8a; }
  [data-theme="dark"] .aux-drawer-title { color: #93c5fd; }
  [data-theme="dark"] .aux-drawer-close { color: #93c5fd; }
  [data-theme="dark"] .aux-drawer-close:hover { background: rgba(147,197,253,.15); }
  [data-theme="dark"] .back-to-top-btn { background: var(--primary); }
  [data-theme="dark"] .back-to-top-btn:hover { background: var(--primary-dark); }
  [data-theme="dark"] .qa-panel {
    background: #0f172a;
    border-color: var(--border);
  }
  [data-theme="dark"] .qa-issue-item {
    background: var(--card-bg);
  }
  [data-theme="dark"] .qa-issue-item.error {
    background: #450a0a;
  }
  [data-theme="dark"] .qa-issue-item.warning {
    background: #451a03;
  }
  [data-theme="dark"] .qa-issue-item.unknown {
    background: #1e293b;
  }
  [data-theme="dark"] .suggestions-panel {
    background: #0f172a;
    border-color: var(--border);
  }
  [data-theme="dark"] .suggestion-item {
    background: var(--card-bg);
    border-color: var(--border);
  }
  [data-theme="dark"] .auto-repair-panel {
    background: #064e3b;
    border-left-color: #10b981;
  }
  [data-theme="dark"] .auto-repair-hint {
    color: var(--text-secondary);
  }
  [data-theme="dark"] .target-term-warning {
    background: #451a03;
    border-left-color: #f59e0b;
  }
  [data-theme="dark"] .ttw-label {
    color: #fcd34d;
  }
  [data-theme="dark"] .ttw-item {
    color: #fde68a;
    background: #78350f;
  }
  [data-theme="dark"] .modal-card {
    background: var(--card-bg);
    color: var(--text);
  }
  [data-theme="dark"] .select-all-label {
    background: #334155;
    border-color: var(--border);
    color: var(--text);
  }
  [data-theme="dark"] .select-all-label:hover {
    background: #475569;
    border-color: #64748b;
  }
  [data-theme="dark"] .compare-card {
    background: var(--card-bg);
    border-color: var(--border);
  }
  [data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
  }

  /* Dark mode Element Plus overrides */
  [data-theme="dark"] .el-button {
    --el-button-bg-color: var(--card-bg);
    --el-button-text-color: var(--text);
    --el-button-border-color: var(--border);
    background-color: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
  }
  [data-theme="dark"] .el-button:hover {
    --el-button-hover-bg-color: var(--primary-light);
    --el-button-hover-text-color: var(--primary);
    --el-button-hover-border-color: var(--primary);
  }
  [data-theme="dark"] .el-input__wrapper {
    background-color: var(--card-bg);
    box-shadow: 0 0 0 1px var(--border) inset;
  }
  [data-theme="dark"] .el-input__inner {
    color: var(--text);
  }
  [data-theme="dark"] .el-select .el-input__wrapper {
    background-color: var(--card-bg);
  }
  [data-theme="dark"] .el-textarea__inner {
    background-color: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
  }
  [data-theme="dark"] .el-progress__track {
    background-color: var(--border);
  }
  [data-theme="dark"] .el-message-box {
    background-color: var(--card-bg);
    border-color: var(--border);
  }
  [data-theme="dark"] .el-message-box__title,
  [data-theme="dark"] .el-message-box__content {
    color: var(--text);
  }
  [data-theme="dark"] .el-dialog {
    background-color: var(--card-bg);
  }
  [data-theme="dark"] .el-dialog__title,
  [data-theme="dark"] .el-dialog__body {
    color: var(--text);
  }
  [data-theme="dark"] .el-dropdown-menu {
    background-color: var(--card-bg);
    border-color: var(--border);
  }
  [data-theme="dark"] .el-dropdown-menu__item {
    color: var(--text);
  }
  [data-theme="dark"] .el-dropdown-menu__item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
  }
  [data-theme="dark"] .el-tooltip__popper {
    background-color: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
  }

  /* ========== Theme Toggle Button ========== */
  .theme-toggle {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    padding: 0;
    margin-left: 8px;
  }
  .theme-toggle:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.55);
  }
  [data-theme="dark"] .theme-toggle {
    background: rgba(255,255,255,0.1);
  }
  [data-theme="dark"] .theme-toggle:hover {
    background: rgba(255,255,255,0.2);
  }

  /* ========== Presence Indicator ========== */
  .presence-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 16px;
    background: rgba(255,255,255,0.15);
    font-size: 12px;
    color: #fff;
    margin-left: 8px;
    transition: all 0.2s;
  }
  .presence-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f56c6c;
    transition: all 0.3s;
  }
  .presence-dot.connected {
    background: #67c23a;
    box-shadow: 0 0 6px #67c23a;
    animation: pulse-dot 2s infinite;
  }
  @keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
  }
  .presence-count {
    font-weight: 600;
  }

  /* ========== Collaboration Panel ========== */
  .collaboration-panel {
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
  }
  .collaboration-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .collaboration-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
  }
  .collaboration-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
  }
  .collaboration-status.active {
    color: #67c23a;
  }
  .collaboration-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dcdfe6;
  }
  .collaboration-status.active .status-dot {
    background: #67c23a;
    box-shadow: 0 0 6px #67c23a;
  }
  .collaboration-actions {
    display: flex;
    gap: 8px;
  }
  .collaboration-toggle-btn {
    cursor: pointer;
  }

  .collaboration-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* Collaborator avatars */
  .collaborator-avatars {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .collaborator-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: default;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid var(--card-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  }
  .collaborator-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  }
  .collaborator-avatar.self-avatar {
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.3);
  }
  .self-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 8px;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    padding: 1px 3px;
    line-height: 1;
  }
  .avatar-editing-indicator {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 9px;
    font-weight: 700;
    background: #f56c6c;
    color: #fff;
    border-radius: 8px;
    padding: 1px 4px;
    line-height: 1.3;
    white-space: nowrap;
  }

  /* Editing indicators */
  .editing-indicators {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-radius: 6px;
    background: rgba(245, 108, 108, 0.08);
    border: 1px solid rgba(245, 108, 108, 0.2);
  }
  .editing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
  }
  .editing-user {
    font-weight: 600;
  }
  .editing-action {
    color: var(--text-secondary);
  }

  /* Chat panel */
  .collaboration-chat {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 4px;
  }
  .chat-messages {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px;
    margin-bottom: 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
  }
  .chat-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 20px;
  }
  .chat-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
  }
  .chat-message.self {
    flex-direction: row-reverse;
  }
  .chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
  }
  .chat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 75%;
  }
  .chat-message.self .chat-content {
    align-items: flex-end;
  }
  .chat-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-secondary);
  }
  .chat-user {
    font-weight: 600;
    color: var(--text);
  }
  .chat-time {
    opacity: 0.7;
  }
  .chat-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-secondary);
    padding: 6px 10px;
    border-radius: 8px;
    word-break: break-word;
  }
  .chat-message.self .chat-text {
    background: var(--primary);
    color: #fff;
  }
  .chat-input-bar {
    display: flex;
    gap: 8px;
  }
  .chat-input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
  }
  .chat-input:focus {
    border-color: var(--primary);
  }
  .chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .chat-send-btn {
    cursor: pointer;
  }

  /* Dark theme collaboration overrides */
  [data-theme="dark"] .presence-indicator {
    background: rgba(255,255,255,0.1);
  }
  [data-theme="dark"] .collaboration-panel {
    background: var(--card-bg);
    border-color: var(--border);
  }
  [data-theme="dark"] .editing-indicators {
    background: rgba(245, 108, 108, 0.15);
    border-color: rgba(245, 108, 108, 0.3);
  }
  [data-theme="dark"] .chat-messages {
    background: var(--bg-secondary);
  }
  [data-theme="dark"] .chat-text {
    background: var(--bg-secondary);
  }
  [data-theme="dark"] .chat-message.self .chat-text {
    background: var(--primary);
  }
  [data-theme="dark"] .chat-input {
    background: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
  }

/* Workflow stage badges */
.workflow-stage {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .memory-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memory-stat { min-height: 70px; padding: 12px; }
  .memory-stat strong { font-size: 24px; }
}
.workflow-stage.stage-translated { background: #e0e7ff; color: #4338ca; }
.workflow-stage.stage-edited { background: #fef3c7; color: #92400e; }
.workflow-stage.stage-proofread { background: #d1fae5; color: #065f46; }
.workflow-stage.stage-published { background: #d1fae5; color: #065f46; border: 1px solid #10b981; }

[data-theme="dark"] .workflow-stage.stage-translated { background: #312e81; color: #a5b4fc; }
[data-theme="dark"] .workflow-stage.stage-edited { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .workflow-stage.stage-proofread { background: #022c22; color: #6ee7b7; }
[data-theme="dark"] .workflow-stage.stage-published { background: #022c22; color: #6ee7b7; border-color: #10b981; }

/* ===== Pipeline stage icons (replaces broken unicode) ===== */
.stage-icon-symbol { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #9ca3af; position: relative; vertical-align: middle; }
.stage-icon-symbol.icon-circle { border-color: #9ca3af; background: #f3f4f6; }
.stage-icon-symbol.icon-check { border-color: #22c55e; background: #22c55e; border-width: 0; }
.stage-icon-symbol.icon-check::after { content: ""; position: absolute; width: 5px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); top: 2px; left: 6px; }
.stage-icon-symbol.icon-loading { border-color: #3b82f6; border-right-color: transparent; border-top-color: transparent; animation: icon-spin 0.8s linear infinite; }
.stage-icon-symbol.icon-exclamation { border-color: #ef4444; background: #ef4444; border-width: 0; color: #fff; font-weight: 700; font-size: 11px; line-height: 18px; text-align: center; }
.stage-icon-symbol.icon-exclamation::after { content: "!"; }
.stage-icon-symbol.icon-close { border-color: #ef4444; background: #ef4444; border-width: 0; color: #fff; font-size: 10px; line-height: 18px; text-align: center; }
.stage-icon-symbol.icon-close::after { content: "\2715"; }
@keyframes icon-spin { to { transform: rotate(360deg); } }

/* ===== Card icon symbols (summary cards) ===== */
.card-icon-symbol { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #9ca3af; margin-right: 6px; flex-shrink: 0; }
.card-icon-symbol.icon-check { border-color: #22c55e; background: #22c55e; border-width: 0; position: relative; }
.card-icon-symbol.icon-check::after { content: ""; position: absolute; width: 4px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); top: 1px; left: 4px; }
.card-icon-symbol.icon-circle { border-color: #9ca3af; background: #f3f4f6; }
.card-icon-symbol.icon-loading { border-color: #3b82f6; border-top-color: transparent; animation: icon-spin 0.8s linear infinite; }
.card-icon-symbol.icon-exclamation { border-color: #ef4444; background: #ef4444; border-width: 0; color: #fff; font-weight: 700; font-size: 9px; line-height: 14px; text-align: center; }
.card-icon-symbol.icon-exclamation::after { content: "!"; }
.card-icon-symbol.icon-document { border-color: #6366f1; border-radius: 3px; }
.card-icon-symbol.icon-clock { border-color: #f59e0b; position: relative; }
.card-icon-symbol.icon-clock::after { content: ""; position: absolute; width: 3px; height: 3px; background: #f59e0b; border-radius: 50%; top: 3px; left: 3px; }
.summary-icon-row { display: flex; align-items: center; margin-bottom: 4px; }

/* ===== Review queue item flash animation ===== */
.review-queue-item-flash {
  animation: review-item-flash 2s ease-out;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}
@keyframes review-item-flash {
  0% { background-color: rgba(59, 130, 246, 0.22); }
  70% { background-color: rgba(59, 130, 246, 0.05); }
  100% { background-color: #fff; }
}

/* ===== Dark theme variants for stage and card icons ===== */
[data-theme="dark"] .stage-icon-symbol.icon-circle { border-color: #6b7280; background: #374151; }
[data-theme="dark"] .stage-icon-symbol.icon-document { border-color: #818cf8; }
[data-theme="dark"] .stage-icon-symbol.icon-clock { border-color: #fbbf24; }
[data-theme="dark"] .stage-icon-symbol.icon-clock::after { background: #fbbf24; }
[data-theme="dark"] .card-icon-symbol.icon-circle { border-color: #6b7280; background: #374151; }
[data-theme="dark"] .card-icon-symbol.icon-document { border-color: #818cf8; }
[data-theme="dark"] .card-icon-symbol.icon-clock { border-color: #fbbf24; }
[data-theme="dark"] .card-icon-symbol.icon-clock::after { background: #fbbf24; }
@keyframes review-item-flash-dark {
  0% { background-color: rgba(96, 165, 250, 0.25); }
  70% { background-color: rgba(96, 165, 250, 0.06); }
  100% { background-color: var(--card-bg); }
}
[data-theme="dark"] .review-queue-item-flash { animation: review-item-flash-dark 2s ease-out; border-color: #60a5fa !important; box-shadow: 0 0 0 3px rgba(96,165,250,0.3); }


/* ===== 基础响应式适配（移动端） ===== */
@media (max-width: 900px) {
  .app-header, .top-bar, .nav-bar { flex-wrap: wrap; gap: 6px; }
  .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab-btn { white-space: nowrap; }
  .admin-payment-config-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .content-area, .main-content { padding: 10px !important; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .grid-3, [style*="grid-template-columns:repeat(3"] { grid-template-columns: 1fr !important; }
  .grid-2, [style*="grid-template-columns:repeat(2"] { grid-template-columns: 1fr !important; }
  .el-dialog { width: 94% !important; margin: 4vh auto !important; }
  .auth-box, .login-box { width: 92% !important; margin: 8vh auto !important; }
  .sidebar { display: none; }
}
.translation-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.translation-history-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.translation-history-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.translation-history-meta,
.translation-history-error {
  color: var(--text-secondary);
  font-size: 12px;
}

.translation-history-error {
  color: #b42318;
  overflow-wrap: anywhere;
}

.translation-history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .translation-history-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .translation-history-actions {
    width: 100%;
    justify-content: space-between;
  }
}
.translation-stale-warning {
  margin: 8px 0 12px;
  padding: 9px 12px;
  border: 1px solid #f0b429;
  border-radius: 6px;
  background: #fff8e6;
  color: #7a5200;
  font-size: 13px;
  line-height: 1.5;
}

.edit-save-status {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 28px;
  white-space: nowrap;
}

.sr-only {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.quality-exception-trail {
  margin-top: 18px;
}

.quality-exception-trail-item {
  border-top: 1px solid var(--border);
  padding: 10px 0;
}

.quality-exception-trail-meta {
  align-items: center;
  color: var(--text-secondary);
  display: flex;
  font-size: 12px;
  gap: 8px;
}

.quality-exception-trail-reason {
  line-height: 1.5;
  margin: 7px 0 2px;
  overflow-wrap: anywhere;
}

.translator-rec-mobile { display: none; }

.admin-users-page { min-width: 0; padding: 16px 20px 28px; }
.admin-users-header,
.admin-users-header-actions,
.admin-users-pagination,
.admin-user-actions,
.admin-activity-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-users-header { justify-content: space-between; margin-bottom: 14px; }
.admin-users-header h1 { margin: 0; font-size: 22px; line-height: 1.3; }
.admin-users-header p { margin: 4px 0 0; color: var(--text-secondary); font-size: 13px; }
.admin-users-filters { display: grid; grid-template-columns: minmax(220px, 1.3fr) minmax(240px, 1.1fr) minmax(220px, 1fr) minmax(235px, 1.1fr) auto; align-items: end; gap: 10px; margin-bottom: 14px; }
.admin-users-filters label,
.admin-user-dialog-form label,
.admin-activity-toolbar label { display: grid; min-width: 0; gap: 5px; color: var(--text-secondary); font-size: 12px; }
.admin-users-filters .native-input,
.admin-user-dialog-form .native-input,
.admin-activity-toolbar .native-input { box-sizing: border-box; width: 100%; min-width: 0; }
.admin-users-filters .lf-seg { display: flex; width: 100%; min-width: 0; overflow-x: auto; }
.admin-users-filters .lf-seg button { flex: 0 0 auto; justify-content: center; padding: 5px 9px; white-space: nowrap; }
.admin-users-filters > .native-btn { width: auto; min-width: 72px; }
.admin-users-list { display: grid; gap: 8px; }
.admin-user-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(110px, .7fr)); gap: 12px; align-items: center; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 6px; }
.admin-user-primary,
.admin-user-metric { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.admin-user-primary strong { font-size: 14px; }
.admin-user-primary span,
.admin-user-metric span { color: var(--text-secondary); font-size: 12px; }
.admin-user-metric strong { font-size: 13px; }
.admin-user-badge { justify-self: start; padding: 2px 6px; border-radius: 4px; background: #e8f1fb; color: #175cd3 !important; }
.admin-user-status-enabled { color: #067647; }
.admin-user-status-disabled { color: #b42318; }
.admin-user-actions { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--border); }
.admin-user-actions .native-btn { width: auto; }
.admin-user-more { position: relative; }
.admin-user-more summary { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 10px; list-style: none; cursor: pointer; }
.admin-user-more summary::-webkit-details-marker { display: none; }
.admin-user-more-menu { position: absolute; z-index: 30; top: calc(100% + 4px); right: 0; display: none; width: min(240px, calc(100vw - 32px)); max-height: min(60vh, 360px); overflow: auto; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); box-shadow: 0 8px 24px rgba(15, 23, 42, .16); }
.admin-user-more[open] .admin-user-more-menu { display: grid; }
.admin-user-more-menu .native-btn { width: 100%; justify-content: flex-start; text-align: left; }
.admin-users-state { padding: 18px 4px; color: var(--text-secondary); text-align: center; }
.admin-users-pagination { justify-content: flex-end; margin-top: 12px; }
.admin-users-pagination span { margin-right: auto; color: var(--text-secondary); font-size: 12px; }
.admin-user-detail-grid { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(0, 1.5fr); gap: 8px 14px; margin: 0; }
.admin-user-detail-grid dt { color: var(--text-secondary); }
.admin-user-detail-grid dd { margin: 0; overflow-wrap: anywhere; }
.admin-user-dialog-form { display: grid; gap: 12px; min-width: 0; }
.admin-activity-toolbar { align-items: end; margin-bottom: 12px; }
.admin-activity-toolbar label { flex: 1 1 180px; }
.admin-activity-list { display: grid; gap: 8px; max-height: 55vh; overflow: auto; }
.admin-activity-row { display: grid; gap: 4px; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 6px; overflow-wrap: anywhere; }
.admin-activity-row span,
.admin-activity-row time,
.admin-activity-row p { color: var(--text-secondary); font-size: 12px; }
.admin-activity-row p { margin: 2px 0 0; }
.admin-activity-total { margin-right: auto; color: var(--text-secondary); font-size: 12px; }

@media (max-width: 1100px) {
  .admin-users-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-users-filters label:first-child { grid-column: 1 / -1; }
  .admin-users-filters > .native-btn { grid-column: 2; justify-self: end; }
}

@media (max-width: 800px) {
  .admin-user-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .admin-users-page { padding: 12px 14px 24px; }
  .admin-users-header { align-items: flex-start; }
  .admin-users-header-actions { justify-content: flex-end; }
  .admin-users-header-actions .native-btn { width: auto; }
  .admin-users-filters { grid-template-columns: minmax(0, 1fr); }
  .admin-users-filters label:first-child { grid-column: auto; }
  .admin-users-filters > .native-btn { grid-column: auto; justify-self: stretch; width: 100%; }
  .admin-user-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 10px; }
  .admin-user-primary { grid-column: 1 / -1; }
  .admin-user-actions .native-btn { flex: 1 1 128px; }
  .admin-users-pagination { justify-content: space-between; }
  .admin-users-pagination span { flex: 1 0 100%; }
  .admin-activity-toolbar > .native-btn { flex: 1 1 100%; }
  .admin-user-detail-grid { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .admin-user-detail-grid dd { margin-bottom: 7px; }
}

@media (max-width: 640px) {
  .translator-rec-desktop { display: none; }
  .translator-rec-mobile { display: block; }
  .translator-rec-item {
    border-top: 1px solid var(--border);
    padding: 12px 0;
  }
  .translator-rec-item-head {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    justify-content: space-between;
    font-size: 13px;
  }
  .translator-rec-item-head span { color: var(--text-secondary); }
  .translator-rec-item-grid {
    display: grid;
    gap: 10px 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
  }
  .translator-rec-item-grid div { min-width: 0; }
  .translator-rec-item-grid span,
  .translator-rec-item-grid strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
  .translator-rec-item-grid span { color: var(--text-secondary); margin-bottom: 2px; }
}

.admin-billing-page { min-width: 0; }
.admin-billing-refresh { width: auto; flex: 0 0 auto; }
.admin-billing-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.admin-billing-tabs button { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; min-height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-secondary); font: inherit; cursor: pointer; }
.admin-billing-tabs button.active { border-bottom-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.admin-billing-tab-count { min-width: 20px; padding: 1px 6px; border-radius: 12px; background: var(--primary-light); color: var(--primary-dark); font-size: 12px; text-align: center; }
.admin-billing-section { min-width: 0; }
.admin-billing-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.admin-billing-section-head h2 { margin: 0; font-size: 17px; line-height: 1.4; }
.admin-billing-section-head p { margin: 4px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.admin-billing-total { flex: 0 0 auto; color: var(--text-secondary); font-size: 13px; }
.admin-billing-filters { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(240px, 2fr); gap: 10px; align-items: end; margin-bottom: 12px; }
.admin-billing-filters label, .admin-billing-pagination label, .admin-payment-upload { display: grid; gap: 5px; min-width: 0; color: var(--text-secondary); font-size: 12px; }
.admin-billing-filters .native-input, .admin-billing-pagination .native-input, .admin-payment-upload .native-input { box-sizing: border-box; width: 100%; min-width: 0; }
.admin-billing-table-wrap { width: 100%; min-width: 0; overflow-x: auto; }
.admin-billing-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.admin-billing-pagination > span { margin-right: auto; color: var(--text-secondary); font-size: 12px; }
.admin-billing-pagination label { display: flex; align-items: center; gap: 8px; }
.admin-billing-pagination label .native-input { width: 82px; }
.admin-payment-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-payment-config { display: grid; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); }
.admin-payment-config-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-payment-config-title h3 { margin: 0; font-size: 15px; }
.admin-payment-qr-frame { display: grid; place-items: center; width: 160px; height: 160px; max-width: 100%; border: 1px dashed var(--border); color: var(--text-secondary); }
.admin-payment-qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.admin-payment-upload .native-input { padding: 6px; }
.admin-billing-warning, .admin-billing-muted { padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; line-height: 1.5; }
.admin-billing-warning { border-color: #e8bf62; background: rgba(245, 158, 11, .1); color: #8a5700; }
.admin-billing-muted { color: var(--text-secondary); }
.admin-billing-report-section { min-width: 0; margin-top: 18px; }
.admin-billing-report-section h3 { margin: 0 0 8px; font-size: 14px; }
.admin-billing-empty-cell { padding: 18px !important; color: var(--text-secondary); text-align: center; }

@media (max-width: 680px) {
  .admin-billing-filters { grid-template-columns: minmax(0, 1fr); }
  .admin-payment-config-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-billing-section-head { flex-direction: column; }
  .admin-billing-pagination { justify-content: space-between; }
  .admin-billing-pagination > span { flex: 1 0 100%; }
  .admin-billing-pagination > .native-btn { flex: 1 1 80px; }
}

[data-theme="dark"] .admin-billing-warning { border-color: #8a6c2e; background: rgba(245, 158, 11, .12); color: #f4d17d; }

.admin-queue-toolbar,
.admin-notification-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 16px; }
.admin-queue-cap { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.admin-queue-search { display: grid; gap: 5px; width: min(100%, 380px); color: var(--text-secondary); font-size: 12px; }
.admin-queue-search .native-input { box-sizing: border-box; width: 100%; min-width: 0; }
.admin-queue-groups { display: grid; gap: 18px; min-width: 0; }
.admin-queue-group { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 6px; }
.admin-queue-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-queue-group-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.admin-queue-group-head p { margin: 4px 0 0; color: var(--text-secondary); font-size: 12px; }
.admin-queue-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 12px; background: var(--lf-surface-2); color: var(--text-secondary); font-size: 12px; }
.admin-queue-oldest { color: var(--text-secondary); font-size: 12px; }
.admin-queue-empty { padding: 16px 10px; color: var(--text-secondary); font-size: 13px; text-align: center; }
.admin-queue-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 12px 0; border-top: 1px solid var(--border); }
.admin-queue-row-main { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.admin-queue-row-title { font-size: 14px; font-weight: 600; }
.admin-queue-row-meta { color: var(--text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.admin-queue-row-note { max-width: 100ch; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-queue-row > .native-btn { flex: 0 0 auto; }
.admin-notification-row { display: grid; gap: 10px; min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 6px; }
.admin-notification-row-head { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; font-size: 13px; }
.admin-notification-row-head > span { color: var(--text-secondary); overflow-wrap: anywhere; }
.admin-notification-id-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.admin-notification-id-row > code { color: var(--text); font: 600 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.admin-notification-id-row .native-btn { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.admin-notification-id-row details { color: var(--text-secondary); font-size: 12px; }
.admin-notification-id-row summary { cursor: pointer; }
.admin-notification-full-id { display: block; max-width: 100%; padding: 6px 0; color: var(--text); overflow-wrap: anywhere; user-select: all; }
.admin-notification-row-meta { color: var(--text-secondary); font-size: 12px; overflow-wrap: anywhere; }
.admin-project-notification-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.admin-project-notification-pagination > span { margin-right: auto; color: var(--text-secondary); }
.admin-project-notification-pagination > .native-btn { width: auto; }

.admin-report-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0 10px; }
.admin-report-kpi { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; color: inherit; text-decoration: none; }
.admin-report-kpi:hover { border-color: var(--primary); background: var(--lf-surface-2); }
.admin-report-kpi:focus-visible,
.admin-report-section-nav a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.admin-report-kpi > span { color: var(--text-secondary); font-size: 12px; }
.admin-report-kpi > strong { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.admin-report-kpi > small { color: var(--text-secondary); font-size: 11px; line-height: 1.4; }
.admin-report-section-nav { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; border-bottom: 1px solid var(--border); }
.admin-report-section-nav a { flex: 0 0 auto; padding: 6px 10px; border-radius: 4px; color: var(--primary-dark); font-size: 12px; text-decoration: none; }
.admin-report-section-nav a:hover { background: var(--lf-surface-2); }
#report-rework, #report-delivery, #report-quotes, #report-projects { scroll-margin-top: 20px; }
.admin-budget-readiness { margin: 12px 0 10px; padding: 14px; border: 1px solid #e2bf72; border-radius: 6px; background: rgba(245, 158, 11, .08); }
.admin-budget-readiness.is-ready { border-color: #8bc8a1; background: rgba(22, 163, 74, .07); }
.admin-budget-readiness.is-checking { border-color: var(--border); background: var(--lf-surface-2); }
.admin-budget-readiness-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-budget-readiness-head h2 { margin: 0; font-size: 15px; }
.admin-budget-readiness-head p { margin: 4px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.admin-budget-readiness-state { flex: 0 0 auto; padding: 3px 8px; border-radius: 4px; background: #fff0c2; color: #825600; font-size: 12px; font-weight: 600; }
.admin-budget-readiness.is-ready .admin-budget-readiness-state { background: #d7f3e1; color: #06633d; }
.admin-budget-readiness-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px 18px; margin-top: 12px; }
.admin-budget-readiness-grid > div { display: grid; align-content: start; gap: 3px; min-width: 0; }
.admin-budget-readiness-grid span,
.admin-budget-readiness-grid small { color: var(--text-secondary); font-size: 11px; line-height: 1.4; }
.admin-budget-readiness-grid strong { font-size: 13px; overflow-wrap: anywhere; }
.admin-budget-readiness-issues { display: grid; gap: 4px; margin: 12px 0 0; padding-left: 18px; color: #825600; font-size: 12px; line-height: 1.45; }
.admin-budget-section-nav { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 14px; padding: 4px 0 8px; border-bottom: 1px solid var(--border); }
.admin-budget-section-nav a { flex: 0 0 auto; padding: 6px 9px; border-radius: 4px; color: var(--primary-dark); font-size: 12px; text-decoration: none; }
.admin-budget-section-nav a:hover,
.admin-budget-section-nav a:focus-visible { background: var(--lf-surface-2); outline-color: var(--primary); }
.admin-budget-scope-note { margin: -2px 0 9px; color: var(--text-secondary); font-size: 12px; }
#admin-qa-recovery-status, #admin-provider-budget-policy, #admin-provider-budget-ledger, #admin-provider-budget-holds { scroll-margin-top: 20px; }

[data-theme="dark"] .admin-budget-readiness { border-color: #8a6c2e; background: rgba(245, 158, 11, .1); }
[data-theme="dark"] .admin-budget-readiness.is-ready { border-color: #286a46; background: rgba(22, 163, 74, .1); }
[data-theme="dark"] .admin-budget-readiness.is-checking { border-color: var(--border); background: var(--lf-surface-2); }
[data-theme="dark"] .admin-budget-readiness-state { background: #594313; color: #f4d17d; }
[data-theme="dark"] .admin-budget-readiness.is-ready .admin-budget-readiness-state { background: #174b31; color: #9be0b5; }
[data-theme="dark"] .admin-budget-readiness-issues { color: #f4d17d; }

@media (max-width: 560px) {
  .admin-queue-toolbar,
  .admin-notification-toolbar { align-items: stretch; }
  .admin-budget-section-nav { flex-wrap: wrap; overflow-x: visible; }
  .admin-queue-search { width: 100%; }
  .admin-queue-group { padding: 10px; }
  .admin-queue-row { align-items: flex-start; flex-direction: column; }
  .admin-queue-row > .native-btn { width: 100% !important; }
  .admin-project-notification-pagination { justify-content: space-between; }
  .admin-project-notification-pagination > span { flex: 1 0 100%; }
  .admin-project-notification-pagination > .native-btn { flex: 1 1 100px; }
}

@media (max-width: 680px) {
  .admin-report-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-report-kpi { padding: 9px; }
  .admin-report-kpi > strong { font-size: 18px; }
}
