    /* ============================================================
       Design Tokens — 现代友好风（Figma/Slack 感）
       ============================================================ */
    :root {
      /* 背景层级 */
      --bg-app: #F7F8FA;
      --bg-card: #FFFFFF;
      --bg-elevated: #FFFFFF;
      --bg-hover: #F1F2F5;
      --bg-active: #E8EAF0;

      /* 文字 */
      --text-primary: #1A1D29;
      --text-secondary: #5B6371;
      --text-tertiary: #8B92A1;
      --text-inverse: #FFFFFF;

      /* 边框 */
      --border-subtle: #E8EAF0;
      --border-default: #D6DAE2;
      --border-strong: #B4BAC8;

      /* Accent — 操作按钮（紫蓝）*/
      --accent-primary: #6366F1;
      --accent-primary-hover: #4F52E0;
      --accent-primary-active: #4346C7;
      --accent-soft: #EEF0FE;

      /* 内容 — 红框（PRD 硬约束）*/
      --annotation-red: #FF0000;
      --annotation-red-soft: rgba(255, 0, 0, 0.08);

      /* 状态色 */
      --success: #10B981;
      --warning: #F59E0B;
      --danger: #EF4444;
      --info: #3B82F6;

      /* 阴影 */
      --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
      --shadow-md: 0 4px 8px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
      --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);

      /* 圆角 */
      --radius-sm: 6px;
      --radius-md: 8px;
      --radius-lg: 12px;
      --radius-xl: 16px;

      /* 间距 */
      --space-1: 4px;
      --space-2: 8px;
      --space-3: 12px;
      --space-4: 16px;
      --space-5: 20px;
      --space-6: 24px;
      --space-8: 32px;

      /* 字体 */
      --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                   "Microsoft YaHei", "Segoe UI", Helvetica, Arial, sans-serif;
      --font-mono: "SF Mono", Monaco, Menlo, Consolas, monospace;
    }

    /* ============================================================
       Reset & Base
       ============================================================ */
    *, *::before, *::after { box-sizing: border-box; }
    html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
    body {
      font-family: var(--font-sans);
      font-size: 14px;
      line-height: 1.5;
      color: var(--text-primary);
      background: var(--bg-app);
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }
    button {
      font-family: inherit;
      font-size: inherit;
      cursor: pointer;
      border: none;
      background: none;
      padding: 0;
      color: inherit;
    }
    input, textarea {
      font-family: inherit;
      font-size: inherit;
    }

    /* ============================================================
       App Shell
       ============================================================ */
    #app {
      height: 100vh;
      display: flex;
      flex-direction: column;
    }
    .screen { display: none; height: 100%; }
    .screen.active { display: flex; flex-direction: column; }

    /* ============================================================
       Screen 1 — Upload
       ============================================================ */
    .upload-screen {
      align-items: center;
      justify-content: center;
      padding: var(--space-8);
      background: var(--bg-app);
      overflow-y: auto;          /* 文件多时整页可滚 */
    }
    .upload-card {
      background: var(--bg-card);
      border-radius: var(--radius-xl);
      padding: var(--space-8);
      width: 100%;
      max-width: 720px;
      margin: auto 0;            /* flex 居中，但内容超高时从顶部开始可滚动 */
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      max-height: calc(100vh - 2 * var(--space-6));  /* 卡片不超过视口，列表内部滚动 */
      box-shadow: var(--shadow-md);
    }
    .upload-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--space-3);
      margin-bottom: var(--space-6);
    }
    .upload-logo {
      display: flex;
      align-items: center;
      gap: var(--space-2);
      font-weight: 600;
      font-size: 16px;
    }
    .upload-logo-mark {
      width: 28px; height: 28px;
      border-radius: 8px;
      background: linear-gradient(135deg, var(--accent-primary), #8B5CF6);
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: 700;
      font-size: 13px;
    }
    .upload-title { font-size: 28px; font-weight: 700; margin: 0 0 var(--space-2); }
    .upload-subtitle { color: var(--text-secondary); margin: 0 0 var(--space-6); font-size: 15px; }
    .resume-card {
      display: flex;
      align-items: center;
      gap: var(--space-3);
      margin: calc(-1 * var(--space-2)) 0 var(--space-5);
      padding: var(--space-3) var(--space-4);
      border: 1px solid #bfdbfe;
      border-radius: var(--radius-lg);
      background: linear-gradient(100deg, #eff6ff, #f8fbff);
    }
    .resume-icon {
      display: grid;
      width: 36px;
      height: 36px;
      place-items: center;
      flex: 0 0 auto;
      border-radius: 10px;
      background: #dbeafe;
      color: var(--accent-primary);
    }
    .resume-icon .icon { width: 19px; height: 19px; }
    .resume-copy { display: grid; min-width: 0; gap: 3px; }
    .resume-copy strong { color: var(--text-primary); font-size: 14px; }
    .resume-copy span { overflow: hidden; color: var(--text-secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
    .resume-action { margin-left: auto; flex: 0 0 auto; }

    .dropzone {
      border: 2px dashed var(--border-default);
      border-radius: var(--radius-lg);
      padding: 56px var(--space-6);
      text-align: center;
      transition: all 0.15s ease;
      background: var(--bg-app);
      cursor: pointer;
    }
    .dropzone:hover, .dropzone.drag-over {
      border-color: var(--accent-primary);
      background: var(--accent-soft);
    }
    .dropzone-icon {
      width: 56px; height: 56px;
      margin: 0 auto var(--space-4);
      color: var(--accent-primary);
    }
    .dropzone-title { font-size: 16px; font-weight: 600; margin-bottom: var(--space-2); }
    .dropzone-hint { color: var(--text-secondary); font-size: 13px; margin-bottom: var(--space-4); }
    .dropzone-cta {
      display: inline-flex;
      align-items: center;
      gap: var(--space-2);
      padding: 10px 20px;
      background: var(--accent-primary);
      color: var(--text-inverse);
      border-radius: var(--radius-md);
      font-weight: 500;
      transition: background 0.15s ease;
    }
    .dropzone-cta:hover { background: var(--accent-primary-hover); }
    .dropzone-rules {
      display: flex;
      justify-content: center;
      gap: var(--space-4);
      margin-top: var(--space-4);
      font-size: 12px;
      color: var(--text-tertiary);
    }
    .dropzone-rules span::before {
      content: "·";
      margin-right: var(--space-2);
    }
    .dropzone-rules span:first-child::before { content: ""; margin: 0; }
    /* 已选图片后收紧添加区，把可视高度优先留给图片列表。 */
    .upload-card.has-files .dropzone {
      padding: var(--space-4) var(--space-6);
    }
    .upload-card.has-files .dropzone-icon,
    .upload-card.has-files .dropzone-rules { display: none; }
    .upload-card.has-files .dropzone-title { margin-bottom: 4px; }
    .upload-card.has-files .dropzone-hint { margin-bottom: var(--space-3); }
    /* 有图片时使用确定的卡片高度：列表只占中间剩余空间，底部操作区不会覆盖它。 */
    .upload-card.has-files {
      height: min(760px, calc(100vh - 2 * var(--space-6)));
    }

    .file-list {
      margin-top: var(--space-4);
      border-top: 1px solid var(--border-subtle);
      padding-top: var(--space-4);
      flex: 1 1 auto;
      min-height: 0;            /* flex 子项可滚动必需 */
      display: flex;
      flex-direction: column;
    }
    /* 文件多时列表内部滚动，卡片不无限增长，确认按钮永远可见 */
    #file-items {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      margin: 0 calc(-1 * var(--space-1));
      padding: 0 var(--space-1);
    }
    .file-list-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: var(--space-3);
    }
    .file-list-title { font-weight: 600; font-size: 13px; color: var(--text-secondary); }
    .file-list-count {
      background: var(--accent-soft);
      color: var(--accent-primary);
      padding: 2px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 600;
    }
    .file-item {
      display: flex;
      align-items: center;
      gap: var(--space-3);
      padding: var(--space-3);
      border-radius: var(--radius-md);
      transition: background 0.1s;
    }
    .file-item:hover { background: var(--bg-hover); }
    .file-thumb {
      width: 40px; height: 40px;
      border-radius: var(--radius-sm);
      background: var(--bg-hover);
      flex-shrink: 0;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .file-thumb img { width: 100%; height: 100%; object-fit: cover; }
    .file-info { flex: 1; min-width: 0; }
    .file-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .file-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
    .file-status { font-size: 12px; font-weight: 500; }
    .file-status.success { color: var(--success); }
    .file-status.failed { color: var(--danger); }
    .file-status.processing { color: var(--accent-primary); }

    .upload-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: var(--space-3);
      padding-top: var(--space-3);
      border-top: 1px solid var(--border-subtle);
      flex-shrink: 0;            /* 确认按钮区始终可见，不被列表挤压 */
    }
    .upload-actions > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .btn {
      display: inline-flex;
      align-items: center;
      gap: var(--space-2);
      padding: 10px 18px;
      border-radius: var(--radius-md);
      font-weight: 500;
      font-size: 14px;
      transition: all 0.15s ease;
      border: 1px solid transparent;
      white-space: nowrap;
    }
    .btn-primary {
      background: var(--accent-primary);
      color: var(--text-inverse);
    }
    .btn-primary:hover { background: var(--accent-primary-hover); }
    .btn-primary:disabled {
      background: var(--border-default);
      color: var(--text-tertiary);
      cursor: not-allowed;
    }
    .btn-secondary {
      background: var(--bg-card);
      color: var(--text-primary);
      border-color: var(--border-default);
    }
    .btn-secondary:hover { background: var(--bg-hover); }
    .btn-ghost { color: var(--text-secondary); }
    .btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
    .btn-danger { color: var(--danger); }
    .btn-danger:hover { background: #FEF2F2; }

    /* 进度条 */
    .progress-track {
      height: 4px;
      background: var(--bg-hover);
      border-radius: 999px;
      overflow: hidden;
      width: 100px;
    }
    .progress-fill {
      height: 100%;
      background: var(--accent-primary);
      transition: width 0.3s ease;
    }
    .progress-fill.success { background: var(--success); }
    .progress-fill.failed { background: var(--danger); }

    /* 全局 loading */
    .global-loading {
      position: fixed;
      inset: 0;
      background: rgba(255, 255, 255, 0.85);
      backdrop-filter: blur(4px);
      display: none;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: var(--space-4);
      z-index: 1000;
    }
    .global-loading.active { display: flex; }
    .spinner {
      width: 40px; height: 40px;
      border: 3px solid var(--accent-soft);
      border-top-color: var(--accent-primary);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .loading-text { color: var(--text-secondary); font-size: 14px; }
    .loading-progress {
      width: 200px;
      height: 6px;
      background: var(--bg-hover);
      border-radius: 999px;
      overflow: hidden;
    }
    .loading-progress-fill {
      height: 100%;
      background: var(--accent-primary);
      transition: width 0.3s ease;
    }
    .loading-log {
      width: 360px;
      max-height: 140px;
      overflow-y: auto;
      font-family: var(--font-mono);
      font-size: 11px;
      line-height: 1.6;
      color: var(--text-tertiary);
      background: var(--bg-hover);
      border-radius: var(--radius-sm);
      padding: var(--space-2) var(--space-3);
      display: none;
    }
    .loading-log.active { display: block; }
    .loading-log-line { white-space: pre-wrap; word-break: break-all; }
    .loading-log-line:last-child { color: var(--accent-primary); }

    /* ============================================================
       Screen 2 — Editor
       ============================================================ */
    .editor-screen { background: var(--bg-app); }

    /* 顶部操作栏 */
    .editor-topbar {
      min-height: 108px;
      background: var(--bg-card);
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      align-items: center;
      align-content: stretch;
      flex-wrap: wrap;
      padding: 0 var(--space-5);
      column-gap: var(--space-3);
      row-gap: 0;
      flex-shrink: 0;
      overflow: hidden;
    }
    .topbar-back {
      display: flex;
      align-items: center;
      gap: var(--space-2);
      color: var(--text-secondary);
      font-weight: 500;
      padding: 6px 10px;
      border-radius: var(--radius-md);
      white-space: nowrap;
    }
    .topbar-back:hover { background: var(--bg-hover); color: var(--text-primary); }
    .topbar-page-info {
      font-size: 12px;
      color: var(--text-tertiary);
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
      padding: 0 var(--space-2);
      max-width: 300px;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .topbar-divider {
      width: 1px;
      height: 24px;
      background: var(--border-subtle);
    }
    .topbar-group {
      display: flex;
      order: 2;
      flex: 0 0 100%;
      align-items: center;
      gap: var(--space-3);
      min-width: 0;
      min-height: 46px;
      margin: 0 calc(-1 * var(--space-5));
      padding: 6px var(--space-5);
      border-top: 1px solid var(--border-subtle);
      background: var(--bg-app);
      overflow-x: auto;
      scrollbar-width: none;
    }
    .topbar-group::-webkit-scrollbar { display: none; }
    .topbar-action-row { display: flex; align-items: center; gap: var(--space-1); flex: 0 0 auto; white-space: nowrap; }
    .topbar-super-res {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      padding: 3px;
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      background: var(--bg-app);
      white-space: nowrap;
    }
    .super-res-label {
      padding: 0 5px;
      color: var(--text-tertiary);
      font-size: 11px;
      font-weight: 500;
      white-space: nowrap;
    }
    .super-res-option {
      min-width: 34px;
      padding: 4px 6px;
      border-radius: var(--radius-sm);
      color: var(--text-secondary);
      font-size: 11px;
      font-weight: 600;
      line-height: 1;
    }
    .super-res-option:hover:not(:disabled) { background: var(--bg-card); color: var(--text-primary); }
    .super-res-option.active { background: var(--accent-primary); color: white; }
    .super-res-option.disabled { cursor: not-allowed; opacity: .38; }
    .topbar-btn {
      display: inline-flex;
      align-items: center;
      gap: var(--space-2);
      padding: 7px 12px;
      border-radius: var(--radius-md);
      color: var(--text-secondary);
      font-weight: 500;
      font-size: 13px;
      transition: all 0.1s;
    }
    .topbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
    .topbar-btn.active { background: var(--accent-soft); color: var(--accent-primary); }
    .topbar-btn svg { width: 16px; height: 16px; }
    .topbar-button-key {
      min-width: 18px;
      padding: 1px 4px;
      border: 1px solid var(--border-default);
      border-radius: 4px;
      background: var(--bg-card);
      color: var(--text-tertiary);
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 9px;
      font-weight: 700;
      line-height: 1.35;
      text-align: center;
    }
    .topbar-key {
      padding: 1px 4px;
      border: 1px solid var(--border-default);
      border-bottom-width: 2px;
      border-radius: 4px;
      color: var(--text-tertiary);
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 10px;
      font-weight: 600;
      line-height: 1.2;
      white-space: nowrap;
    }
    .topbar-spacer { flex: 1 1 20px; min-width: 0; }
    .topbar-zoom {
      display: flex;
      align-items: center;
      gap: var(--space-1);
      padding: 4px;
      background: var(--bg-app);
      border-radius: var(--radius-md);
      font-size: 12px;
    }
    .zoom-btn {
      width: 24px; height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: var(--radius-sm);
      color: var(--text-secondary);
    }
    .zoom-btn:hover { background: var(--bg-card); color: var(--text-primary); }
    .zoom-value {
      min-width: 48px;
      text-align: center;
      font-weight: 500;
      color: var(--text-primary);
      font-variant-numeric: tabular-nums;
    }

    /* 编辑器主体 */
    .editor-main {
      flex: 1;
      display: flex;
      overflow: hidden;
    }

    /* 画布区 */
    .canvas-area {
      flex: 1;
      position: relative;
      overflow: hidden;
      background: var(--bg-app);
      background-image:
        linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px);
      background-size: 24px 24px;
    }
    .canvas-viewport {
      position: absolute;
      inset: 0;
      cursor: grab;
      user-select: none;
    }
    .canvas-viewport.panning { cursor: grabbing; }
    .canvas-viewport.add-mode { cursor: crosshair; }
    .canvas-content {
      position: absolute;
      top: 0; left: 0;
      transform-origin: 0 0;
      will-change: transform;
    }
    .canvas-image {
      display: block;
      background: white;
      box-shadow: var(--shadow-lg);
    }

    /* SVG 标注层 */
    .annotation-layer {
      position: absolute;
      top: 0; left: 0;
      pointer-events: none;
      overflow: visible;
    }
    .annotation-box {
      fill: transparent;
      stroke: var(--annotation-red);
      stroke-width: 2;
      cursor: move;
      pointer-events: auto;
    }
    .annotation-box.low-confidence {
      stroke-dasharray: 6 4;
    }
    .annotation-box.manual {
      stroke: var(--annotation-red);
    }
    .annotation-box.selected {
      stroke: var(--accent-primary);
      stroke-width: 2.5;
    }
    /* 框选拖拽时，与选区相交的框实时高亮 */
    .annotation-box.marquee-hit {
      fill: rgba(99, 102, 241, 0.12);
      stroke: var(--accent-primary);
      stroke-width: 2.5;
    }
    .annotation-box-hover {
      fill: var(--annotation-red-soft);
      pointer-events: none;
    }
    .box-label {
      fill: var(--annotation-red);
      font-size: 10px;
      font-family: var(--font-mono);
      font-weight: 600;
      pointer-events: none;
      paint-order: stroke;
      stroke: white;
      stroke-width: 3;
      stroke-linejoin: round;
    }

    /* 调整控制点 */
    .resize-handle {
      fill: white;
      stroke: var(--accent-primary);
      stroke-width: 1.5;
      pointer-events: auto;
      cursor: nwse-resize;
    }
    .resize-handle.nw { cursor: nwse-resize; }
    .resize-handle.ne { cursor: nesw-resize; }
    .resize-handle.sw { cursor: nesw-resize; }
    .resize-handle.se { cursor: nwse-resize; }
    .resize-handle.n, .resize-handle.s { cursor: ns-resize; }
    .resize-handle.e, .resize-handle.w { cursor: ew-resize; }

    /* 绘制中的临时框 */
    .drawing-rect {
      fill: var(--annotation-red-soft);
      stroke: var(--annotation-red);
      stroke-width: 2;
      stroke-dasharray: 4 3;
      pointer-events: none;
    }

    /* Shift+拖拽框选矩形 */
    .marquee-rect {
      fill: rgba(99, 102, 241, 0.08);
      stroke: var(--accent-primary);
      stroke-width: 1.5;
      stroke-dasharray: 5 3;
      pointer-events: none;
    }

    /* 侧边栏快捷键提示条 */
    .shortcut-hint {
      padding: 8px var(--space-4);
      font-size: 11px;
      color: var(--text-tertiary);
      background: var(--bg-app);
      border-bottom: 1px solid var(--border-subtle);
      line-height: 1.7;
    }
    .shortcut-hint kbd {
      background: var(--bg-card);
      border: 1px solid var(--border-default);
      border-radius: 3px;
      padding: 0 4px;
      font-family: var(--font-mono);
      font-size: 10px;
      color: var(--text-secondary);
    }

    /* 画布悬浮信息 */
    .canvas-hint {
      position: absolute;
      bottom: var(--space-4);
      left: 50%;
      transform: translateX(-50%);
      background: rgba(26, 29, 41, 0.92);
      color: white;
      padding: 8px 14px;
      border-radius: var(--radius-md);
      font-size: 12px;
      display: none;
      align-items: center;
      gap: var(--space-2);
      box-shadow: var(--shadow-lg);
    }
    .canvas-hint.active { display: inline-flex; }
    .canvas-hint kbd {
      background: rgba(255,255,255,0.15);
      padding: 1px 6px;
      border-radius: 4px;
      font-family: var(--font-mono);
      font-size: 11px;
    }

    /* 右侧标注清单 */
    .annotation-panel {
      width: 280px;
      background: var(--bg-card);
      border-left: 1px solid var(--border-subtle);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
    }
    .panel-header {
      padding: var(--space-4) var(--space-5);
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .panel-title {
      font-weight: 600;
      font-size: 14px;
      display: flex;
      align-items: center;
      gap: var(--space-2);
    }
    .panel-badge {
      background: var(--accent-soft);
      color: var(--accent-primary);
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 600;
    }
    .panel-filters {
      display: flex;
      gap: var(--space-1);
      padding: var(--space-2) var(--space-4) var(--space-3);
      border-bottom: 1px solid var(--border-subtle);
    }
    .filter-chip {
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 12px;
      color: var(--text-secondary);
      background: var(--bg-app);
      cursor: pointer;
      transition: all 0.1s;
    }
    .filter-chip:hover { background: var(--bg-hover); }
    .filter-chip.active {
      background: var(--accent-soft);
      color: var(--accent-primary);
      font-weight: 500;
    }
    .annotation-list {
      flex: 1;
      overflow-y: auto;
      padding: var(--space-2) 0;
    }
    .annotation-list-item {
      display: flex;
      align-items: center;
      gap: var(--space-3);
      padding: var(--space-3) var(--space-5);
      cursor: pointer;
      transition: background 0.1s;
      border-left: 3px solid transparent;
    }
    .annotation-list-item:hover { background: var(--bg-hover); }
    .annotation-list-item.selected {
      background: var(--accent-soft);
      border-left-color: var(--accent-primary);
    }
    .annotation-list-item.low-confidence { border-left-color: var(--warning); }
    .list-item-icon {
      width: 28px; height: 28px;
      border-radius: 6px;
      background: var(--bg-app);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      color: var(--text-secondary);
    }
    .list-item-icon.auto { color: var(--accent-primary); background: var(--accent-soft); }
    .list-item-icon.manual { color: var(--success); background: #ECFDF5; }
    .list-item-body { flex: 1; min-width: 0; }
    .list-item-text {
      font-size: 13px;
      font-weight: 500;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .list-item-meta {
      font-size: 11px;
      color: var(--text-tertiary);
      margin-top: 2px;
      display: flex;
      gap: var(--space-2);
      align-items: center;
    }
    .conf-dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      background: var(--success);
      display: inline-block;
    }
    .conf-dot.low { background: var(--warning); }

    /* 字体颜色色块（标注清单） */
    .color-chip {
      display: inline-block;
      width: 12px;
      height: 12px;
      border-radius: 3px;
      border: 1px solid rgba(0,0,0,0.15);
      vertical-align: middle;
      margin-left: 2px;
    }
    .list-item-actions {
      display: flex;
      gap: 2px;
      opacity: 0;
      transition: opacity 0.1s;
    }
    .annotation-list-item:hover .list-item-actions { opacity: 1; }
    .list-action-btn {
      width: 24px; height: 24px;
      border-radius: 4px;
      color: var(--text-tertiary);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .list-action-btn:hover { background: var(--bg-active); color: var(--text-primary); }
    .list-action-btn.danger:hover { background: #FEE2E2; color: var(--danger); }

    /* 底部缩略图导航 */
    .thumbnail-bar {
      height: 96px;
      background: var(--bg-card);
      border-top: 1px solid var(--border-subtle);
      display: flex;
      align-items: center;
      padding: 0 var(--space-4);
      gap: var(--space-2);
      flex-shrink: 0;
      overflow-x: auto;
      overflow-y: hidden;
    }
    .thumb-item {
      position: relative;
      width: 96px;
      height: 64px;
      border-radius: var(--radius-md);
      overflow: hidden;
      cursor: pointer;
      flex-shrink: 0;
      border: 2px solid transparent;
      transition: all 0.15s ease;
      background: var(--bg-app);
    }
    .thumb-item:hover { border-color: var(--border-default); }
    .thumb-item.active {
      border-color: var(--accent-primary);
      box-shadow: 0 0 0 3px var(--accent-soft);
    }
    .thumb-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .thumb-status {
      position: absolute;
      top: 4px;
      right: 4px;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: var(--bg-card);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      font-weight: 700;
    }
    .thumb-status.unchanged { background: var(--bg-hover); color: var(--text-tertiary); }
    .thumb-status.modified { background: var(--success); color: white; }
    .thumb-index {
      position: absolute;
      bottom: 2px;
      left: 4px;
      font-size: 10px;
      color: white;
      background: rgba(0,0,0,0.6);
      padding: 1px 5px;
      border-radius: 4px;
      font-weight: 600;
      font-variant-numeric: tabular-nums;
    }

    /* ============================================================
       Modals
       ============================================================ */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.4);
      backdrop-filter: blur(2px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 500;
      animation: fadeIn 0.15s ease;
    }
    .modal-overlay.active { display: flex; }
    /* 首页覆盖层的层级为 9999；账户弹窗必须位于其上，否则点击虽已触发但
       弹窗被首页遮住，表现为没有反应。 */
    #modal-credit-records,
    #modal-change-password,
    #modal-recharge,
    #modal-admin { z-index: 10000; }
    #modal-admin-password, #modal-admin-credit { z-index: 10010; }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    .modal {
      background: var(--bg-card);
      border-radius: var(--radius-xl);
      box-shadow: var(--shadow-lg);
      max-width: 560px;
      width: calc(100% - 40px);
      max-height: calc(100% - 40px);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      animation: slideUp 0.2s ease;
    }
    @keyframes slideUp { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

    /* 定位闪烁高亮：1.5秒脉冲，黄底 + 粗红框 */
    @keyframes locatePulse {
      0%, 100% { fill: rgba(255, 215, 0, 0.05); stroke: var(--annotation-red); stroke-width: 2.5; }
      50%      { fill: rgba(255, 215, 0, 0.35); stroke: #FFD700; stroke-width: 5; }
    }
    .annotation-box.locate-flash {
      animation: locatePulse 0.6s ease-in-out 3;
      stroke-width: 5 !important;
      stroke: #FFD700 !important;
      fill: rgba(255, 215, 0, 0.3) !important;
    }
    .box-label.locate-flash {
      fill: #B8860B !important;
      font-size: 14px !important;
      stroke: white;
      stroke-width: 4;
    }
    .modal-header {
      padding: var(--space-5) var(--space-6);
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
    }
    .modal-title { font-size: 18px; font-weight: 700; margin: 0; }
    .modal-subtitle { color: var(--text-secondary); font-size: 13px; margin: 4px 0 0; }
    .modal-close {
      width: 32px; height: 32px;
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-tertiary);
      transition: all 0.1s;
    }
    .modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
    .modal-body {
      padding: var(--space-6);
      overflow-y: auto;
      flex: 1;
    }
    .modal-footer {
      padding: var(--space-4) var(--space-6);
      border-top: 1px solid var(--border-subtle);
      display: flex;
      justify-content: flex-end;
      gap: var(--space-3);
    }

    /* 导出统计 */
    .export-stats {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: var(--space-3);
      margin-bottom: var(--space-5);
    }
    .stat-card {
      padding: var(--space-4);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
    }
    .stat-label {
      font-size: 12px;
      color: var(--text-secondary);
      margin-bottom: 4px;
    }
    .stat-value {
      font-size: 22px;
      font-weight: 700;
      font-variant-numeric: tabular-nums;
    }
    .stat-card.accent .stat-value { color: var(--accent-primary); }
    .stat-card.success .stat-value { color: var(--success); }
    .stat-card.warning .stat-value { color: var(--warning); }

    .export-options {
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      overflow: hidden;
    }
    .export-option {
      display: flex;
      align-items: flex-start;
      gap: var(--space-3);
      padding: var(--space-4);
      cursor: pointer;
      border-bottom: 1px solid var(--border-subtle);
      transition: background 0.1s;
    }
    .export-option:last-child { border-bottom: none; }
    .export-option:hover { background: var(--bg-hover); }
    .export-option input[type="radio"] {
      margin-top: 3px;
      accent-color: var(--accent-primary);
    }
    .export-option-body { flex: 1; }
    .export-option-title {
      font-weight: 500;
      font-size: 14px;
      margin-bottom: 2px;
    }
    .export-option-desc {
      font-size: 12px;
      color: var(--text-secondary);
    }

    /* 警告提示 */
    .alert {
      display: flex;
      gap: var(--space-3);
      padding: var(--space-3) var(--space-4);
      border-radius: var(--radius-md);
      margin-bottom: var(--space-4);
      font-size: 13px;
    }
    .alert.warning {
      background: #FEF3C7;
      color: #92400E;
    }
    .alert.info {
      background: var(--accent-soft);
      color: var(--accent-primary-active);
    }

    /* 文本编辑输入弹层 */
    .text-edit-popover {
      position: absolute;
      background: var(--bg-card);
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-lg);
      padding: var(--space-3);
      min-width: 240px;
      z-index: 200;
      display: none;
      border: 1px solid var(--border-subtle);
    }
    .text-edit-popover.active { display: block; }
    .text-edit-input {
      width: 100%;
      padding: 8px 10px;
      border: 1px solid var(--border-default);
      border-radius: var(--radius-sm);
      margin-bottom: var(--space-2);
      outline: none;
      transition: border-color 0.1s;
    }
    .text-edit-input:focus { border-color: var(--accent-primary); }
    .text-edit-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }

    /* 提示工具 */
    .toast {
      position: fixed;
      bottom: 32px;
      left: 50%;
      transform: translateX(-50%) translateY(8px);
      background: var(--text-primary);
      color: white;
      padding: 10px 18px;
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-lg);
      font-size: 13px;
      opacity: 0;
      pointer-events: none;
      transition: all 0.2s ease;
      z-index: 2000;
      display: flex;
      align-items: center;
      gap: var(--space-2);
    }
    .toast.active { opacity: 1; transform: translateX(-50%) translateY(0); }

    /* 滚动条 */
    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb {
      background: var(--border-default);
      border-radius: 999px;
    }
    ::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

    /* 隐藏 */
    .hidden { display: none !important; }

    /* SVG 图标默认尺寸 */
    .icon { width: 16px; height: 16px; flex-shrink: 0; }
    .icon-sm { width: 14px; height: 14px; }
    .icon-lg { width: 20px; height: 20px; }

    /* ============ 登录 / 用户区 / 用户管理（auth.js）============ */
    .login-screen { display: none; position: fixed; inset: 0; z-index: 10000;
      background: var(--bg-app); align-items: center; justify-content: center; }
    .login-screen.active { display: flex; }
    .login-card { width: 360px; max-width: calc(100vw - 32px);
      background: var(--bg-card); border: 1px solid var(--border-subtle);
      border-radius: 16px; padding: 32px; box-shadow: 0 8px 32px rgba(20,24,40,.08); }
    .login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px;
      font-weight: 700; font-size: 18px; color: var(--text-primary); }
    .login-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px;
      font-size: 13px; color: var(--text-secondary); }
    .login-field input, .login-field select, .login-field textarea {
      padding: 10px 12px; border: 1px solid var(--border-default);
      border-radius: 8px; font-size: 14px; color: var(--text-primary); background: var(--bg-card); }
    .login-field textarea { resize: vertical; font-family: inherit; line-height: 1.5; }
    .login-field input:focus, .login-field select:focus, .login-field textarea:focus {
      outline: none; border-color: var(--accent-primary);
      box-shadow: 0 0 0 3px var(--accent-soft); }
    .login-error { min-height: 18px; color: var(--danger); font-size: 13px; }
    .login-success { min-height: 18px; color: var(--success); font-size: 13px; }
    .login-submit { width: 100%; margin-top: 4px; }
    .login-secondary-actions { display: flex; justify-content: center; gap: 18px; }
    .login-secondary-actions .login-switch { width: auto; }

    .user-bar { position: fixed; top: 12px; right: 16px; z-index: 9000;
      display: flex; align-items: center; gap: 8px; padding: 6px 10px;
      background: var(--bg-card); border: 1px solid var(--border-subtle);
      border-radius: 999px; box-shadow: 0 2px 8px rgba(20,24,40,.06); font-size: 13px; }
    .user-bar.hidden-bar { display: none; }
    .user-bar .user-name { color: var(--text-primary); font-weight: 600; max-width: 120px;
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .user-bar .user-quota { color: var(--text-secondary); }
    .user-bar .user-role { color: var(--accent-primary); font-weight: 600; }

    /* 编辑器顶栏内的用户区（替代浮窗） */
    .topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px;
      padding: 0 var(--space-3); color: var(--text-secondary); flex-shrink: 0; white-space: nowrap; }
    .topbar-user .user-name { color: var(--text-primary); font-weight: 600;
      max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-user .btn-logout { padding: 4px 8px; font-size: 12px; color: var(--text-tertiary);
      border-radius: var(--radius-sm); }
    .topbar-user .btn-logout:hover { background: var(--bg-hover); color: var(--text-primary); }
    .login-code-row { display: flex; gap: 8px; }
    .login-code-row input { min-width: 0; flex: 1; }
    .login-code-row button { flex: 0 0 auto; white-space: nowrap; }

    /* 上传页顶栏用户区 */
    .upload-topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px;
      color: var(--text-secondary); flex-shrink: 0; white-space: nowrap; }

    /* 超分选项 */
    .sr-chip { transition: all 0.15s ease; }
    .sr-chip:hover { border-color: var(--accent-primary) !important; }

    .modal-wide { max-width: 880px; }
    .modal-narrow { max-width: 440px; }
    .change-password-form { display: grid; gap: 14px; }
    .admin-add { margin-bottom: 20px; }
    .admin-add h3 { margin: 0 0 10px; font-size: 14px; color: var(--text-primary); }
    .admin-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
    .admin-form input { padding: 8px 10px; border: 1px solid var(--border-default);
      border-radius: 8px; font-size: 13px; min-width: 120px; }
    .admin-form input[name=quota_total] { min-width: 110px; }
    .admin-check { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-secondary); }
    .admin-msg { font-size: 12px; color: var(--accent-primary); margin-top: 6px; min-height: 16px; }
    .admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .admin-table th, .admin-table td { padding: 9px 8px; text-align: left;
      border-bottom: 1px solid var(--border-subtle); }
    .admin-table th { color: var(--text-tertiary); font-weight: 500; font-size: 12px; }
    .admin-table td { color: var(--text-primary); }
    .admin-actions { display: flex; gap: 4px; flex-wrap: wrap; }
    .admin-credit-form { display: grid; gap: 2px; }
    .admin-credit-balance { margin-bottom: 12px; padding: 12px 14px; border-radius: 9px;
      background: var(--accent-soft); color: var(--text-secondary); }
    .admin-credit-balance strong { margin: 0 4px; color: var(--accent-primary); font-size: 20px; }
    .admin-credit-hint { margin: -6px 0 8px; color: var(--text-tertiary); font-size: 12px; }
    .me-tag { color: var(--text-tertiary); font-size: 12px; }

    /* ============ 营销首页 / 账户 / 充值 ============ */
    .landing-screen { display: none; position: fixed; inset: 0; z-index: 9999; overflow-y: auto; min-height: 100vh; background: linear-gradient(145deg, #f8fbff 0%, #eff6ff 52%, #fff 100%); color: #10213e; }
    .landing-screen.active { display: block; }
    .landing-nav { max-width: 1120px; margin: 0 auto; height: 76px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; }
    .landing-logo { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
    .landing-logo-mark { display: grid; place-items: center; width: 30px; height: 30px; color: white; background: linear-gradient(135deg, #2563eb, #4f46e5); border-radius: 9px; }
    .landing-nav-actions { display: flex; gap: 10px; white-space: nowrap; }
    .landing-user { align-self: center; color: #52637c; font-size: 13px; font-weight: 600; white-space: nowrap; }
    .landing-main { max-width: 1120px; margin: 0 auto; padding: 54px 28px 72px; }
    .landing-hero { max-width: 780px; margin: 0 auto; text-align: center; }
    .landing-eyebrow { display: inline-flex; padding: 7px 12px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-weight: 700; font-size: 13px; }
    .landing-hero h1 { margin: 20px 0 16px; font-size: clamp(36px, 6vw, 64px); letter-spacing: -2.5px; line-height: 1.12; }
    .landing-hero h1 em { font-style: normal; color: #2563eb; }
    .landing-hero p { margin: 0 auto; max-width: 680px; color: #52637c; font-size: 17px; line-height: 1.85; }
    .landing-cta { display: flex; justify-content: center; gap: 12px; margin-top: 30px; }
    .landing-primary { padding: 13px 20px; font-size: 15px; }
    .landing-convert { min-width: 210px; font-size: 17px; }
    .landing-note { margin-top: 14px; color: #71809a; font-size: 13px; }
    .benefit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 72px; }
    .benefit-grid article { background: rgba(255,255,255,.82); border: 1px solid #dbe5f4; border-radius: 16px; padding: 22px; box-shadow: 0 12px 28px rgba(35, 67, 122, .05); }
    .benefit-grid b { display: block; margin-bottom: 10px; font-size: 16px; }
    .benefit-grid span { color: #62718a; font-size: 13px; line-height: 1.65; }
    .login-card { position: relative; }
    .login-back { position: absolute; top: 16px; right: 18px; color: var(--text-tertiary); font-size: 19px; }
    .login-intro { margin: -14px 0 20px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
    .login-switch { width: 100%; margin-top: 14px; color: var(--accent-primary); font-size: 13px; }
    .recharge-summary { margin-bottom: 18px; padding: 14px 16px; border-radius: 10px; background: var(--accent-soft); color: var(--text-secondary); }
    .recharge-summary strong { margin: 0 6px; color: var(--accent-primary); font-size: 22px; }
    .recharge-summary span { margin-left: 8px; font-size: 12px; }
    .recharge-form { display: grid; grid-template-columns: 200px 1fr auto; gap: 14px; align-items: end; }
    .payment-options { display: flex; gap: 8px; padding-bottom: 1px; }
    .payment-option { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 2px 6px; padding: 9px; border: 1px solid var(--border-default); border-radius: 8px; cursor: pointer; font-size: 13px; }
    .payment-option small { grid-column: 2; color: var(--text-tertiary); font-size: 11px; }
    .payment-option.disabled { cursor: not-allowed; opacity: .55; }
    .recharge-history-title { margin: 26px 0 10px; font-size: 14px; }
    .credit-records-table .credit-change { font-weight: 700; }
    .credit-records-table .is-income { color: #16a34a; }
    .credit-records-table .is-expense { color: #dc2626; }
    .credit-reference { display: block; max-width: 180px; overflow: hidden; color: var(--text-tertiary); font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
    .payment-qrcode { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 16px; border: 1px dashed var(--border-default); border-radius: 10px; }
    .payment-qrcode b { font-size: 20px; color: var(--accent-primary); }
    .payment-qrcode p { margin: 6px 0 0; color: var(--text-secondary); font-size: 12px; }
    @media (max-width: 760px) { .landing-nav, .landing-main { padding-left: 18px; padding-right: 18px; } .landing-nav { height: 64px; } .landing-hero h1 { letter-spacing: -1.4px; } .landing-cta { flex-direction: column; } .benefit-grid { grid-template-columns: 1fr 1fr; margin-top: 44px; } .recharge-form { grid-template-columns: 1fr; } .resume-card { align-items: flex-start; flex-wrap: wrap; } .resume-copy { flex: 1; } .resume-action { width: 100%; margin-left: 0; } .upload-header { align-items: flex-start; } .upload-header > div:last-child { max-width: 100%; overflow-x: auto; } .upload-actions { gap: var(--space-3); } }
    @media (max-width: 440px) { .benefit-grid { grid-template-columns: 1fr; } .landing-nav-actions .btn-ghost { display: none; } }
    @media (max-width: 1100px) {
      .topbar-page-info { max-width: 150px; }
      .topbar-user { gap: 4px; padding: 0 var(--space-1); }
      .topbar-user .btn { padding-left: 8px; padding-right: 8px; }
    }
    @media (max-width: 760px) {
      .editor-topbar { padding-left: var(--space-3); padding-right: var(--space-3); }
      .topbar-group { margin-left: calc(-1 * var(--space-3)); margin-right: calc(-1 * var(--space-3)); padding-left: var(--space-3); padding-right: var(--space-3); }
      .topbar-page-info, .editor-topbar > .topbar-divider { display: none; }
    }
