
      /* ── 证券代码格式说明（常驻，非 tooltip） ── */
      .ticker-format-help {
        margin: 14px 0 4px; padding: 14px 16px;
        border: 1px solid var(--hairline, #2a2f3a); border-radius: 12px;
        background: var(--panel-2, #161a22); font-size: 13px; line-height: 1.7;
      }
      .tfh-title { font-weight: 700; color: var(--ink, #e8edf6); margin-bottom: 6px; }
      .tfh-body { margin: 0 0 8px; color: var(--ink-2, #aeb6c4); }
      .tfh-body strong { color: var(--warn-amber, #e0b25a); }
      .tfh-examples { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 8px; padding: 0; }
      .tfh-examples li { display: flex; align-items: center; gap: 6px; color: var(--ink-2, #aeb6c4); }
      .tfh-tag { font-size: 11px; color: var(--ink-3, #6b7488); }
      .tfh-examples code, .tfh-note code { background: var(--panel, #0f131b); padding: 1px 6px; border-radius: 5px; color: var(--ink, #e8edf6); }
      .tfh-note { margin: 0; color: var(--ink-3, #6b7488); font-size: 12px; }

      /* ── 总市值卡片子标题 / 状态（K1D：独立状态行，置于摘要卡片之后整行；不再作为卡片插入卡片区） ── */
      .sum-note { display: block; width: 100%; min-height: 0; font-size: 12px; line-height: 1.6;
        color: var(--warn-amber, #e0b25a); overflow-wrap: anywhere; word-break: break-word; }
      .sum-note:empty { display: none; }

      /* ── 逐行证券身份（内联于输入行下方，不再单列「证券身份核对」总结区）──
         三通道：颜色 + 图标 + 文字 + role=alert + aria；移动端 flex-wrap 自动换行。 */
      .row-validation { display: flex; flex-direction: column; gap: 2px; }
      .rv-identity { font-size: 12px; color: var(--ink-2, #aeb6c4);
        overflow-wrap: anywhere; word-break: break-word; }
      tr.row-error .rv-identity { color: #e3a596; }
      .rv-sep { color: var(--ink-3, #6b7488); margin: 0 4px; }
      .rv-msg { font-size: 12px; color: var(--ink-2, #aeb6c4);
        overflow-wrap: anywhere; word-break: break-word; }
      tr.row-warning .rv-msg { color: #d8b15a; }
      tr.row-error .rv-msg { color: #e3a596; }
      .rv-adopt { align-self: flex-start; flex: 0 0 auto; margin-top: 4px;
        background: var(--panel, #0f131b); color: var(--ink, #e8edf6);
        border: 1px solid var(--hairline-strong, #3a4150); border-radius: 8px;
        padding: 5px 10px; cursor: pointer; font-size: 12px; }
      /* 价格新鲜度说明：全站统一口径「最新可用价格」，收盘时段说「最近收盘价」，
         永远不写「实时价格」——我们拿到的从来不是逐笔实时行情。 */
      .rv-fresh { font-size: 11px; color: var(--ink-3, #6b7488);
        overflow-wrap: anywhere; word-break: break-word; }
      tr.row-warning .rv-fresh { color: #d8b15a; }
      /* 逐行恢复操作：重试 / 修改代码 / Yahoo 搜索 / 删除该资产 */
      .rv-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
      .rv-act { flex: 0 0 auto; background: var(--panel, #0f131b); color: var(--ink, #e8edf6);
        border: 1px solid var(--hairline-strong, #3a4150); border-radius: 8px;
        padding: 4px 9px; cursor: pointer; font-size: 12px; line-height: 1.3; }
      .rv-act:hover { border-color: var(--ink-3, #6b7488); }
      .rv-act-danger { color: #e3a596; }

      /* ── 阶段 J2：真实持仓行紧凑成功反馈 ──
         ticker 输入 + 右侧固定宽度指示区（✓），预留宽度避免布局跳动；
         成功不常驻展示名称/币种/价格等大块内容。 */
      .inp-ticker-slot { display: flex; align-items: center; gap: 6px; position: relative; }
      .inp-ticker-slot .inp-ticker { flex: 1 1 auto; min-width: 0; width: auto; }
      .row-ok-indicator {
        flex: 0 0 16px; width: 16px; height: 16px;
        display: flex; align-items: center; justify-content: center;
        font-size: 13px; line-height: 1; color: #5fae7e;
      }
      .row-ok-indicator::before { content: ''; }
      tr.row-valid .row-ok-indicator::before { content: '✓'; }
      .row-ok-label {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
      }
      /* 「查看身份」inline disclosure：默认折叠，键盘可开合，不依赖 hover */
      .rv-detail-toggle {
        align-self: flex-start; background: none; border: none; padding: 2px 0;
        color: var(--ink-3, #6b7488); font-size: 11.5px; cursor: pointer;
        font-family: inherit; letter-spacing: 0.02em;
      }
      .rv-detail-toggle:hover { color: var(--gold-hi); }
      .rv-detail-toggle:focus-visible { outline: 2px solid var(--gold, #c8a25e); outline-offset: 2px; }
      .rv-detail {
        font-size: 11.5px; color: var(--ink-3, #6b7488); line-height: 1.5;
        overflow-wrap: anywhere; word-break: break-word;
      }
      .rv-detail[hidden] { display: none; }
      .rv-msg-warn { color: #d8b15a; }

      .identity-error-banner { margin-top: 12px; padding: 10px 14px; border-radius: 10px;
        border: 1px solid #d9806f; background: rgba(217,128,111,0.10); color: #e3a596; font-size: 13px; }
      .identity-error-banner[hidden] { display: none; }
      .identity-legacy-warn { margin-top: 10px; padding: 8px 12px; border-radius: 8px;
        border: 1px dashed var(--hairline-strong, #3a4150); color: var(--warn-amber, #e0b25a); font-size: 12px; }
      .identity-legacy-warn[hidden] { display: none; }

      /* ── 输入行高亮（不只靠颜色） ── */
      tr.row-valid .inp-ticker { border-color: #5fae7e; }
      tr.row-warning .inp-ticker { border-color: #d8b15a; }
      tr.row-error .inp-ticker { border-color: #d9806f; }
      .row-validation { font-size: 11px; color: var(--ink-3, #6b7488); margin-top: 3px;
        overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
      tr.row-warning .row-validation { color: #d8b15a; }
      tr.row-error .row-validation { color: #e3a596; }

      @media (max-width: 768px) {
        .ticker-format-help { font-size: 12px; }
        .tfh-examples { gap: 6px 12px; }
        .rv-identity { max-width: 92vw; }
        .rv-adopt { flex: 0 0 auto; }
        .rv-actions { max-width: 92vw; }
        .row-validation { max-width: 92vw; }
      }
    
    .opt-settings .mv-settings-body { padding: 2px 0 0; }
    .opt-settings .mv-row { display: flex; align-items: center; justify-content: space-between;
      gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--hairline); }
    .opt-settings .mv-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
    .opt-settings .mv-row-label { font-size: 13.5px; color: var(--ink); }
    .opt-settings .mv-scope { font-size: 11.5px; line-height: 1.55; color: var(--ink-3); }
    .opt-settings .mv-num { width: 84px; flex: none; padding: 6px 8px; border-radius: 7px;
      border: 1px solid var(--hairline-strong); background: var(--panel-2); color: var(--ink);
      font-size: 14px; text-align: right; font-family: inherit; }
    .opt-settings .mv-num:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,162,94,0.14); }
    .opt-settings input[type=checkbox] { width: 17px; height: 17px; flex: none; accent-color: var(--gold); }
    /* 游客只读外观：轻微降饱和，绝不整块降透明度 */
    .opt-settings [aria-disabled="true"] { cursor: pointer; border-style: dashed; }

    /* ── 收益调整折叠区 ──
       折叠标题统一复用全局 .mv-collapse-head / .mv-caret / .mv-collapse-title / .mv-collapse-count
       （定义于 app.css，与「本次优化标的 / 个股篮子 / 经典 MV 设置与诊断 / 计算底稿」一致）。 */
    .opt-settings .mv-override-list { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px;
      max-height: 260px; overflow-y: auto; }
    /* ── ① 按标的收益调整三列表：资产 / 历史数据 / 调整后数据 ──
       历史数据为只读展示（后端 system_expected_returns）；调整后数据为可编辑输入，
       留空即采用历史数据（占位符视觉显示历史值，但不写入 override）。 */
    .opt-settings table.mv-ov-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
    .opt-settings table.mv-ov-table th, .opt-settings table.mv-ov-table td {
      padding: 4px 8px; border-bottom: 1px solid var(--hairline); font-variant-numeric: tabular-nums; }
    .opt-settings table.mv-ov-table th { color: var(--ink-3); font-weight: 500; text-align: right; }
    .opt-settings table.mv-ov-table th:first-child,
    .opt-settings table.mv-ov-table td.mv-ov-ticker { text-align: left; color: var(--ink-2); font-weight: 600; }
    .opt-settings table.mv-ov-table td.mv-ov-ticker { max-width: 150px; overflow: hidden;
      text-overflow: ellipsis; white-space: nowrap; }
    .opt-settings table.mv-ov-table td.mv-ov-base { text-align: right; color: var(--ink-2); }
    .opt-settings table.mv-ov-table td.mv-ov-cell { text-align: right; white-space: nowrap; }
    .opt-settings .mv-ov-reset { margin-left: 6px; padding: 2px 6px; border-radius: 6px; cursor: pointer;
      border: 1px solid var(--hairline-strong); background: none; color: var(--ink-3);
      font-family: inherit; font-size: 11px; }
    .opt-settings .mv-ov-reset:hover { color: var(--gold-hi); border-color: var(--gold); }
    .opt-settings .mv-ov-reset[hidden] { display: none; }
    .opt-settings .mv-ov-input { min-width: 0; max-width: 130px; padding: 5px 8px; border-radius: 7px;
      border: 1px solid var(--hairline-strong); background: var(--panel-2); color: var(--ink);
      font-size: 13px; text-align: right; font-family: inherit; }
    .opt-settings .mv-ov-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,162,94,0.14); }
    .opt-settings .mv-ov-input::placeholder { color: var(--ink-3); }
    .opt-settings .mv-override-note { font-size: 11.5px; line-height: 1.6; color: var(--ink-3); margin-top: 8px; }
    .opt-settings .mv-override-warn { font-size: 11.5px; line-height: 1.6; color: #dfa096; margin-top: 8px; }
    .opt-settings .mv-status { font-size: 12.5px; margin-top: 10px; }
    /* L2.3：空保存状态不占高度（无 min-height / 不撑高父容器 / 不单独成行） */
    .opt-settings .mv-status:empty { display: none; }
    .opt-settings .mv-status.saving { color: #8fb4e0; }
    .opt-settings .mv-status.saved { color: #a9c48e; }
    .opt-settings .mv-status.failed { color: #dfa096; font-weight: 600; }

    /* ── ① 经典 MV 诊断区 ── */
    .opt-settings .mv-diagnostics { margin-top: 12px; padding: 10px 12px; border-radius: 9px;
      background: rgba(236,233,226,0.035); border: 1px solid var(--hairline);
      font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
    .opt-settings .mv-diagnostics[hidden] { display: none; }
    .opt-settings .mv-diagnostics h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
    .opt-settings .mv-diag-status { font-weight: 700; padding: 2px 8px; border-radius: 6px; display: inline-block; font-size: 12px; }
    .opt-settings .mv-diag-status.ok { background: rgba(123,160,91,0.16); color: #a9c48e; }
    .opt-settings .mv-diag-status.warn { background: rgba(201,151,79,0.16); color: #dcbc7f; }
    .opt-settings .mv-diag-status.bad { background: rgba(196,117,106,0.16); color: #dfa096; }
    .opt-settings .mv-diag-grid { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 0; }
    .opt-settings .mv-diag-grid dt { color: var(--ink-3); }
    .opt-settings .mv-diag-grid dd { margin: 0; color: var(--ink-2); font-variant-numeric: tabular-nums;
      overflow-wrap: anywhere; }
    .opt-settings .mv-diag-msg { margin: 8px 0 0; padding: 8px 10px; border-radius: 7px;
      background: rgba(201,151,79,0.12); color: #dcbc7f; }
    /* 诊断区旧的每资产收益四列表（含来源列）已退役：收益明细统一由
       ①「按标的调整预期收益」的 .mv-ov-table 三列表承担，诊断区只保留一行计数摘要。 */

    /* ── ② 因子 MV 预期收益四列表 ──
       因子 / 构造 / 历史年化因子收益 / 调整后数据。历史年化因子收益为只读展示，与后端
       factor_expected_returns_diagnostics 的 baseline 同源；调整后数据为可编辑输入
       （留空即视觉沿用历史数据，不写入 override）。构造列展示 ETF 代理公式；
       窄屏时该列隐藏、改为因子名下方的小字，不造成整页横向滚动。 */
    .opt-settings table.factor-diag-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
    .opt-settings table.factor-diag-table th, .opt-settings table.factor-diag-table td {
      padding: 4px 8px; border-bottom: 1px solid var(--hairline); font-variant-numeric: tabular-nums; }
    .opt-settings table.factor-diag-table th { color: var(--ink-3); font-weight: 500; text-align: right; }
    .opt-settings table.factor-diag-table th:first-child,
    .opt-settings table.factor-diag-table td.fdiag-factor { text-align: left; color: var(--ink-2); font-weight: 600; }
    .opt-settings table.factor-diag-table td.fdiag-construction { text-align: left; color: var(--ink-3);
      white-space: nowrap; font-variant-numeric: tabular-nums; }
    .opt-settings table.factor-diag-table td.fdiag-base { text-align: right; color: var(--ink-2); white-space: nowrap; }
    .opt-settings table.factor-diag-table td.fdiag-input { text-align: right; white-space: nowrap; }
    .opt-settings table.factor-diag-table td.fdiag-input .mv-ov-input { max-width: 96px; }
    /* 构造公式在桌面端单列展示，窄屏折叠到因子名下方的小字 */
    .opt-settings table.factor-diag-table td.fdiag-construct-sub { display: none; }
  @media (max-width: 560px) {
    .opt-settings table.factor-diag-table th:nth-child(2),
    .opt-settings table.factor-diag-table td.fdiag-construction { display: none; }
    .opt-settings table.factor-diag-table td.fdiag-construct-sub { display: block;
      font-size: 10.5px; line-height: 1.3; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
    .opt-settings table.factor-diag-table th:nth-child(3) { text-align: right; }
  }
    /* ② 因子构造（始终可见轻量说明区：桌面 2/4 列紧凑、移动自适应，无整页横向滚动） */
    .opt-settings .mv-factor-constructs { margin-top: 12px; padding: 10px 12px; border-radius: 9px;
      background: rgba(236,233,226,0.03); border: 1px solid var(--hairline); }
    .opt-settings .mv-construct-title { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
    .opt-settings .mv-construct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 3px 18px; margin: 0; padding: 0; list-style: none; }
    .opt-settings .mv-construct-grid li { font-size: 11.5px; line-height: 1.5; color: var(--ink-2); }
    .opt-settings .mv-construct-grid li b { color: var(--ink); font-weight: 600; }
    .opt-settings .mv-construct-note { margin: 8px 0 0; font-size: 11px; line-height: 1.6; color: var(--ink-3); }
    /* ② 因子历史数据局限说明（可见但不抢主视觉） */
    .opt-settings .mv-data-note { margin: 8px 0 4px; padding: 8px 10px; border-radius: 8px;
      background: rgba(236,233,226,0.04); border: 1px solid var(--hairline); }
    .opt-settings .mv-data-note p { margin: 0 0 6px; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }
    .opt-settings .mv-data-note p:last-child { margin-bottom: 0; }
    /* ② 因子构造与论文对比帮助区 */
    .opt-settings .mv-help-strong { margin: 10px 0 4px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
    .opt-settings .mv-help-list { margin: 0; padding-left: 18px; }
    .opt-settings .mv-help-list li { font-size: 11.5px; line-height: 1.6; color: var(--ink-2); margin-bottom: 3px; }
    .opt-settings .mv-help-warn { margin: 8px 0 0; font-size: 11.5px; line-height: 1.6; color: #dcbc7f;
      padding: 6px 10px; border-radius: 7px; background: rgba(201,151,79,0.1); }
    /* ── 因子诊断状态区：来源(old/fresh) / 本次不可用 / 待重算 三维度各一枚 chip，可同时出现 ── */
    .opt-settings .mv-diag-status-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
    .opt-settings .mv-diag-chip { font-weight: 700; padding: 2px 8px; border-radius: 6px;
      display: inline-block; font-size: 12px; background: rgba(255,255,255,0.05); color: var(--ink-3); }
    .opt-settings .mv-diag-chip.mv-diag-fresh { background: rgba(123,160,91,0.16); color: #a9c48e; }
    .opt-settings .mv-diag-chip.mv-diag-ok { background: rgba(255,255,255,0.05); color: var(--ink-3); font-weight: 500; }
    .opt-settings .mv-diag-chip.mv-diag-old { background: rgba(111,151,196,0.16); color: #9fb6d6; font-weight: 500; }
    .opt-settings .mv-diag-chip.mv-diag-unavailable { background: rgba(201,151,79,0.18); color: #dcbc7f; }
    .opt-settings .mv-diag-chip.mv-diag-pending { background: rgba(201,151,79,0.12); color: #d8bd93; font-weight: 500; }
    .opt-settings .mv-diag-chip.mv-diag-stale-pool { background: rgba(196,117,106,0.18); color: #e0a89f; font-weight: 600; }
    /* 旧货币口径提示：与旧因子池提示同级同权重，但配色区分，避免两枚 chip 并列时被误读成一句话 */
    .opt-settings .mv-diag-chip.mv-diag-stale-currency { background: rgba(158,124,196,0.18); color: #c3aade; font-weight: 600; }
    /* 全局约束区：计算说明卡内的轻量只读区（非独立大型第 6 优化器卡） */
    .opt-settings#globalConstraint { margin-top: 14px; border-top: 1px solid rgba(200,162,94,0.18);
      border-radius: 10px; background: rgba(200,162,94,0.05); }
    .opt-settings#globalConstraint .opt-settings-guest { color: var(--ink-3); }
    .mv-global-cap-hint { margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
    .mv-global-cap-hint::before { content: "\2192\00a0"; color: var(--gold); }
    .mv-global-cap-exempt { margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--ink-3);
      padding: 6px 10px; border-radius: 7px; background: rgba(200,162,94,0.06); }

    /* ── 当前设置 vs 上一次成功结果 对比块 ── */
    .opt-settings .mv-compare { margin-top: 12px; padding: 10px 12px; border-radius: 9px;
      background: rgba(111,151,196,0.06); border: 1px solid rgba(111,151,196,0.22);
      font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
    .opt-settings .mv-compare[hidden] { display: none; }
    .opt-settings .mv-compare h5 { margin: 8px 0 4px; font-size: 12px; font-weight: 700; color: var(--ink); }
    .opt-settings .mv-compare h5:first-child { margin-top: 0; }
    .opt-settings .mv-compare-grid { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 4px 0; }
    .opt-settings .mv-compare-grid dt { color: var(--ink-3); }
    .opt-settings .mv-compare-grid dd { margin: 0; font-variant-numeric: tabular-nums; }
    .opt-settings .mv-compare-banner { margin: 0 0 8px; padding: 8px 10px; border-radius: 7px;
      background: rgba(201,151,79,0.14); color: #dcbc7f; font-weight: 600; }
    .opt-settings .mv-compare-fail { margin: 0 0 8px; padding: 8px 10px; border-radius: 7px;
      background: rgba(196,117,106,0.14); color: #dfa096; font-weight: 600; }

    @media (max-width: 768px) {
      .opt-settings { padding: 12px 14px 14px; }
      .opt-settings .mv-row { align-items: flex-start; gap: 10px; }
      .opt-settings table.mv-ov-table td.mv-ov-ticker { max-width: 92px; }
      .opt-settings table.mv-ov-table th, .opt-settings table.mv-ov-table td { padding: 4px 4px; }
      .opt-settings .mv-ov-input { max-width: none; }
      .opt-settings .mv-override-list { max-height: none; }
    }
  