> ## Documentation Index
> Fetch the complete documentation index at: https://ophel.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 站点专属设置 — 模型锁定、Markdown 修复与 Claude

> 按站点独立配置模型锁定、Markdown 渲染修复、Gemini 去水印、Claude Session Key 管理与使用量监控。

export const ShortcutLegend = ({lang = "en"}) => {
  const isZh = lang === "zh";
  return <div className="ophel-shortcut-legend" role="note">
      <div className="ophel-shortcut-legend-title">
        {isZh ? "跨平台按键说明" : "Cross-platform key mapping"}
      </div>
      <div className="ophel-shortcut-legend-body">
        {isZh ? <>
            文档中的快捷键会同时显示 Windows/Linux 与 Mac 写法：
            <code>Ctrl</code> 对应 <code>Command</code>，
            <code>Alt</code> 对应 <code>Option</code>。唯一例外是提示词发送，
            <code>Ctrl+Enter</code> 在 Mac 上也使用 <code>Ctrl+Enter</code>。
          </> : <>
            Shortcuts show both Windows/Linux and Mac keys: <code>Ctrl</code> maps
            to <code>Command</code>, and <code>Alt</code> maps to
            <code>Option</code>. Prompt submit is the only exception:
            <code>Ctrl+Enter</code> remains <code>Ctrl+Enter</code> on Mac.
          </>}
      </div>
    </div>;
};

export const Shortcut = ({combo, mac, sameOnMac = false}) => {
  const keyLabels = {
    arrowup: {
      win: "Up",
      mac: "↑"
    },
    arrowdown: {
      win: "Down",
      mac: "↓"
    },
    arrowleft: {
      win: "Left",
      mac: "←"
    },
    arrowright: {
      win: "Right",
      mac: "→"
    },
    up: {
      win: "Up",
      mac: "↑"
    },
    down: {
      win: "Down",
      mac: "↓"
    },
    left: {
      win: "Left",
      mac: "←"
    },
    right: {
      win: "Right",
      mac: "→"
    },
    esc: {
      win: "Esc",
      mac: "Esc"
    },
    escape: {
      win: "Esc",
      mac: "Esc"
    },
    enter: {
      win: "Enter",
      mac: "Enter"
    },
    shift: {
      win: "Shift",
      mac: "⇧"
    },
    backslash: {
      win: "\\",
      mac: "\\"
    }
  };
  const modifierLabels = {
    ctrl: {
      win: "Ctrl",
      mac: "⌘"
    },
    control: {
      win: "Ctrl",
      mac: "⌘"
    },
    cmd: {
      win: "Ctrl",
      mac: "⌘"
    },
    command: {
      win: "Ctrl",
      mac: "⌘"
    },
    alt: {
      win: "Alt",
      mac: "⌥"
    },
    option: {
      win: "Alt",
      mac: "⌥"
    },
    shift: {
      win: "Shift",
      mac: "⇧"
    }
  };
  const normalizeToken = token => String(token || "").trim();
  const formatKey = (token, platform) => {
    const normalized = normalizeToken(token);
    const key = normalized.toLowerCase();
    const mapped = keyLabels[key];
    if (mapped) return mapped[platform];
    if (normalized.length === 1) return normalized.toUpperCase();
    return normalized;
  };
  const formatCombo = (value, platform) => String(value || "").split("+").map(normalizeToken).filter(Boolean).map(token => {
    const mapped = modifierLabels[token.toLowerCase()];
    return mapped ? mapped[platform] : formatKey(token, platform);
  }).join(platform === "mac" ? "" : "+");
  const windowsLabel = formatCombo(combo, "win");
  const macLabel = sameOnMac ? windowsLabel : mac || formatCombo(combo, "mac");
  const title = windowsLabel === macLabel ? windowsLabel : `Windows/Linux: ${windowsLabel}; Mac: ${macLabel}`;
  return <span className="ophel-shortcut" title={title}>
      <code>{windowsLabel}</code>
      {windowsLabel !== macLabel && <>
          <span className="ophel-shortcut-separator"> / </span>
          <code>{macLabel}</code>
        </>}
    </span>;
};

export const Icon = ({src, alt}) => <img src={typeof window !== "undefined" && typeof src === "string" && src.startsWith("/images/icons/") && (window.location.pathname === "/docs" || window.location.pathname.startsWith("/docs/")) ? `/docs${src}` : src} alt={alt} width="18" height="18" style={{
  display: "inline-block",
  verticalAlign: "-0.2em",
  margin: "0 0.15em"
}} />;

各 AI 平台在页面结构、行为和账号模型上各有差异。Ophel 支持为每个站点独立配置，而不是强制使用统一的全局设置。进入 **设置 → 站点设置**，从左侧边栏选择站点即可查看其专属选项。

## 模型锁定

模型锁定解决了一个常见烦恼：每次打开 AI 平台都要手动切换回自己常用的模型。配置后，Ophel 在页面加载完成后自动检测模型选择器并切换到目标模型。如果目标模型在你的账号中不可用，Ophel 保持当前选择不变。

**配置模型锁定：**

1. 打开 **设置 → 站点设置**
2. 选择要配置的站点
3. 找到 **模型锁定** 部分，开启开关
4. 输入目标模型名称中的关键词（不区分大小写）

<Tip>
  只需输入模型名称的一部分。例如输入 `flash` 可匹配 `Gemini 2.0 Flash`。若有多个模型匹配，则选择第一个。
</Tip>

每个站点的模型锁定配置相互独立，可以为不同平台设置不同的目标模型。也可以从 <Icon src="/docs/images/icons/tools.svg" alt="工具箱图标" /> **工具箱** → <Icon src="/docs/images/icons/model-lock.svg" alt="模型锁定图标" /> **模型锁定** 快速切换当前站点的模型锁定状态。

<Note>
  如果你在会话中手动切换到其他模型，模型锁定只在下次页面加载时重新生效，不会覆盖本次会话中的手动选择。
</Note>

**支持的站点：**

| 站点                | URL                                       |
| ----------------- | ----------------------------------------- |
| Gemini            | gemini.google.com                         |
| Gemini Enterprise | 企业账号                                      |
| AI Studio         | aistudio.google.com                       |
| ChatGPT           | chatgpt.com                               |
| Claude            | claude.ai                                 |
| Grok              | grok.com                                  |
| 通义千问              | [www.qianwen.com](http://www.qianwen.com) |
| Qwen Studio       | chat.qwen.ai                              |
| 元宝                | yuanbao.tencent.com                       |
| ima               | ima.qq.com                                |
| Z.ai              | chat.z.ai                                 |

## Markdown 渲染修复

部分 AI 平台存在偶发的 Markdown 渲染异常——加粗文字无法正常显示是最常见的例子。Ophel 提供了针对各平台的独立开关来修复这些问题，不影响其他平台。

| 站点        | 设置项                                 | 默认 |
| --------- | ----------------------------------- | -- |
| Gemini    | Markdown 修复 — 修复加粗文字偶发渲染失败          | 开启 |
| AI Studio | Markdown 修复 — 修复 AI Studio 加粗文字渲染失败 | 关闭 |
| ChatGPT   | Markdown 修复 — 修复加粗文字偶发渲染失败          | 关闭 |

只在实际遇到渲染问题时才开启对应修复——在问题较少见的平台上默认为关闭。

## Gemini 去水印

导出或截图 Gemini 对话时，Gemini 会自动附加"由 Gemini 创作"水印。Ophel 可以自动去除这个水印。

**设置 → 站点设置 → Gemini → 去水印**

<Note>
  去水印功能需要 `<all_urls>` 主机权限，首次启用时 Ophel 会请求你授予。此权限用于拦截并修改导出请求，防止水印被附加。该设置默认关闭。
</Note>

同样的去水印选项也可在 AI Studio 中找到：**设置 → 站点设置 → AI Studio → 去水印**。

## Gemini 额外设置

**设置 → 站点设置 → Gemini**：

| 设置项    | 说明                              | 默认 |
| ------ | ------------------------------- | -- |
| 主题跟随页面 | 自动将 Ophel 面板主题与 Gemini 的亮色/暗色同步 | 开启 |

**仅 Gemini Enterprise**：

| 设置项    | 说明                         | 默认 |
| ------ | -------------------------- | -- |
| 策略重试   | 自动重试被企业内容策略拦截的请求（适合策略误报场景） | 关闭 |
| 最大重试次数 | 开启策略重试后的最大连续重试次数           | 3  |

## AI Studio 设置

**设置 → 站点设置 → AI Studio** 提供各区域初始折叠状态控制，省去每次打开时手动整理的麻烦：

| 设置项      | 说明                               | 默认  |
| -------- | -------------------------------- | --- |
| 折叠左侧导航栏  | 加载时自动收起左侧项目导航栏                   | 关闭  |
| 折叠运行设置面板 | 自动折叠右侧整个运行设置区                    | 关闭  |
| 折叠工具面板   | 自动折叠运行设置中的"工具"子区域                | 关闭  |
| 折叠高级选项   | 自动折叠"高级设置"子区域                    | 关闭  |
| 默认开启搜索工具 | 进入 Prompt/Free 模式时自动勾选 Google 搜索 | 开启  |
| 默认模型     | 打开 AI Studio 时自动切换到的目标模型 ID      | （空） |

<Note>
  AI Studio 的**默认模型**设置与通用的**模型锁定**功能并存。AI Studio 的默认模型在此处配置，而不在模型锁定页面。
</Note>

## Claude Session Key 管理

Claude 账号有每日使用限额。当一个账号达到上限时，通常需要等待重置。如果你有多个 Claude 账号，Ophel 可以保存所有账号的 Session Key，随时切换，无需退出登录——让对话不间断地继续。

Session Key（格式为 `sk-ant-sid...`）是浏览器在 claude.ai 上使用的认证令牌。Ophel 将指定的 Key 注入请求，实现无需完整登出周期的账号切换。Key 存储在浏览器本地，不会发送给 Ophel 服务器。

**添加 Session Key** — 进入 **设置 → 站点设置 → Claude**：

<Tabs>
  <Tab title="自动导入（推荐）">
    点击**导入当前会话**。Ophel 直接从浏览器 Cookie 中读取当前已登录的 Claude 账号的 Session Key，无需手动复制。

    <Note>
      自动导入需要 claude.ai 的 Cookie 访问权限，Ophel 会在需要时提示你授予。
    </Note>
  </Tab>

  <Tab title="手动添加">
    点击添加按钮，粘贴 `sk-ant-sid...` 格式的 Session Key。可以为每个 Key 添加标签以区分账号。
  </Tab>
</Tabs>

**切换账号：**

<Tabs>
  <Tab title="设置页">
    进入 <Icon src="/docs/images/icons/settings.svg" alt="设置图标" /> **设置 → 站点设置 → Claude**，在当前 Session Key 选择器中选择目标 Key，或点击某个 Key 行上的**设为当前**。
  </Tab>

  <Tab title="键盘快捷键">
    按 <Icon src="/docs/images/icons/keyboard.svg" alt="快捷键图标" /> <Shortcut combo="ctrl+alt+s" /> 切换到列表中的下一个 Key。
  </Tab>
</Tabs>

切换后，Ophel 会刷新当前 Claude 页面以应用新 Key。

**管理 Key 列表：**

| 操作                                                              | 说明                                                                               |
| --------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| <Icon src="/docs/images/icons/check.svg" alt="设为当前图标" /> 设为当前        | 将指定 Key 设为当前激活账号                                                                 |
| <Icon src="/docs/images/icons/shield-check.svg" alt="测试单个图标" /> 测试单个 | 发送一个轻量级请求，验证该 Key 是否有效且未达到限额                                                     |
| <Icon src="/docs/images/icons/sync.svg" alt="测试全部图标" /> 测试全部         | 依次验证所有 Key，每次间隔 500ms 以避免触发限速                                                    |
| <Icon src="/docs/images/icons/export.svg" alt="导出 Key 图标" /> 导出      | 将所有 Key 导出为 <Icon src="/docs/images/icons/json-file.svg" alt="JSON 文件图标" /> JSON 文件备份 |
| <Icon src="/docs/images/icons/import.svg" alt="导入 Key 图标" /> 导入      | 从 <Icon src="/docs/images/icons/json-file.svg" alt="JSON 文件图标" /> JSON 文件恢复 Key 列表    |
| <Icon src="/docs/images/icons/delete.svg" alt="删除 Key 图标" /> 删除      | 删除单条记录，不影响 Claude 账号本身                                                           |

<Warning>
  导出的 JSON 文件包含完整的 Session Key。持有该文件的任何人都可以使用你的账号额度。共享 WebDAV 备份或本地文件时请注意保密。
</Warning>

## 使用量监控

对于有每日用量限制的 AI 服务，Ophel 提供一个本地计数器，显示今日已使用的对话轮次和大致消耗的 Token 数。

使用量监控完全在本地运行——不调用任何外部 API，也不依赖平台提供的使用数据。Ophel 通过观察页面上的消息来计算轮次并估算 Token。

**设置 → 功能 → 使用量监控**：

| 设置项  | 说明                 | 默认  |
| ---- | ------------------ | --- |
| 启用   | 在输入框附近显示使用量监控组件    | 关闭  |
| 每日限额 | 预期的每日使用上限（用于进度条显示） | 100 |
| 自动重置 | 每日午夜自动归零           | 关闭  |

启用后，组件将显示：

* 今日对话轮次
* 估算输入 Token 数
* 估算输出 Token 数
* 已用/每日限额的进度条

<Note>
  Token 估算基于字符数统计，可能与平台实际计费有所差异。仅供参考，不代表精确值。
</Note>
