/* ============================================================
   PDF转换批注助手 · 网页版编辑器样式
   复用扩展 UI 风格，适配网页端布局
   ============================================================ */
:root {
  --bg: #F7F7F5;
  --surface: #FFFFFF;
  --surface-2: #FBFBFA;
  --border: #ECECEA;
  --text: #37352F;
  --text-2: #6B6A66;
  --text-3: #9B9A97;
  --accent: #FF6B6B;
  --accent-hover: #F25252;
  --accent-soft: #FFECEC;
  --ok: #2FA372;
  --ok-soft: #E7F6EE;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  color: var(--text); background: var(--bg);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all .15s; cursor: pointer; border: 1.5px solid transparent;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-sm { padding: 5px 14px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ========== 顶栏 ========== */
.topbar {
  height: 54px; display: flex; align-items: center; padding: 0 20px;
  background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border); position: relative; z-index: 50;
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  max-width: 1600px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-icon {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #FF8A8A, var(--accent));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px;
}
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.brand-sub { font-size: 11px; color: var(--text-3); font-weight: 500; background: var(--ok-soft); color: var(--ok); padding: 1px 8px; border-radius: 4px; }
.brand-hint { font-size: 10px; color: #fff; background: linear-gradient(135deg, #7C3AED, #A78BFA); padding: 2px 7px; border-radius: 4px; margin-left: 4px; font-weight: 600; cursor: help; }
.user-area { display: flex; align-items: center; gap: 10px; }

/* 已登录：用户头像 chip（Notion 风格） */
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 12px 3px 3px; border-radius: 999px;
  background: #F3F4F6;
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
  user-select: none;
}
.user-chip:hover { background: #E5E7EB; transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.user-chip .user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #1F2937; color: #fff; font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.user-chip .user-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.user-chip .user-email { font-size: 12.5px; font-weight: 600; color: #374151; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .user-plan { font-size: 10.5px; line-height: 1; font-weight: 600; padding: 1px 6px; border-radius: 4px; display: inline-block; }
.user-chip .user-plan.pro { background: #ECFDF5; color: #059669; }
.user-chip .user-plan.free { background: #E5E7EB; color: #6B7280; }
.user-status { font-size: 12.5px; color: var(--text-3); padding: 4px 10px; background: var(--bg); border-radius: 6px; }

/* ========== 上传区 ========== */
.upload-zone {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: var(--bg);
}
.upload-inner {
  text-align: center; max-width: 480px; padding: 48px;
  border: 2px dashed var(--border); border-radius: 18px;
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.upload-zone.drag-over .upload-inner,
.upload-inner:hover {
  border-color: var(--accent); background: var(--accent-soft);
}
.upload-icon { margin-bottom: 20px; }
.upload-inner h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.upload-inner p { color: var(--text-3); font-size: 14px; margin-bottom: 24px; }
.upload-note { margin-top: 20px; font-size: 12.5px; color: var(--text-3); }

/* ========== 编辑器区域 ========== */
.editor-area {
  position: absolute; inset: 0;
  top: 54px; /* 顶栏高度 */
  display: flex; flex-direction: column;
}

/* 工具栏 */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  min-height: 46px; gap: 8px; flex-shrink: 0;
  z-index: 40;
}
.toolbar-left, .toolbar-center, .toolbar-right {
  display: flex; align-items: center; gap: 4px;
}
.tool-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-2); transition: all .15s; white-space: nowrap;
}
.tool-btn:hover { background: var(--bg); color: var(--text); }
.tool-btn.active { background: var(--accent-soft); color: var(--accent); }
.toolbar-sep { width: 1px; height: 24px; background: var(--border); margin: 0 6px; }

/* 子工具栏（批注工具） */
.sub-tools { display: flex; align-items: center; gap: 2px; }
.sub-btn {
  width: 32px; height: 32px; border-radius: 6px;
  display: grid; place-items: center; color: var(--text-2);
  transition: all .12s;
}
.sub-btn:hover { background: var(--bg); color: var(--text); }
.sub-btn.active { background: var(--accent); color: #fff !important; }
.color-picker { display: flex; gap: 4px; margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--border); }
.color-dot {
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform .12s;
}
.color-dot.active, .color-dot:hover { border-color: var(--text); transform: scale(1.2); }

.doc-info { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }

/* ===== 工作区：PDF + 侧栏 ===== */
.workspace {
  display: flex; flex: 1; overflow: hidden;
}

/* PDF 渲染区 */
.pdf-viewer {
  flex: 1; position: relative; overflow: hidden;
  background: #e8e8e6; display: grid; place-items: center;
}
#pdfCanvas { max-width: 100%; max-height: 100%; box-shadow: 0 2px 16px rgba(0,0,0,.08); }
.annotation-layer {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; overflow: hidden;
}
.annotation-layer * { pointer-events: auto; }

.zoom-bar {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  padding: 6px 14px; border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08); font-size: 13px; font-weight: 600;
  z-index: 30;
}
.zoom-bar button { width: 28px; height: 28px; border-radius: 6px; font-size: 18px; }
.zoom-bar button:hover { background: var(--bg); }

.page-nav {
  position: absolute; top: 16px; right: 16px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  padding: 6px 14px; border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08); font-size: 12.5px;
  z-index: 30;
}
.page-nav button { width: 26px; height: 26px; border-radius: 6px; font-size: 18px; line-height: 1; }
.page-nav button:hover { background: var(--bg); }

/* ===== 侧边面板 ===== */
.side-panel {
  width: 300px; min-width: 280px; background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.panel-tabs {
  display: flex; border-bottom: 1px solid var(--border);
}
.panel-tab {
  flex: 1; padding: 10px; font-size: 12.5px; font-weight: 600;
  color: var(--text-3); text-align: center; cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .15s;
}
.panel-tab:hover { color: var(--text); }
.panel-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.panel-body {
  display: none; flex: 1; overflow-y: auto; padding: 16px;
}
.panel-body.active { display: block; }

/* 空状态 */
.empty-state { text-align: center; padding: 40px 16px; color: var(--text-3); }
.empty-state p { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.empty-state small { font-size: 12px; }

/* 批注列表 */
.anno-list { list-style: none; padding: 0; }
.anno-item {
  display: flex; gap: 10px; padding: 10px 12px;
  border-radius: 10px; margin-bottom: 8px;
  background: var(--surface); cursor: pointer; transition: all .15s;
  border: 1px solid var(--border);
}
.anno-item:hover { background: var(--surface-2); border-color: var(--accent); transform: translateX(2px); }
.anno-item.active { background: var(--accent-soft); border-color: var(--accent); }
.anno-num {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.anno-text { font-size: 13px; color: var(--text-2); line-height: 1.4; overflow: hidden; flex: 1; }
.anno-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.anno-status-badge-row { margin: 3px 0 1px; }
.anno-status-badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 20px; }

/* 导出卡片网格 */
.export-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px;
}
.export-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 10px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--bg); cursor: pointer; transition: all .15s; position: relative;
}
.export-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.export-icon { font-size: 24px; font-weight: 800; }
.export-card strong { font-size: 13px; }
.export-card small { font-size: 11px; color: var(--text-3); }
.pro-badge {
  position: absolute; top: 6px; right: 6px;
  font-size: 9px; font-weight: 700; color: var(--accent); background: var(--accent-soft);
  padding: 1px 6px; border-radius: 4px;
}
.export-hint { font-size: 11.5px; color: var(--text-3); line-height: 1.55; }

/* AI 面板 */
.ai-select label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ai-select select {
  width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
  font-family: inherit; font-size: 13.5px; background: var(--surface);
  margin-bottom: 12px; cursor: pointer;
}
#aiPrompt {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  font-family: inherit; font-size: 13.5px; resize: vertical;
  margin-bottom: 12px; background: var(--surface);
}

.ai-result {
  margin-top: 14px; padding: 14px; border-radius: 10px;
  background: var(--bg); font-size: 13.5px; line-height: 1.65; white-space: pre-wrap;
  max-height: 400px; overflow-y: auto;
}

.ai-progress { margin-top: 14px; }
.progress-bar {
  height: 6px; border-radius: 3px; background: var(--border); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), #FF8E53);
  border-radius: 3px; animation: progressAnim 2s ease-in-out infinite;
}
@keyframes progressAnim { 0%{width:0%} 50%{width:70%} 100%{width:100%} }
.progress-text { font-size: 12px; color: var(--text-3); margin-top: 8px; text-align: center; }

/* ===== 状态三色 + 身份面板 + 法域标签 ===== */
:root {
  --st-red: #EF4444;     /* 待修改 */
  --st-red-soft: #FEE2E2;
  --st-yellow: #F59E0B;  /* 争议中 */
  --st-yellow-soft: #FEF3C7;
  --st-green: #22C55E;   /* 已确认 */
  --st-green-soft: #DCFCE7;
}

/* 法域识别标签组 */
.juris-tags { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.jtag {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(124,58,237,.08), rgba(255,107,107,.08));
  border: 1px solid rgba(124,58,237,.18);
  font-size: 12.5px; font-weight: 600; color: var(--text);
  animation: jtagIn .4s ease both;
}
.jtag .jtag-ico { font-size: 14px; }
.jtag .jtag-txt { line-height: 1.35; }
.jtag b { color: #7C3AED; }
.jtag.unknown { background: var(--bg); border-color: var(--border); }
.jtag.unknown b { color: var(--text-2); }
@keyframes jtagIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* 身份配置面板 */
.identity-panel {
  background: linear-gradient(160deg, #fff, #FBF7FF);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; margin-bottom: 16px;
  box-shadow: 0 4px 18px rgba(124,58,237,.06);
}
.identity-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.identity-head strong { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.identity-head strong::before { content: '🎯'; }
.identity-head small { font-size: 11.5px; color: var(--text-3); }
.identity-label { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 10px 0 7px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 7px 13px; border-radius: 20px; font-size: 12.5px; font-weight: 600;
  background: var(--surface); border: 1.5px solid var(--border); color: var(--text-2);
  cursor: pointer; transition: all .14s; user-select: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.chip.active {
  background: linear-gradient(135deg, #7C3AED, #A78BFA); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(124,58,237,.3);
}

/* ===== 圈选批注弹窗 ===== */
.anno-popup-overlay {
  position: fixed; inset: 0; z-index: 320;
  background: rgba(0,0,0,.35); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
}
.anno-popup {
  width: 420px; max-width: 94vw; background: var(--surface);
  border-radius: 16px; padding: 22px; box-shadow: 0 24px 70px rgba(15,15,15,.22);
  animation: popIn .22s ease;
}
@keyframes popIn { from { opacity: 0; transform: scale(.95) translateY(8px); } to { opacity: 1; transform: none; } }
.anno-popup h3 { font-size: 17px; margin-bottom: 12px; }
.anno-ctx {
  font-size: 12px; color: var(--text-2); background: var(--bg);
  border-left: 3px solid var(--accent); border-radius: 6px;
  padding: 8px 10px; margin-bottom: 12px; max-height: 64px; overflow-y: auto;
  line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.anno-popup textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  font-family: inherit; font-size: 13.5px; resize: vertical; margin-bottom: 12px; background: var(--surface);
}
.anno-status-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.anno-status-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.status-dot {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: all .14s;
}
.status-dot span { width: 12px; height: 12px; border-radius: 50%; background: transparent; transition: all .14s; }
.status-dot.st-todo { border-color: var(--st-red); } .status-dot.st-todo span { background: var(--st-red); }
.status-dot.st-discuss { border-color: var(--st-yellow); } .status-dot.st-discuss span { background: var(--st-yellow); }
.status-dot.st-approved { border-color: var(--st-green); } .status-dot.st-approved span { background: var(--st-green); }
.status-dot:not(.active) span { opacity: .25; transform: scale(.7); }
.status-dot.active { box-shadow: 0 0 0 3px rgba(0,0,0,.06); transform: scale(1.08); }
.anno-popup-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mw-btn {
  color: #7C3AED; background: rgba(124,58,237,.08); border: 1px solid rgba(124,58,237,.2);
  padding: 7px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; transition: all .14s;
}
.mw-btn:hover { background: rgba(124,58,237,.16); }
.mw-btn:disabled { opacity: .55; cursor: not-allowed; }
.mw-btn .mw-ico { animation: none; }
.mw-btn.working .mw-ico { animation: spin 1s linear infinite; }
.anno-popup-right { display: flex; gap: 8px; }

/* ===== 磨砂玻璃导出预览 ===== */
.glass-overlay {
  position: fixed; inset: 0; z-index: 340;
  background: rgba(20,18,30,.55); backdrop-filter: saturate(160%) blur(10px);
  display: grid; place-items: center; padding: 24px; animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.glass-modal {
  position: relative; width: 940px; max-width: 96vw; max-height: 92vh; overflow: hidden;
  background: rgba(255,255,255,.72); backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255,255,255,.6); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(15,15,35,.35);
  display: flex; flex-direction: column; animation: popIn .28s ease;
}
.glass-close {
  position: absolute; top: 14px; right: 16px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1;
  background: rgba(255,255,255,.6); color: var(--text-2); cursor: pointer;
}
.glass-close:hover { background: #fff; color: var(--text); }
.glass-head { padding: 22px 26px 12px; }
.glass-head h2 { font-size: 20px; font-weight: 800; }
.glass-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.glass-body { display: flex; gap: 18px; padding: 6px 26px 18px; overflow: hidden; flex: 1; min-height: 0; }
.glass-preview {
  position: relative; flex: 1.4; min-width: 0; border-radius: 14px; overflow: hidden;
  background: #f0f0ee; display: grid; place-items: center; max-height: 60vh;
}
.glass-doc { width: 100%; height: 100%; display: grid; place-items: center; padding: 12px; }
.glass-doc canvas { max-width: 100%; max-height: 100%; box-shadow: 0 6px 24px rgba(0,0,0,.15); border-radius: 4px; }
.glass-watermark {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-size: 26px; font-weight: 800; letter-spacing: 2px; color: rgba(120,120,120,.22);
  transform: rotate(-24deg); background: repeating-linear-gradient(45deg, transparent, transparent 60px, rgba(120,120,120,.04) 60px, rgba(120,120,120,.04) 120px);
}
.glass-watermark.hidden { display: none; }
.glass-lane {
  flex: 1; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  max-height: 60vh; padding-right: 4px;
}
.glass-lane .empty-lane { color: var(--text-3); font-size: 13px; text-align: center; padding: 30px 10px; }
.glass-card {
  background: var(--surface); border-radius: 12px; padding: 10px 12px;
  border-left: 4px solid var(--border); box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.glass-card.st-todo { border-left-color: var(--st-red); }
.glass-card.st-discuss { border-left-color: var(--st-yellow); }
.glass-card.st-approved { border-left-color: var(--st-green); }
.glass-card .gc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.glass-card .gc-num { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.glass-card .gc-badge { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.glass-card.st-todo .gc-badge { background: var(--st-red-soft); color: var(--st-red); }
.glass-card.st-discuss .gc-badge { background: var(--st-yellow-soft); color: #B45309; }
.glass-card.st-approved .gc-badge { background: var(--st-green-soft); color: #15803D; }
.glass-card .gc-text { font-size: 12.5px; color: var(--text-2); line-height: 1.45; word-break: break-word; }
.glass-card .gc-page { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.glass-paywall {
  margin: 0 26px 14px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,107,107,.1), rgba(124,58,237,.1));
  border: 1px solid rgba(124,58,237,.18);
}
.glass-paywall p { font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin-bottom: 10px; }
.glass-paywall.pro { background: var(--st-green-soft); border-color: rgba(34,197,94,.3); }
.glass-actions { display: flex; gap: 8px; }
.glass-formats {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 0 26px 22px;
}
.glass-formats .gf-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600; border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; transition: all .14s;
}
.glass-formats .gf-btn:hover { border-color: var(--accent); color: var(--accent); }
.glass-formats .gf-btn.pro { background: var(--accent); color: #fff; border-color: var(--accent); }
.glass-formats .gf-btn.pro:hover { background: var(--accent-hover); }
.glass-formats .gf-btn .lock { font-size: 11px; }

/* ===== 登录弹窗 ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.35); backdrop-filter: blur(4px);
  display: grid; place-items: center;
}
.modal {
  background: var(--surface); border-radius: 18px;
  padding: 36px; width: 400px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.modal-close {
  float: right; font-size: 24px; color: var(--text-3); line-height: 1;
  cursor: pointer; background: none; border: none;
}
.modal h2 { font-size: 22px; margin-bottom: 20px; }
.login-methods { display: flex; gap: 10px; margin-bottom: 20px; }
.login-method { flex: 1; padding: 12px; border-radius: 10px; }
.login-note { font-size: 12px; color: var(--text-3); margin-top: 14px; text-align: center; }
#emailInput {
  width: 100%; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border);
  font-family: inherit; font-size: 14px; margin-bottom: 12px; outline: none;
}
#emailInput:focus { border-color: var(--accent); }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #D9D9D5; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #C4C4BF; background-clip: padding-box; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .side-panel { width: 260px; min-width: 240px; }
  .toolbar { flex-wrap: wrap; padding: 6px 12px; }
  .sub-tools { display: none; } /* 简化移动端工具栏 */
}
@media (max-width: 720px) {
  .side-panel { position: fixed; right: 0; top: 54px; bottom: 0; z-index: 60; box-shadow: -4px 0 20px rgba(0,0,0,.1); transform: translateX(100%); transition: transform .25s; }
  .side-panel.open { transform: translateX(0); }
  .export-grid { grid-template-columns: 1fr 1fr; }
}

/* ========== 拟人化上传动效 ========== */
.upload-progress {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(247,247,245,.78); backdrop-filter: saturate(180%) blur(8px);
  display: grid; place-items: center; padding: 24px;
}
.up-card {
  width: 420px; max-width: 92vw; padding: 28px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: 0 24px 60px rgba(15,15,15,.14);
  text-align: center;
}
.up-window {
  position: relative; width: 100%; aspect-ratio: 16/10;
  border-radius: 14px; overflow: hidden; margin-bottom: 22px;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.5), 0 8px 20px rgba(15,15,15,.10);
}
.up-sky {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #BFE9FF 0%, #E3F4FF 55%, #FBF7E8 100%);
}
.up-sun {
  position: absolute; top: 14%; right: 16%; width: 46px; height: 46px;
  border-radius: 50%; background: radial-gradient(circle at 50% 50%, #FFE08A, #FFC83D);
  box-shadow: 0 0 0 6px rgba(255,200,61,.25), 0 0 28px rgba(255,200,61,.55);
  animation: upSun 4s ease-in-out infinite;
}
@keyframes upSun { 0%,100%{ transform: translateY(0) scale(1); } 50%{ transform: translateY(-4px) scale(1.06); } }
.up-cloud {
  position: absolute; height: 16px; border-radius: 16px;
  background: rgba(255,255,255,.9);
  box-shadow: 18px 6px 0 -2px rgba(255,255,255,.9), -16px 4px 0 -3px rgba(255,255,255,.85);
}
.up-cloud-1 { top: 22%; left: -30%; width: 54px; animation: upCloud 9s linear infinite; }
.up-cloud-2 { top: 40%; left: -45%; width: 38px; opacity: .8; animation: upCloud 13s linear infinite 2s; }
@keyframes upCloud { from { transform: translateX(0); } to { transform: translateX(220px); } }
.up-mountains {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background:
    radial-gradient(60px 50px at 22% 100%, #9FD8B0 0 99%, transparent 100%),
    radial-gradient(80px 64px at 55% 100%, #7FC79A 0 99%, transparent 100%),
    radial-gradient(70px 52px at 85% 100%, #A9DEB8 0 99%, transparent 100%);
}
.up-bird {
  position: absolute; width: 14px; height: 8px;
  border-top: 2px solid #5B6B73; border-radius: 50%;
  transform: rotate(20deg);
  animation: upBird 5s ease-in-out infinite;
}
.up-bird-1 { top: 30%; left: 30%; }
.up-bird-2 { top: 38%; left: 42%; animation-delay: 1.4s; }
@keyframes upBird { 0%,100%{ transform: translate(0,0) rotate(20deg);} 50%{ transform: translate(10px,-6px) rotate(20deg);} }
.up-plant { position: absolute; right: 12%; bottom: 6%; width: 34px; height: 46px; }
.up-pot { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 22px; height: 18px; background: #D98C5F; border-radius: 3px 3px 6px 6px; }
.up-leaf { position: absolute; bottom: 14px; left: 50%; width: 14px; height: 26px; background: #5BBF7A; border-radius: 0 100% 0 100%; transform-origin: bottom center; }
.up-leaf-1 { transform: translateX(-50%) rotate(-22deg); animation: upLeaf 3.5s ease-in-out infinite; }
.up-leaf-2 { transform: translateX(-50%) rotate(20deg); animation: upLeaf 3.5s ease-in-out infinite .6s; }
@keyframes upLeaf { 0%,100%{ transform: translateX(-50%) rotate(var(--r,0deg)); } 50%{ transform: translateX(-50%) rotate(calc(var(--r,0deg) + 4deg)); } }
.up-leaf-1 { --r: -22deg; } .up-leaf-2 { --r: 20deg; }
.up-window-label {
  position: absolute; left: 8px; bottom: 6px; font-size: 10px;
  color: #6B6A66; background: rgba(255,255,255,.7); padding: 2px 8px; border-radius: 6px;
}
.up-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.up-steps { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.up-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: .5; transition: opacity .3s; }
.up-step.active, .up-step.done { opacity: 1; }
.up-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--border); border: 2px solid var(--border); transition: all .3s;
}
.up-step.active .up-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.up-step.done .up-dot { background: var(--ok); border-color: var(--ok); }
.up-label { font-size: 11.5px; color: var(--text-2); font-weight: 600; line-height: 1.3; }
.up-bar { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; margin-bottom: 14px; }
.up-fill { height: 100%; width: 33%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #FF8E53); transition: width .5s ease; }
.up-tip { font-size: 13px; color: var(--text-3); line-height: 1.6; min-height: 40px; }

@media (max-width: 720px) {
  .up-card { padding: 22px; }
  .up-label { font-size: 10.5px; }
}

/* ========== 邮箱登录等待确认面板 ========== */
.login-waiting { max-width: 420px; padding: 32px 28px 24px; text-align: center; }
.login-waiting h2 { font-size: 18px; margin: 0 0 14px; }
.waiting-icon { font-size: 56px; margin: 0 auto 16px; line-height: 1; }
.waiting-icon .mail-anim { display: inline-block; animation: mailBounce 1.8s ease-in-out infinite; }
@keyframes mailBounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  20% { transform: translateY(-8px) rotate(-6deg); }
  40% { transform: translateY(0) rotate(6deg); }
  60% { transform: translateY(-4px) rotate(0); }
}
.waiting-msg { font-size: 14px; color: var(--text); margin: 0 0 4px; font-weight: 600; }
.waiting-email { font-size: 13px; color: var(--text-3); margin: 0 0 20px; word-break: break-all; }
.waiting-tips { background: var(--bg); border-radius: 10px; padding: 14px 16px; text-align: left; margin-bottom: 18px; }
.waiting-tip { font-size: 12.5px; color: var(--text-2); line-height: 1.7; padding-left: 18px; position: relative; }
.waiting-tip::before { content: '•'; position: absolute; left: 6px; color: var(--accent); font-weight: 700; }
.waiting-spinner { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; height: 18px; }
.waiting-spinner .spinner-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: spinDot 1.2s ease-in-out infinite;
}
.waiting-spinner .spinner-dot:nth-child(2) { animation-delay: .15s; }
.waiting-spinner .spinner-dot:nth-child(3) { animation-delay: .3s; }
@keyframes spinDot { 0%, 100% { transform: scale(.6); opacity: .3; } 50% { transform: scale(1); opacity: 1; } }
.waiting-actions { display: flex; gap: 8px; justify-content: center; }

/* ========== 个人中心面板（Notion/Figma 极简风格） ========== */
.user-panel { max-width: 440px; padding: 0; text-align: left; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 40px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06); }
.user-panel .modal-close { top: 18px; right: 18px; font-size: 22px; color: #9CA3AF; width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: .15s; background: #F3F4F6; }
.user-panel .modal-close:hover { background: #E5E7EB; color: #374151; }
.user-panel-head {
  display: flex; align-items: center; gap: 16px;
  padding: 28px 28px 22px;
  background: #fff;
  border-bottom: 1px solid #F3F4F6;
  position: relative;
}
.user-panel-head .user-avatar-lg {
  width: 52px; height: 52px; border-radius: 14px;
  background: #1F2937; color: #fff; font-size: 22px; font-weight: 700;
  display: grid; place-items: center;
  flex-shrink: 0; letter-spacing: 0;
}
.user-panel-head > div:nth-child(2) { flex: 1; min-width: 0; }
.user-panel-name { font-size: 15px; font-weight: 600; color: #111827; margin-bottom: 3px; line-height: 1.3; }
.user-panel-email { font-size: 13px; color: #6B7280; word-break: break-all; font-weight: 400; }
.user-panel-plan {
  position: absolute; top: 28px; right: 50px;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  background: #F3F4F6; color: #6B7280;
  letter-spacing: .3px;
}
.user-panel-plan.pro { background: #ECFDF5; color: #059669; }
.user-panel-plan.free { background: #F3F4F6; color: #6B7280; }

.user-panel-section { padding: 20px 28px; border-bottom: 1px solid #F3F4F6; }
.user-panel-section:last-of-type { border-bottom: none; padding-bottom: 16px; }
.user-panel-section-title {
  font-size: 11px; font-weight: 600; color: #9CA3AF;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.user-panel-section-title::after { content: ''; flex: 1; height: 1px; background: #F3F4F6; }

.user-panel-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; min-height: 40px;
}
.user-panel-row span:first-child { font-size: 13.5px; color: #374151; font-weight: 500; }
.user-panel-row + .user-panel-row { border-top: 1px solid #F9FAFB; }

.serial-input { display: flex; gap: 8px; flex: 1; max-width: 260px; }
.serial-input input {
  flex: 1; padding: 7px 12px; border: 1.5px solid #E5E7EB; border-radius: 8px;
  font-size: 13px; outline: none; background: #F9FAFB; transition: border-color .15s, background .15s;
}
.serial-input input:focus { border-color: #2563EB; background: #fff; }

.invite-row { display: flex; gap: 8px; align-items: center; }
.invite-row code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px; background: #F3F4F6; padding: 4px 10px; border-radius: 6px;
  color: #374151; letter-spacing: .5px; font-weight: 600;
}

.user-panel-footer { padding: 12px 28px 22px; display: flex; justify-content: center; }
.user-panel-footer .btn-ghost { color: #9CA3AF; font-size: 13px; font-weight: 500; transition: color .15s; }
.user-panel-footer .btn-ghost:hover { color: #EF4444; }

/* 面板内的身份配置 */
.user-panel .identity-panel { padding: 0; margin-top: 4px; }
.user-panel .chip-group { margin-bottom: 14px; }
.user-panel .identity-label { font-size: 12px; font-weight: 600; color: #6B7280; margin: 0 0 8px; }

/* 自定义身份输入 */
.custom-chip-row { display: flex; gap: 8px; margin-top: 10px; }
.custom-chip-row input {
  flex: 1; padding: 7px 12px; border: 1.5px solid #E5E7EB; border-radius: 8px;
  font-size: 13px; outline: none; background: #F9FAFB; transition: border-color .15s, background .15s;
}
.custom-chip-row input:focus { border-color: #2563EB; background: #fff; }
.custom-chip-row .btn-add {
  font-size: 12.5px; font-weight: 600; color: #6B7280; background: #F3F4F6;
  border: 1.5px solid #E5E7EB; padding: 7px 14px; border-radius: 8px;
  cursor: pointer; white-space: nowrap; transition: .15s;
  display: flex; align-items: center;
}
.custom-chip-row .btn-add::before { content: '+'; font-size: 16px; font-weight: 400; margin-right: 2px; }
.custom-chip-row .btn-add:hover { background: #E5E7EB; color: #374151; border-color: #D1D5DB; }

/* 自定义 chip（可删除） */
.chip.custom-chip {
  background: #F0F5FF; border-color: #BFDBFE; color: #1D4ED8;
  position: relative; padding-right: 28px; font-weight: 500;
}
.chip.custom-chip::after {
  content: '\00d7'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: #93C5FD; transition: color .15s; line-height: 1;
}
.chip.custom-chip:hover { background: #DBEAFE; }
.chip.custom-chip:hover::after { color: #EF4444; }
