    /* ====== CONTEXT MENU ====== */
    .context-menu {
      position: fixed; background: white; border-radius: 12px;
      box-shadow: 0 4px 24px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.05);
      padding: 6px; min-width: 160px; z-index: 1000;
      opacity: 0; pointer-events: none; transform: scale(0.9) translateY(-4px);
      transition: opacity 0.15s, transform 0.15s;
    }
    .context-menu.show { opacity: 1; pointer-events: auto; transform: scale(1) translateY(0); }
    .context-menu-item {
      display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
      cursor: pointer; font-size: 13px; color: var(--on-surface); transition: background 0.1s;
      border: none; background: none; width: 100%; text-align: left; font-family: inherit;
    }
    .context-menu-item:hover { background: var(--hover-bg); }
    .context-menu-item.danger { color: var(--error); }
    .context-menu-item.danger:hover { background: #fef2f2; }

    /* @component ExamDropdown — 考试切换一级菜单
       @state show/hide (opacity + transform 动画)
       @gotcha 必须用 position:fixed，否则被 Sidebar 的 overflow:hidden 裁剪
       @interaction 悬停一级项 → 右侧弹出二级面板，离开后300ms延迟隐藏
    */
    .exam-dropdown {
      position: fixed; background: white; border-radius: 12px;
      box-shadow: 0 4px 24px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.05);
      padding: 6px; min-width: 200px; max-height: 370px; overflow-y: auto; z-index: 1000;
      opacity: 0; pointer-events: none; transform: scale(0.9) translateY(-4px);
      transition: opacity 0.15s, transform 0.15s;
    }
    .exam-dropdown.show { opacity: 1; pointer-events: auto; transform: scale(1) translateY(0); }

    .exam-cat-item {
      display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
      cursor: pointer; font-size: 14px; color: var(--on-surface); transition: background 0.1s;
      border: none; background: none; width: 100%; text-align: left; font-family: inherit; font-weight: 500;
    }
    .exam-cat-item:hover, .exam-cat-item.hover { background: var(--alpha-08); color: var(--primary); }
    .exam-cat-item .cat-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--primary-container); display: flex; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0; }
    .exam-cat-item .cat-name { flex: 1; text-align: left; }
    .exam-cat-item .cat-arrow { color: var(--outline); flex-shrink: 0; }

    /* @component ExamL2Panel — 考试切换二级面板
       @state show/hide (opacity + translateX(-6px) 动画)
       @gotcha 优先复用预先渲染的面板，缺失时由 exam-menu.js 动态补建
       @interaction mouseenter面板 → 取消隐藏计时器; mouseleave → 300ms延迟隐藏
    */
    .exam-l2-panel {
      position: fixed; background: white; border-radius: 12px;
      box-shadow: 0 4px 24px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.05);
      padding: 6px; min-width: 260px; max-height: 370px; overflow-y: auto; z-index: 1001;
      opacity: 0; pointer-events: none; transform: translateX(-6px);
      transition: opacity 0.15s, transform 0.15s;
    }
    .exam-l2-panel.show { opacity: 1; pointer-events: auto; transform: translateX(0); }
    .exam-l2-exam {
      display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px;
      cursor: pointer; font-size: 13px; color: var(--on-surface-variant); transition: all 0.1s;
      border: none; background: none; width: 100%; text-align: left; font-family: inherit; white-space: nowrap;
    }
    .exam-l2-exam:hover { background: var(--hover-bg); color: var(--on-surface); }
    .exam-l2-exam .exam-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--outline); flex-shrink: 0; }
    .exam-l2-exam:hover .exam-dot { background: var(--primary); }
    /* @component AiChatPanel — AI 对话框
       @state open/closed (transform translateX 滑入)
       @animation 0.3s cubic-bezier(0.4, 0, 0.2, 1)
       @gotcha 打开时 contentInner 的 margin-left 增大370px + max-width 减370px → 推开内容而非覆盖
       @gotcha 面板用 position:absolute 浮在 .content 内，z-index:20，高于草稿纸层(15)
       @tokens width: 370px, max-width: 45vw
       子组件: AiChatHeader, AiChatMessages, AiChatInput
    */
    .ai-chat-panel {
      position: absolute; top: 0; left: 0; bottom: 0;
      width: 370px; max-width: 45vw;
      background: var(--white); border-right: 1px solid var(--border);
      display: flex; flex-direction: column; z-index: 20;
      transform: translateX(-100%);
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 4px 0 24px rgba(0,0,0,0.08);
    }
    .ai-chat-panel.open { transform: translateX(0); }
    .ai-chat-header {
      display: flex; align-items: center; gap: 12px;
      padding: 14px 20px; border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .ai-chat-header-title {
      font-size: 16px; font-weight: 600; color: var(--on-surface);
      flex: 1; display: flex; align-items: center; gap: 8px;
    }
    .ai-chat-header-dot {
      width: 8px; height: 8px; border-radius: 50%; background: #4caf50;
    }
    .ai-chat-close {
      width: 30px; height: 30px; border-radius: 50%; border: none;
      background: transparent; cursor: pointer; display: flex;
      align-items: center; justify-content: center;
      color: var(--on-surface-variant); transition: all 0.15s;
    }
    .ai-chat-close:hover { background: var(--hover-bg); color: var(--on-surface); }
    .ai-chat-messages {
      flex: 1; overflow-y: auto; padding: 16px 20px;
      display: flex; flex-direction: column; gap: 14px;
    }
    .ai-chat-msg {
      display: flex; flex-direction: column; max-width: 88%;
      animation: msgIn 0.25s ease;
    }
    @keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
    .ai-chat-msg.user { align-self: flex-end; }
    .ai-chat-msg.ai { align-self: flex-start; }
    .ai-chat-bubble {
      padding: 10px 14px; border-radius: 16px;
      font-size: 14px; line-height: 1.6; color: var(--on-surface);
    }
    .ai-chat-msg.user .ai-chat-bubble {
      background: var(--primary); color: var(--on-primary);
      border-bottom-right-radius: 6px;
    }
    .ai-chat-msg.ai .ai-chat-bubble {
      background: #f5f5f5; border-bottom-left-radius: 6px;
    }
    .ai-chat-msg-label {
      font-size: 11px; color: var(--on-surface-variant);
      margin-bottom: 3px; padding: 0 4px;
    }
    /* V9.25：切题分割线——「以上是第 N 题对话内容」，两端虚线分界 */
    .ai-chat-divider {
      align-self: center;
      display: flex; align-items: center; gap: 10px;
      width: 100%;
      font-size: 11px; color: var(--on-surface-variant);
      user-select: none;
    }
    .ai-chat-divider::before,
    .ai-chat-divider::after {
      content: ''; flex: 1; height: 1px;
      background: var(--border);
    }
    .ai-chat-divider span { white-space: nowrap; }
    .ai-chat-input-row {
      position: relative;
      padding: 12px 16px; border-top: 1px solid var(--border);
      flex-shrink: 0;
    }
    .ai-target-label {
      display: flex; align-items: center;
      margin-bottom: 4px; padding: 0 2px;
      font-size: 12px; color: var(--on-surface-variant);
    }
    .ai-chat-input {
      flex: 1; resize: none; border: 1.5px solid var(--border);
      border-radius: 12px; padding: 10px 48px 10px 14px; font-family: inherit;
      font-size: 14px; line-height: 1.5; color: var(--on-surface);
      outline: none; transition: border-color 0.2s;
      max-height: 280px; min-height: 105px; width: 100%;
    }
    .ai-chat-input:focus { border-color: var(--primary); }
    .ai-chat-send {
      position: absolute; right: 22px; bottom: 18px;
      width: 34px; height: 34px; border-radius: 50%; border: none;
      background: var(--primary); color: white; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all 0.15s; flex-shrink: 0;
    }
    .ai-chat-send:hover { background: var(--primary-dark); }
    .ai-chat-send:disabled { opacity: 0.4; cursor: default; }
    .ai-chat-send svg { width: 16px; height: 16px; }
    .ai-chat-typing {
      display: flex; align-items: center; gap: 4px; padding: 10px 14px;
    }
    .ai-chat-typing span {
      width: 6px; height: 6px; border-radius: 50%; background: #bbb;
      animation: typingBounce 1.4s infinite ease-in-out;
    }
    .ai-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
    .ai-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
    @keyframes typingBounce { 0%, 80%, 100% { transform: scale(0.6); } 40% { transform: scale(1); } }
    /* @component UploadModal — 上传题目弹窗
       @state show/hide (opacity + scale 动画)
       @gotcha 遮罩层在 .content 内(position:absolute)，不是 fixed，保证只在主内容区显示
    */
    .upload-overlay {
      display: none; position: absolute; inset: 0; z-index: 30;
      /* 同设置弹窗：全屏 backdrop-filter blur 导致打开卡顿，去掉并加深遮罩补层次 */
      background: rgba(0,0,0,0.35);
      align-items: center; justify-content: center;
      overflow-y: auto;  /* 小窗口下弹窗可滚动（全局滚轮代理会放行可滚动元素） */
    }
    .upload-overlay.show { display: flex; }
    /* 关闭淡出：JS 给 overlay 加 .closing 类，动画结束后才移除 .show（display:none）。
       用 animation 而非 transition（overlay 靠 display 切换，transition 对 display 无效）；
       用后代选择器（.closing 加在 overlay 上，不会成为 modal 自身的类），
       特异性高于基类 modalIn，forwards 保证结束帧保持到 display:none */
    .upload-overlay.closing { animation: overlayOut 0.2s ease forwards; }
    .upload-overlay.closing .upload-modal { animation: modalOut 0.2s ease forwards; }
    @keyframes overlayOut { to { opacity: 0; } }
    @keyframes modalOut {
      from { opacity: 1; transform: scale(1) translateY(0); }
      to   { opacity: 0; transform: scale(0.96) translateY(8px); }
    }
    .upload-modal {
      background: var(--white); border-radius: 20px;
      box-shadow: 0 8px 40px rgba(0,0,0,0.18);
      width: 520px; max-width: 90%; max-height: calc(100% - 24px); padding: 0;
      display: flex; flex-direction: column; overflow: hidden;
      animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    @keyframes modalIn {
      from { opacity: 0; transform: scale(0.92) translateY(12px); }
      to { opacity: 1; transform: scale(1) translateY(0); }
    }
    .upload-modal-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 18px 24px 0; flex: 0 0 auto;
    }
    .upload-modal-title {
      font-size: 18px; font-weight: 700; color: var(--on-surface);
    }
    .upload-modal-close {
      width: 32px; height: 32px; border-radius: 50%; border: none;
      background: transparent; cursor: pointer; display: flex;
      align-items: center; justify-content: center;
      color: var(--on-surface-variant); transition: all 0.15s;
    }
    .upload-modal-close:hover { background: var(--hover-bg); color: var(--on-surface); }
    .upload-modal-body {
      padding: 8px 24px 14px; flex: 1 1 auto; min-height: 0;
      overflow-y: auto; overscroll-behavior: contain;
    }
    .upload-target-banner {
      display: flex; align-items: center; gap: 8px;
      margin-bottom: 12px; padding: 8px 12px; border-radius: 10px;
      background: var(--alpha-05); color: var(--on-surface);
      font-size: 14px;
    }
    .upload-target-banner::before {
      content: ''; width: 8px; height: 8px; border-radius: 50%;
      background: var(--primary); flex-shrink: 0;
    }
    .upload-target-label { color: var(--on-surface-variant); }
    .upload-target-banner strong { color: var(--primary-dark); font-weight: 700; }
    .upload-section-label {
      font-size: 14px; font-weight: 600; color: var(--on-surface);
      margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
    }
    .upload-section-label .label-icon {
      width: 28px; height: 28px; border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      font-size: 14px;
    }
    .upload-section-label .label-icon.question { background: var(--alpha-10); color: var(--primary); }
    .upload-section-label .label-icon.answer { background: rgba(76, 175, 80, 0.1); color: #2e7d32; }
    .upload-zone {
      border: 2px dashed #d0d0d0; border-radius: 14px;
      padding: 18px 16px; text-align: center; cursor: pointer;
      transition: all 0.2s ease; position: relative;
      background: rgba(0,0,0,0.01);
    }
    .upload-zone:hover {
      border-color: var(--primary); background: var(--alpha-03);
    }
    .upload-zone.has-file {
      border-color: #4caf50; border-style: solid;
      background: rgba(76, 175, 80, 0.04);
    }
    .upload-zone-icon {
      font-size: 28px; margin-bottom: 4px; display: block;
    }
    .upload-zone-text {
      font-size: 14px; color: var(--on-surface-variant);
    }
    .upload-zone-text .link {
      color: var(--primary); font-weight: 600; text-decoration: none;
    }
    .upload-zone-text .link:hover { text-decoration: underline; }
    .upload-zone-hint {
      font-size: 12px; color: var(--outline); margin-top: 4px;
    }
    .upload-file-name {
      display: none; margin-top: 8px; padding: 7px 12px; border-radius: 8px;
      background: rgba(76, 175, 80, 0.08); font-size: 13px;
      color: #2e7d32; align-items: center; gap: 8px;
    }
    .upload-file-name.show { display: inline-flex; }
    .upload-file-name .remove-file {
      width: 18px; height: 18px; border-radius: 50%; border: none;
      background: rgba(0,0,0,0.1); cursor: pointer; display: flex;
      align-items: center; justify-content: center; font-size: 12px;
      color: var(--on-surface-variant); transition: all 0.15s;
    }
    .upload-file-name .remove-file:hover { background: rgba(198,40,40,0.15); color: var(--error); }
    .upload-section-gap { margin-top: 14px; }
    .upload-hint-gap { margin-top: 16px; }
    .upload-hint-banner {
      display: flex; align-items: flex-start; gap: 10px;
      padding: 12px 16px; border-radius: 10px;
      background: var(--alpha-05);
      font-size: 13px; line-height: 1.7; color: var(--on-surface-variant);
      margin-bottom: 8px;
    }
    .upload-hint-banner .hint-icon {
      color: var(--primary); font-size: 16px; flex-shrink: 0; margin-top: 1px;
    }
    .upload-progress {
      display: none; margin-top: 14px; padding: 14px 16px;
      border-radius: 10px; background: var(--alpha-05);
    }
    .upload-progress.show { display: block; }
    .upload-progress-row {
      display: flex; justify-content: space-between; gap: 12px;
      font-size: 13px; font-weight: 600; color: var(--on-surface);
    }
    .upload-progress-track {
      height: 8px; margin-top: 10px; overflow: hidden; border-radius: 999px;
      background: rgba(0,0,0,0.1);
    }
    .upload-progress-track span {
      display: block; width: 0; height: 100%; border-radius: inherit;
      background: var(--primary); transition: width 0.15s ease;
    }
    .upload-progress-detail {
      margin-top: 8px; font-size: 12px; color: var(--on-surface-variant);
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .upload-overlay.is-uploading .upload-zone,
    .upload-overlay.is-uploading .remove-file,
    .upload-overlay.is-uploading .upload-modal-close,
    .upload-overlay.is-uploading .upload-btn.cancel {
      pointer-events: none; opacity: 0.45;
    }
    .upload-modal-footer {
      display: flex; gap: 10px; justify-content: flex-end;
      padding: 0 24px 18px; flex: 0 0 auto;
    }
    .upload-btn {
      padding: 10px 28px; border-radius: 12px; border: none;
      font-family: inherit; font-size: 14px; font-weight: 600;
      cursor: pointer; transition: all 0.2s ease;
    }
    .upload-btn.cancel {
      background: transparent; color: var(--on-surface-variant);
    }
    .upload-btn.cancel:hover { background: var(--hover-bg); color: var(--on-surface); }
    .upload-btn.confirm {
      background: var(--primary); color: var(--on-primary);
    }
    .upload-btn.confirm:hover { background: var(--primary-dark); box-shadow: 0 2px 8px var(--alpha-30); }
    .upload-btn.confirm:disabled {
      opacity: 0.4; cursor: not-allowed; box-shadow: none;
    }

    /* @component AnswerPdfPanel — 答案原文PDF阅读面板
       @state open/closed (transform translateX 滑入/滑出)
       @state contentShift: 题目区左移量(px)，拖拽分隔条时动态变化
       @position left=题目区右边界, right=0 → 紧挨题目区，无空隙
       @gotcha 不用 width 固定宽度，由 left + right 自动撑满
       @gotcha 关闭态 translateX(100%) 配合 .content overflow-x:hidden 不产生滚动条
       @animation transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)
       @interaction 点击"答案原文"按钮→滑入；拖拽分隔条→调节PDF宽度，题目区同步左移，永不重叠
    */
    .answer-pdf-panel {
      position: absolute; top: 0; right: 0; bottom: 0;
      background: var(--white); z-index: 18;
      box-shadow: -2px 0 16px rgba(0,0,0,0.08);
      display: flex; flex-direction: column;
      transform: translateX(100%);
      visibility: hidden; /* 默认不可见，防页面加载瞬间闪现 */
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.3s;
      border-left: 1px solid var(--border);
      /* left + width 由 JS (applyPdfLayout) 动态设置 */
    }
    .answer-pdf-panel.open { transform: translateX(0); visibility: visible; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0s; }
    .pdf-source-tabs {
      flex: 0 0 auto; display: flex; gap: 6px; padding: 8px 10px;
      background: var(--white); border-bottom: 1px solid var(--border);
    }
    .pdf-source-tab {
      flex: 1; border: 1px solid var(--border); border-radius: 8px;
      background: var(--surface); color: var(--on-surface-variant);
      padding: 7px 10px; cursor: pointer; font: inherit; font-size: 13px;
    }
    .pdf-source-tab.active {
      color: var(--primary); border-color: var(--primary); background: var(--alpha-04);
      font-weight: 600;
    }
    .question-review-warning {
      display: flex; align-items: center; justify-content: space-between; gap: 10px;
      margin: 2px 0 12px; padding: 8px 10px; border-radius: 8px;
      background: #fff8e6; border: 1px solid #f3d58a; color: #8a5a00; font-size: 13px;
    }
    .question-review-warning button {
      flex: 0 0 auto; border: 0; background: transparent; color: var(--primary);
      cursor: pointer; font: inherit; font-weight: 600; padding: 2px 4px;
    }

    /* @component PdfResizeHandle — PDF面板拖拽分隔条
       @state idle/hover/active 三种视觉
       @interaction mousedown→跟踪mousemove→动态算宽→mouseup释放
       @gotcha 拖拽时 body cursor=col-resize + user-select=none 防文字选中
    */
    .pdf-resize-handle {
      position: absolute; left: -4px; top: 0; bottom: 0;
      width: 10px; cursor: col-resize; z-index: 6;
      transition: background 0.15s;
      border-radius: 0;
    }
    .pdf-resize-handle::after {
      content: ''; position: absolute; left: 50%; top: 50%;
      transform: translate(-50%, -50%);
      width: 3px; height: 40px; border-radius: 2px;
      background: transparent; transition: background 0.2s;
    }
    .pdf-resize-handle:hover::after { background: var(--alpha-25); }
    .pdf-resize-handle.active::after { background: var(--primary); }
    .pdf-resize-handle:hover { background: var(--alpha-04); }
    .pdf-resize-handle.active { background: var(--alpha-08); }
    .answer-pdf-body {
      flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0;
      background: #525659;
      /* 不再 flex 居中：canvas 顶对齐，用户上下滚动浏览 */
    }
    /* @component PdfPageSlot — 每页 PDF 的占位容器
       占位 div 最小高度撑开滚动区域，canvas 由 pdf.js 动态渲染填充 */
    .pdf-page-slot {
      width: 100%;
      min-height: 200px; /* 初始占位，canvas 渲染后撑开 */
      background: #fff;  /* 白底兜底：万一 slot 短暂空窗，露白纸色而非深灰 */
    }
    .pdf-page-slot:not(:last-child) {
      margin-bottom: 4px; /* 页间分隔 */
    }
    .pdf-page-canvas {
      display: block;
      width: 100%;
      height: auto;
    }
    .answer-pdf-placeholder {
      text-align: center; color: var(--on-surface-variant);
    }
    .answer-pdf-placeholder .placeholder-icon {
      font-size: 48px; margin-bottom: 12px; display: block;
      opacity: 0.6;
    }
    .answer-pdf-placeholder .placeholder-text {
      font-size: 14px; line-height: 1.7;
    }
    .answer-pdf-placeholder .placeholder-hint {
      font-size: 12px; color: var(--outline); margin-top: 8px;
    }
    /* @component ResumeChatButton — 恢复对话按钮（V6.45）
       题目卡片右上角的微型按钮，极低调，hover 才显眼
    */
    .resume-chat-btn {
      margin-left: auto; font-size: 13px; line-height: 1;
      padding: 3px 8px; border-radius: 6px;
      border: 1px dashed var(--primary);
      background: transparent; color: var(--primary);
      cursor: pointer; opacity: 0.5; transition: all 0.15s;
      flex-shrink: 0;
    }
    .resume-chat-btn:hover {
      opacity: 1; background: var(--primary-container);
      border-style: solid;
    }
    /* @component ResumeChatPopup — 恢复对话微型弹窗（V6.45）
       极简：220px 宽，绝对定位在按钮下方，白色圆角卡片
    */
    .resume-chat-popup {
      width: 220px; background: var(--white);
      border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
      padding: 14px; z-index: 10000;
      animation: popupIn 0.15s ease;
    }
    @keyframes popupIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
    .resume-popup-title {
      font-size: 13px; font-weight: 600; color: var(--on-surface);
      margin-bottom: 4px;
    }
    .resume-popup-hint {
      font-size: 11px; color: var(--on-surface-variant);
      margin-bottom: 10px;
    }
    .resume-popup-actions { display: flex; gap: 8px; }
    .resume-popup-yes {
      flex: 1; padding: 6px 0; border-radius: 8px; border: none;
      background: var(--primary); color: white; font-size: 12px;
      font-weight: 600; cursor: pointer; font-family: inherit;
    }
    .resume-popup-no {
      flex: 1; padding: 6px 0; border-radius: 8px;
      border: 1px solid var(--border); background: transparent;
      color: var(--on-surface-variant); font-size: 12px;
      cursor: pointer; font-family: inherit;
    }
    /* @component AiChatHistory — 历史消息样式（V6.45） */
    .ai-chat-msg.history .ai-chat-bubble {
      opacity: 0.75; font-size: 13px;
    }
    /* @component SettingsPopup — 设置弹窗（居中遮罩，全局 fixed）
       @state show/hide (opacity 动画)
       @gotcha 用 position:fixed 而非 absolute，因为触发按钮在侧边栏（非 .content 内）
       @pattern 参考 UploadModal 的居中遮罩模式
    */
    .settings-overlay {
      display: none; position: fixed; inset: 0; z-index: 100;
      /* 不用 backdrop-filter blur：全屏实时模糊导致打开弹窗卡顿掉帧，加深遮罩补层次 */
      background: rgba(0,0,0,0.35);
      align-items: center; justify-content: center;
    }
    .settings-overlay.show { display: flex; }
    /* 关闭淡出：同上传弹窗模式，JS 加 .closing 触发动画，结束才移除 .show */
    .settings-overlay.closing { animation: overlayOut 0.2s ease forwards; }
    .settings-overlay.closing .settings-modal { animation: modalOut 0.2s ease forwards; }
    .settings-modal {
      background: var(--white); border-radius: 16px;
      box-shadow: 0 8px 40px rgba(0,0,0,0.18);
      width: 400px; max-width: 92vw;
      animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .settings-modal-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 22px 28px 0;
    }
    .settings-modal-title {
      font-size: 18px; font-weight: 700; color: var(--on-surface);
    }
    .settings-modal-close {
      width: 32px; height: 32px; border-radius: 50%; border: none;
      background: transparent; cursor: pointer; display: flex;
      align-items: center; justify-content: center;
      color: var(--on-surface-variant); transition: all 0.15s;
    }
    .settings-modal-close:hover { background: var(--hover-bg); color: var(--on-surface); }
    .settings-modal-body {
      padding: 20px 28px 28px;
    }
    .settings-item {
      display: flex; align-items: center; justify-content: space-between;
      padding: 14px 0; cursor: pointer;
      border-bottom: 1px solid var(--border);
    }
    .settings-item-text {
      display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0;
    }
    .settings-item-title {
      font-size: 15px; font-weight: 600; color: var(--on-surface);
    }
    .settings-item-desc {
      font-size: 12px; color: var(--on-surface-variant); line-height: 1.5;
    }
    /* iOS 风格滑动开关 */
    .settings-toggle {
      width: 48px; height: 28px; border-radius: 14px;
      background: #d0d0d0; flex-shrink: 0;
      position: relative; transition: background 0.25s ease;
    }
    .settings-toggle::after {
      content: ''; position: absolute; top: 3px; left: 3px;
      width: 22px; height: 22px; border-radius: 50%;
      background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
      transition: transform 0.25s ease;
    }
    .settings-toggle.on {
      background: #4caf50;
    }
    .settings-toggle.on::after {
      transform: translateX(20px);
    }

    /* @component ConfirmDialog — 自定义确认弹窗（替代原生 confirm） */
    .confirm-overlay {
      display: none; position: fixed; inset: 0; z-index: 200;
      /* 同设置弹窗：不用 backdrop-filter blur（全屏模糊导致卡顿），加深遮罩补层次 */
      background: rgba(0,0,0,0.35);
      align-items: center; justify-content: center;
    }
    .confirm-overlay.show { display: flex; }
    .confirm-modal {
      background: var(--white); border-radius: 14px;
      box-shadow: 0 8px 40px rgba(0,0,0,0.18);
      width: 340px; max-width: 90vw; padding: 28px 24px 20px;
      animation: modalIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .confirm-message {
      font-size: 15px; color: var(--on-surface); line-height: 1.6;
      margin: 0 0 24px; text-align: center;
    }
    .confirm-actions { display: flex; gap: 10px; justify-content: center; }
    .confirm-btn {
      padding: 8px 28px; border-radius: 8px; border: none;
      font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
      transition: all 0.15s;
    }
    .confirm-btn-cancel {
      background: var(--hover-bg); color: var(--on-surface-variant);
    }
    .confirm-btn-cancel:hover { background: var(--alpha-12); }
    .confirm-btn-yes { background: var(--primary); color: #fff; }
    .confirm-btn-yes:hover { filter: brightness(1.1); }

    /* @component ProfileDialog — 当前账号个人信息 */
    .profile-overlay {
      position: fixed; inset: 0; z-index: 9999;
      display: flex; align-items: center; justify-content: center;
      padding: 20px; background: rgba(0,0,0,0.35);
    }
    .profile-dialog {
      width: 420px; max-width: 100%; overflow: hidden;
      background: var(--white); border: 1px solid var(--border); border-radius: 16px;
      box-shadow: 0 16px 48px rgba(0,0,0,0.2);
      animation: modalIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .profile-dialog-header {
      display: flex; align-items: flex-start; gap: 16px;
      padding: 22px 24px 18px; border-bottom: 1px solid var(--border);
    }
    .profile-dialog-header h2 { margin: 0; color: var(--on-surface); font-size: 20px; line-height: 1.4; }
    .profile-dialog-header p { margin: 4px 0 0; color: var(--on-surface-variant); font-size: 12px; }
    .profile-dialog-close {
      flex: none; width: 30px; height: 30px; margin-left: auto;
      border: none; border-radius: 50%; background: transparent;
      color: var(--on-surface-variant); font-size: 24px; line-height: 1;
      cursor: pointer; transition: background 0.15s, color 0.15s;
    }
    .profile-dialog-close:hover { background: var(--hover-bg); color: var(--on-surface); }
    .profile-dialog-body { padding: 8px 24px 18px; }
    .profile-info-row {
      display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 16px;
      align-items: start; padding: 13px 0; border-bottom: 1px solid var(--border);
    }
    .profile-info-row:last-child { border-bottom: none; }
    .profile-info-row span { color: var(--on-surface-variant); font-size: 13px; }
    .profile-info-row strong {
      min-width: 0; color: var(--on-surface); font-size: 13px; font-weight: 600;
      overflow-wrap: anywhere; text-align: right;
    }
    .profile-public-id { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 0.02em; }

    /* @component StudyNotifications — 顶栏后台任务通知中心
       @interaction 铃铛点击展开；点击外部或 Escape 关闭；内容由 JS 使用 textContent 写入
       @gotcha 固定定位避免被顶栏或侧栏裁剪，timeBell 倒计时不使用这些选择器
    */
    .notification-bell { position: relative; }
    .notification-badge {
      display: none; position: absolute; top: 1px; right: 1px;
      min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
      background: var(--error); color: #fff; font-size: 10px; line-height: 16px;
      font-weight: 700; text-align: center; pointer-events: none;
      box-sizing: border-box;
    }
    .notification-badge.show { display: block; }
    .notification-panel {
      position: fixed; z-index: 1200; display: flex; flex-direction: column;
      max-width: calc(100vw - 16px); max-height: min(480px, calc(100vh - 16px));
      box-sizing: border-box; overflow: hidden; visibility: hidden;
      opacity: 0; pointer-events: none; transform: translateY(-5px) scale(.98);
      background: var(--white); color: var(--on-surface);
      border: 1px solid var(--border); border-radius: 14px;
      box-shadow: 0 10px 32px rgba(0,0,0,.18);
      transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
    }
    .notification-panel.open {
      visibility: visible; opacity: 1; pointer-events: auto; transform: translateY(0) scale(1);
      transition: opacity .16s ease, transform .16s ease, visibility 0s;
    }
    .notification-header {
      display: flex; align-items: center; gap: 10px; flex-shrink: 0;
      min-height: 50px; padding: 8px 10px 8px 16px;
      border-bottom: 1px solid var(--border);
    }
    .notification-title { flex: 1; min-width: 0; margin: 0; font-size: 16px; line-height: 1.4; }
    .notification-header-actions { display: flex; align-items: center; gap: 4px; }
    .notification-read-all, .notification-close, .notification-retry, .notification-read-one {
      border: none; background: transparent; color: var(--on-surface-variant);
      font: inherit; cursor: pointer; border-radius: 7px; transition: background .15s, color .15s;
    }
    .notification-read-all { padding: 6px 7px; font-size: 12px; }
    .notification-close { width: 30px; height: 30px; font-size: 22px; line-height: 1; }
    .notification-read-all:hover:not(:disabled), .notification-close:hover,
    .notification-retry:hover, .notification-read-one:hover { background: var(--hover-bg); color: var(--on-surface); }
    .notification-bell:focus-visible, .notification-read-all:focus-visible,
    .notification-close:focus-visible, .notification-retry:focus-visible,
    .notification-read-one:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
    .notification-read-all:disabled { cursor: default; opacity: .45; }
    .notification-content { overflow-y: auto; padding: 6px; }
    .notification-status { padding: 28px 16px; color: var(--on-surface-variant); font-size: 13px; line-height: 1.6; text-align: center; }
    .notification-status-error { color: var(--error); padding-bottom: 8px; }
    .notification-retry { display: block; margin: 0 auto 18px; padding: 6px 10px; font-size: 12px; }
    .notification-item {
      padding: 11px 10px 10px; border-radius: 9px; border-bottom: 1px solid var(--border);
      transition: background .15s;
    }
    .notification-item:last-child { border-bottom: none; }
    .notification-item.is-unread { background: var(--hover-bg); }
    .notification-item-header { display: flex; align-items: flex-start; gap: 7px; }
    .notification-item-title { flex: 1; min-width: 0; margin: 0; color: var(--on-surface); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
    .notification-item.is-read .notification-item-title { font-weight: 500; }
    .notification-unread-dot {
      width: 7px; height: 7px; margin-top: 6px; flex: 0 0 7px; border-radius: 50%;
      background: var(--primary); font-size: 0; overflow: hidden;
    }
    .notification-item-body { margin: 5px 0 0; color: var(--on-surface-variant); font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
    .notification-item-time { display: block; margin-top: 6px; color: var(--on-surface-variant); font-size: 11px; opacity: .78; }
    .notification-read-one { margin-top: 7px; padding: 4px 7px; font-size: 11px; }

    @media (max-width: 760px) {
      .notification-panel { max-height: calc(100vh - 12px); border-radius: 12px; }
      .notification-header { min-height: 46px; }
      .notification-content { padding: 4px; }
    }
    @media (prefers-reduced-motion: reduce) {
      .notification-panel { transition: none; }
    }

