/* ===========================================================
   PDF转换批注助手 — 设计规范 (Notion / 现代大厂风格)
   低饱和灰白基调 · 珊瑚橙 #FF6B6B 操作色 · 圆角 · 柔和阴影
   =========================================================== */
:root {
  --bg: #F7F7F5;
  --surface: #FFFFFF;
  --surface-2: #FBFBFA;
  --surface-3: #F1F1EF;
  --border: #ECECEA;
  --border-strong: #E0E0DD;
  --text: #37352F;
  --text-2: #6B6A66;
  --text-3: #9B9A97;
  --accent: #FF6B6B;
  --accent-hover: #F25252;
  --accent-soft: #FFECEC;
  --accent-ink: #C2410C;
  --ok: #2FA372;
  --ok-soft: #E7F6EE;
  --warn: #E0A321;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(15, 15, 15, .04);
  --shadow-sm: 0 1px 2px rgba(15, 15, 15, .05), 0 2px 6px rgba(15, 15, 15, .04);
  --shadow: 0 6px 20px rgba(15, 15, 15, .07), 0 2px 6px rgba(15, 15, 15, .04);
  --shadow-lg: 0 18px 48px rgba(15, 15, 15, .12);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--accent-soft); }

/* 滚动条 */
.scroll::-webkit-scrollbar, .pdf-area::-webkit-scrollbar, .side-panel::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb, .pdf-area::-webkit-scrollbar-thumb, .side-panel::-webkit-scrollbar-thumb {
  background: #D9D9D5; border-radius: 8px; border: 3px solid transparent; background-clip: padding-box;
}
.scroll::-webkit-scrollbar-thumb:hover { background: #C4C4BF; background-clip: padding-box; }

/* ===================== 顶栏 ===================== */
.topbar {
  height: 56px; display: flex; align-items: center; gap: 16px;
  padding: 0 18px; background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.2px; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #FF8A8A, var(--accent));
  color: #fff; box-shadow: 0 4px 12px rgba(255,107,107,.35);
}
.brand .logo svg { width: 17px; height: 17px; }
.brand .name { font-size: 15px; }
.brand .sub { font-size: 11px; color: var(--text-3); font-weight: 500; margin-left: 2px; }

.doc-meta { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; }
.doc-meta .fname { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 550; }
.doc-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

/* 模式切换（分段控件） */
.mode-switch {
  display: flex; background: var(--surface-3); padding: 3px; border-radius: 11px; gap: 2px;
  box-shadow: inset 0 1px 2px rgba(15,15,15,.04);
}
.mode-switch button {
  display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 550; color: var(--text-2); transition: all .18s ease;
}
.mode-switch button svg { width: 15px; height: 15px; }
.mode-switch button:hover { color: var(--text); }
.mode-switch button.active {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
}
.mode-switch button.active[data-mode="annotate"] { color: var(--accent); }
.mode-switch button.beta { opacity: .55; cursor: default; pointer-events: none; position: relative; }
.beta-tag { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 6px; background: var(--surface-3); color: var(--text-3); margin-left: 2px; letter-spacing: .3px; }

.spacer { flex: 1; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 550; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); transition: all .16s ease; box-shadow: var(--shadow-xs);
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(255,107,107,.3); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.icon { padding: 8px; }

.pro-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 650; cursor: pointer; transition: all .16s ease;
  background: linear-gradient(135deg, #FFE7C2, #FFD8A8); color: #9A5B00;
  border: 1px solid #F3C277;
}
.pro-pill.pro { background: linear-gradient(135deg, #37352F, #4A4750); color: #FFE7C2; border-color: #4A4750; }
.pro-pill:hover { filter: brightness(1.03); }

#accountArea { margin-left: 4px; }
.account-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 550;
  cursor: pointer; transition: all .16s ease; box-shadow: var(--shadow-xs);
}
.account-btn:hover { background: var(--surface-2); color: var(--text); }
.account-btn.login { color: var(--accent); border-color: var(--accent-soft); background: #FFF8F5; }
.acc-ico { display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; }
.account-btn svg { width: 16px; height: 16px; }
.avatar-img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.avatar-ch { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.acc-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.login-menu {
  position: absolute; top: 58px; right: 18px; width: 280px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 14px; z-index: 100; animation: fadeUp .18s ease;
}
.lm-title { font-size: 13px; font-weight: 650; color: var(--text-2); margin-bottom: 10px; }
.provider-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 550;
  cursor: pointer; margin-bottom: 8px; transition: all .16s ease;
}
.provider-btn:hover { background: var(--surface); border-color: var(--border-strong); }
.provider-btn .p-ico { width: 18px; height: 18px; display: grid; place-items: center; color: var(--text-2); }
.provider-btn svg { width: 18px; height: 18px; }
.lm-hint { font-size: 12px; color: var(--text-3); line-height: 1.5; margin-top: 6px; }
.am-name { font-size: 14px; font-weight: 650; color: var(--text); margin-bottom: 2px; }
.am-email { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.am-mem { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.am-mem.pro { color: var(--accent); font-weight: 600; }

/* ===================== 工具栏 ===================== */
.toolbar {
  height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 14px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 20;
  overflow-x: auto; scrollbar-width: none;
}
.toolbar::-webkit-scrollbar { display: none; }
.tool-group { display: flex; align-items: center; gap: 4px; }
.tool-sep { width: 1px; height: 24px; background: var(--border); margin: 0 6px; }

.tool {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border-radius: 9px;
  font-size: 13px; font-weight: 520; color: var(--text-2); transition: all .15s ease; position: relative; white-space: nowrap;
}
.tool svg { width: 17px; height: 17px; }
.tool:hover { background: var(--surface-3); color: var(--text); }
.tool.active { background: var(--accent-soft); color: var(--accent); }
.tool.active::after {
  content: ""; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 3px; border-radius: 3px; background: var(--accent);
}

/* 样式控制区 */
.style-ctrl { display: flex; align-items: center; gap: 10px; padding-left: 4px; }
.swatch-row { display: flex; gap: 6px; align-items: center; }
.swatch { width: 20px; height: 20px; border-radius: 50%; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-strong); transition: transform .12s ease; }
.swatch:hover { transform: scale(1.12); }
.swatch.sel { box-shadow: 0 0 0 2px var(--accent); }
.preset-select {
  height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
  padding: 0 10px; font-size: 12.5px; color: var(--text); font-family: inherit; cursor: pointer;
}
.range { width: 86px; accent-color: var(--accent); }

/* 更多弹层 */
.popover {
  position: absolute; top: 50px; right: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px; width: 240px; z-index: 40; display: none;
}
.popover.show { display: block; animation: pop .16s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.popover h4 { margin: 0 0 10px; font-size: 12px; color: var(--text-3); font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }

/* ===================== 工作区 ===================== */
.workspace { display: flex; height: calc(100vh - 108px); position: relative; }

.pdf-area {
  flex: 1; overflow: auto; padding: 28px 0 80px; position: relative;
  background:
    radial-gradient(circle at 1px 1px, rgba(15,15,15,.035) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg);
}
.page-list { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.page-wrapper {
  position: relative; background: #fff; border-radius: 6px; box-shadow: var(--shadow);
  overflow: hidden;
}
.page-canvas { display: block; }
.anno-layer { position: absolute; left: 0; top: 0; pointer-events: none; }
.anno-layer.interactive { pointer-events: auto; }

.page-num-badge {
  position: absolute; left: 10px; bottom: 10px; background: rgba(55,53,47,.72); color: #fff;
  font-size: 11px; padding: 2px 9px; border-radius: 999px; backdrop-filter: blur(4px); pointer-events: none;
  opacity: 0; transition: opacity .2s; z-index: 5;
}
.page-wrapper:hover .page-num-badge { opacity: 1; }

/* 空状态 */
.empty-state {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.empty-card {
  width: min(520px, 90%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 38px 34px; text-align: center;
}
.empty-card .ico { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(135deg, #FFF1F1, #FFE3E3); color: var(--accent); }
.empty-card .ico svg { width: 32px; height: 32px; }
.empty-card h2 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.3px; }
.empty-card p { margin: 0 0 22px; color: var(--text-2); font-size: 13.5px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dropzone.hover { outline: 2px dashed var(--accent); outline-offset: -8px; background: var(--accent-soft); }

/* 加载遮罩 */
.loading-overlay {
  position: absolute; inset: 0; background: rgba(247,247,245,.7); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 25; flex-direction: column; gap: 14px;
}
.loading-overlay.show { display: flex; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 缩放浮控 */
.zoom-dock {
  position: absolute; right: 22px; bottom: 22px; display: flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; z-index: 15;
}
.zoom-dock button { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); }
.zoom-dock button:hover { background: var(--surface-3); color: var(--text); }
.zoom-dock .zlabel { min-width: 48px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--text-2); }

/* ===================== 右侧面板 ===================== */
.side-panel {
  width: 340px; min-width: 340px; background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; transition: width .2s ease, margin-right .2s ease;
  overflow: hidden;
}
.side-panel.collapsed { margin-right: -340px; }
.side-tabs { display: flex; padding: 8px 10px 0; gap: 4px; border-bottom: 1px solid var(--border); }
.side-tab {
  flex: 1; padding: 9px 8px; font-size: 13px; font-weight: 560; color: var(--text-3); border-radius: 8px 8px 0 0;
  display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .15s; position: relative;
}
.side-tab svg { width: 15px; height: 15px; }
.side-tab:hover { color: var(--text); background: var(--surface-2); }
.side-tab.active { color: var(--text); }
.side-tab.active::after { content: ""; position: absolute; bottom: -1px; left: 14px; right: 14px; height: 2px; background: var(--accent); border-radius: 2px; }
.side-body { flex: 1; overflow: auto; padding: 14px; position: relative; }
.side-foot { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.collapse-btn { position: absolute; top: 14px; right: 354px; width: 26px; height: 26px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; z-index: 16; box-shadow: var(--shadow-xs); color: var(--text-2); transition: all .15s; }
.collapse-btn:hover { color: var(--text); background: var(--surface-2); }
.side-panel.collapsed ~ .collapse-btn { right: 14px; }

/* 批注列表 */
.ann-list { display: flex; flex-direction: column; gap: 8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 12px; }
.panel-head .ph-title { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .3px; }
.panel-head .ph-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-3); background: var(--surface);
  border: 1px solid var(--border); border-radius: 7px; padding: 5px 10px; cursor: pointer;
  transition: all .15s;
}
.panel-head .ph-btn svg { width: 14px; height: 14px; }
.panel-head .ph-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.ann-item {
  display: flex; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; transition: all .15s; position: relative;
}
.ann-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.ann-item.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ann-badge { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 650; }
.ann-main { flex: 1; min-width: 0; }
.ann-main .t { font-size: 13px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ann-main .meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; display: flex; gap: 8px; }
.ann-item .del { opacity: 0; color: var(--text-3); padding: 4px; border-radius: 6px; align-self: flex-start; }
.ann-item:hover .del { opacity: 1; }
.ann-item .del:hover { color: var(--accent); background: var(--accent-soft); }

.empty-hint { text-align: center; color: var(--text-3); font-size: 13px; padding: 40px 16px; }
.empty-hint svg { width: 40px; height: 40px; opacity: .5; margin-bottom: 10px; }

/* ===================== AI 面板 ===================== */
.ai-toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.ai-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 550; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  transition: all .15s;
}
.ai-chip svg { width: 14px; height: 14px; }
.ai-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.ai-cards { display: flex; flex-direction: column; gap: 12px; }
.ai-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden;
  animation: fadeUp .3s ease; box-shadow: var(--shadow-xs);
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ai-card .head { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.ai-card .head .spark { color: var(--accent); display: grid; place-items: center; }
.ai-card .head .spark svg { width: 16px; height: 16px; }
.ai-card .head .title { font-size: 13px; font-weight: 620; flex: 1; }
.ai-card .head .copy { color: var(--text-3); padding: 4px 6px; border-radius: 6px; }
.ai-card .head .copy:hover { color: var(--accent); background: var(--accent-soft); }
.ai-card .body { padding: 13px; font-size: 13px; color: var(--text); line-height: 1.7; }
.ai-card .body h5 { margin: 14px 0 6px; font-size: 12px; color: var(--text-2); font-weight: 650; letter-spacing: .3px; }
.ai-card .body h5:first-child { margin-top: 0; }
.ai-card .body ul { margin: 6px 0; padding-left: 18px; }
.ai-card .body li { margin: 4px 0; }
.ai-card .body .kw { display: inline-block; background: var(--surface-3); border-radius: 6px; padding: 1px 8px; font-size: 12px; margin: 2px 4px 2px 0; color: var(--text-2); }
.ai-card .body .todo { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.ai-card .body .todo .box { flex: none; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong); margin-top: 2px; }
.ai-card .watermark-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--accent-ink); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }

.ai-ask { margin-top: 14px; }
.ai-input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font-family: inherit; font-size: 13px; resize: none; color: var(--text); background: var(--surface); transition: border-color .15s; }
.ai-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-send { align-self: flex-end; }

.skeleton { padding: 13px; }
.sk-line { height: 11px; border-radius: 6px; background: linear-gradient(90deg, #EEE 25%, #F5F5F5 37%, #EEE 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; margin: 9px 0; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.quota-note { font-size: 11.5px; color: var(--text-3); margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.quota-note svg { width: 13px; height: 13px; }

/* ===================== 格式转换面板 ===================== */
.convert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.convert-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  cursor: pointer; transition: all .15s; text-align: center;
}
.convert-card:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.convert-card .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.convert-card .ico svg { width: 22px; height: 22px; }
.convert-card .name { font-size: 13px; font-weight: 650; color: var(--text); }
.convert-card .hint { font-size: 11px; color: var(--text-3); }
.convert-card .lock { display: inline-flex; font-size: 9px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 5px; border-radius: 999px; margin-left: 2px; vertical-align: middle; }
.convert-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 12px; line-height: 1.5; }
.convert-note svg { flex: none; width: 14px; height: 14px; color: var(--accent); margin-top: 1px; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px); background: #37352F; color: #fff;
  padding: 10px 18px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #C0392B; }

/* ===================== 会员浮层 ===================== */
.pro-modal-mask { position: fixed; inset: 0; background: rgba(15,15,15,.4); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 80; }
.pro-modal-mask.show { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.pro-modal { width: min(440px, 92vw); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.pro-modal .hero { padding: 26px 26px 18px; background: linear-gradient(135deg, #FFF6F0, #FFF0F0); text-align: center; }
.pro-modal .hero .crown { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, #FF8A8A, var(--accent)); color: #fff; box-shadow: 0 8px 20px rgba(255,107,107,.35); }
.pro-modal .hero .crown svg { width: 26px; height: 26px; }
.pro-modal h3 { margin: 0 0 4px; font-size: 19px; }
.pro-modal .hero p { margin: 0; color: var(--text-2); font-size: 13px; }
.plan-row { display: flex; gap: 10px; padding: 18px 22px 6px; }
.plan { flex: 1; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 13px; text-align: center; cursor: pointer; transition: all .15s; }
.plan:hover { border-color: var(--border-strong); }
.plan.sel { border-color: var(--accent); background: var(--accent-soft); }
.plan .price { font-size: 20px; font-weight: 700; }
.plan .price small { font-size: 12px; color: var(--text-3); font-weight: 500; }
.plan .per { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.pro-feats { padding: 6px 26px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.pro-feats div { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.pro-feats svg { width: 15px; height: 15px; color: var(--ok); flex: none; }
.pro-modal .actions { padding: 4px 22px 22px; display: flex; gap: 10px; }
.pro-modal .actions .btn { flex: 1; justify-content: center; }
.pro-modal .close { position: absolute; top: 14px; right: 16px; color: var(--text-3); padding: 6px; border-radius: 8px; }
.pro-modal .close:hover { background: rgba(0,0,0,.05); color: var(--text); }

.lock-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 6px; border-radius: 999px; margin-left: 4px; }

/* 注释编辑器 */
.comment-editor { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--surface-2); }
.comment-editor textarea { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; font-family: inherit; font-size: 13px; resize: vertical; min-height: 64px; background: #fff; }
.comment-editor textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.comment-editor .row { display: flex; gap: 8px; margin-top: 9px; justify-content: flex-end; }

/* ===================== 自研弹窗 ===================== */
.ui-modal-mask { position: fixed; inset: 0; background: rgba(15,15,15,.35); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 90; }
.ui-modal-mask.show { display: flex; animation: fade .2s ease; }
.ui-modal { width: min(420px, 92vw); max-height: 86vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(14px) scale(.98); transition: all .18s ease; }
.ui-modal.show { opacity: 1; transform: translateY(0) scale(1); }
.ui-modal-head { display: flex; align-items: center; padding: 18px 20px 0; }
.ui-modal-title { flex: 1; font-size: 16px; font-weight: 650; }
.ui-modal-close { color: var(--text-3); padding: 6px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.ui-modal-close svg { width: 18px; height: 18px; display: block; }
.ui-modal-close:hover { color: var(--text); background: var(--surface-3); }
.ui-modal-body { padding: 14px 20px; }
.ui-modal-text { margin: 0 0 12px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.ui-modal-input { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-family: inherit; font-size: 13.5px; resize: vertical; min-height: 76px; color: var(--text); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.ui-modal-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ui-modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 18px; }
.ui-modal-actions .btn { padding: 8px 18px; }

/* 支付方式选择 */
.pay-type-row { display: flex; gap: 8px; padding: 4px 22px 14px; align-items: center; }
.pay-type-tip { font-size: 12px; color: var(--text-3); margin-right: 4px; }
.pay-type { padding: 6px 14px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 550; cursor: pointer; transition: all .15s; color: var(--text-2); }
.pay-type:hover { border-color: var(--border-strong); }
.pay-type.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

/* 支付二维码区域 */
.pay-qr-box { padding: 0 22px 10px; text-align: center; }
.pay-qr { width: 200px; height: 200px; margin: 0 auto; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.pay-qr canvas, .pay-qr img { display: block; margin: auto; }
.pay-loading { color: var(--text-3); font-size: 13px; }
.pay-fallback { font-size: 12px; color: var(--text-2); padding: 10px; word-break: break-all; }
.pay-fallback a { color: var(--accent); }
.pay-amount { font-size: 16px; font-weight: 700; margin-top: 10px; color: var(--text); }
.pay-status { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.pay-tip { font-size: 11px; color: var(--text-3); margin-top: 6px; padding: 0 10px; }

/* 演示开通链接 */
.demo-link { text-align: center; padding: 0 22px 16px; }
.demo-link a { font-size: 12px; color: var(--text-3); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--border); }
.demo-link a:hover { color: var(--accent); }

/* 支付提示 */
.pay-note { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); padding: 0 22px 8px; }
.pay-note svg { flex: none; }

/* 浮动「添加批注」按钮 */
.ann-comment-btn {
  position: absolute; z-index: 50; display: inline-flex; align-items: center; gap: 5px; pointer-events: auto;
  padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
  background: #FF6B6B; color: #fff; border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 4px 14px rgba(255,107,107,.35); cursor: pointer; animation: pop .18s ease;
}
.ann-comment-btn:hover { background: #F25252; transform: translateY(-1px); }
.ann-comment-btn svg { width: 12px; height: 12px; }

/* 批注列表 Axure 风格卡片 */
.ann-item { position: relative; padding: 13px 12px 13px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: all .15s; word-break: break-word; }
.ann-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.ann-item.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ann-item.sel::before {
  content: ""; position: absolute; left: -6px; top: 18px; width: 0; height: 0;
  border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-right: 7px solid var(--accent);
}
.ann-badge { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 2px 6px rgba(255,107,107,.28); }
.ann-author { display: inline-flex; align-items: center; font-size: 12px; font-weight: 650; color: var(--text); margin-right: 6px; }
.ann-author::before { content: ""; display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, #FFB347, #FF6B6B); margin-right: 5px; }
.ann-type { font-size: 11px; color: var(--text-3); background: var(--surface-3); padding: 1px 6px; border-radius: 999px; margin-right: 6px; }
.ann-time { font-size: 11px; color: var(--text-3); margin-left: auto; }
.ann-comment { font-size: 13px; color: var(--text); line-height: 1.55; margin-top: 8px; padding: 9px 11px; background: var(--surface-2); border-radius: 9px; border-left: 3px solid var(--accent); word-break: break-word; }
.ann-add-comment {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 5px 10px;
  border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600;
  border: 1px solid rgba(255,107,107,.2); transition: all .15s;
}
.ann-add-comment:hover { background: var(--accent); color: #fff; }
.ann-main .t { display: flex; align-items: center; flex-wrap: wrap; }

/* ========== 浮动编辑面板（v4 核心 UI） ========== */
.float-edit-panel {
  position: fixed;
  z-index: 99999;
  background: #fff;
  border-radius: 12px;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.12),
    0 1px 4px rgba(0,0,0,0.08);
  border: 1px solid #E8E9EC;
  width: 340px;
  animation: feIn 0.18s ease-out;
}
@keyframes feIn {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.float-edit-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #F0F1F3;
}
.fe-label {
  font-size: 13px; font-weight: 600; color: #37352F;
}
.fe-close {
  background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: 4px;
  color: #999; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.fe-close:hover { background: #F0F1F3; color: #37352F; }

.float-edit-body {
  padding: 12px 14px;
}
.fe-orig {
  font-size: 11px; color: #888; margin-bottom: 8px;
  line-height: 1.5; word-break: break-all;
  padding: 6px 8px; background: #FAFBFC;
  border-radius: 6px; max-height: 60px; overflow-y: auto;
}

.fe-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  color: #37352F;
  border: 1.5px solid #E0E1E4;
  border-radius: 8px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  background: #fff;
}
.fe-textarea:focus {
  border-color: #4F8CFF;
  box-shadow: 0 0 0 3px rgba(79,140,255,0.12);
}

.float-edit-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #F0F1F3;
}
.fe-btn {
  padding: 7px 16px;
  border: none; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.fe-cancel {
  background: #F5F6F8; color: #666;
}
.fe-cancel:hover { background: #EDEEF0; }
.fe-confirm {
  background: #4F8CFF; color: #fff;
}
.fe-confirm:hover { background: #3A7AEE; }

/* 编辑标记（页面上的视觉反馈） */
.edit-mark {
  position: absolute;
  z-index: 50; pointer-events: none; border-radius: 3px;
}
.edit-mark.edited {
  border: 2px dashed #4F8CFF;
  background: rgba(79,140,255,0.06);
  animation: editFadeIn 0.3s ease;
}
.edit-mark.added {
  border: 2px solid #27C93F;
  background: rgba(39,201,63,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #27C93F; font-weight: 500;
  animation: editFadeIn 0.3s ease;
}
.edit-mark.deleted {
  background: rgba(255,255,255,0.92);
  border: 1.5px dashed #EB5757;
}
@keyframes editFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* 图片选中 */
.edit-image-sel {
  position: absolute;
  z-index: 60;
  border: 2px solid #4F8CFF;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.15);
}
.edit-image-toolbar {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 4px 8px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  pointer-events: auto;
  margin-bottom: 6px;
  white-space: nowrap;
}
.edit-image-toolbar button {
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  background: #F5F6F8;
  color: #37352F;
  transition: background 0.2s;
}
.edit-image-toolbar button:hover {
  background: #E8E9EC;
}
.edit-image-toolbar button.img-replace {
  background: #4F8CFF;
  color: #fff;
}
.edit-image-toolbar button.img-replace:hover {
  background: #3A7AEE;
}

/* 涂白 */
.edit-whiteout-temp {
  position: absolute;
  z-index: 55;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed #999;
  pointer-events: none;
}
.edit-whiteout {
  position: absolute;
  z-index: 55;
  background: #fff;
  pointer-events: none;
}

/* 页面批注 hover 高亮 */
.anno-layer .connector-layer path { pointer-events: none; }

/* ===================== 编辑模式 ===================== */
/* 文字编辑 overlay */
.edit-overlay {
  position: absolute; z-index: 10; outline: none; cursor: text;
  background: rgba(255,255,255,.92); border: 2px solid var(--accent);
  border-radius: 4px; padding: 2px 4px; min-width: 40px;
  box-shadow: 0 0 0 4px var(--accent-soft);
  word-break: break-word; white-space: pre-wrap; line-height: 1.4;
}
.edit-overlay:focus { border-color: var(--accent-hover); }

.edit-add-overlay {
  border-style: dashed;
}
.edit-add-overlay[data-placeholder]:empty::before {
  content: attr(data-placeholder); color: var(--text-3); pointer-events: none;
}

/* 图片选中框 */
.edit-image-sel {
  position: absolute; z-index: 10; border: 2px solid var(--accent);
  background: rgba(255,107,107,.08); cursor: pointer;
  box-shadow: 0 0 0 4px var(--accent-soft);
  border-radius: 2px;
}
.edit-image-toolbar {
  position: absolute; bottom: -36px; left: 0; display: flex; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 6px; box-shadow: var(--shadow);
  white-space: nowrap; z-index: 15;
}
.edit-image-toolbar button {
  padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 550;
  cursor: pointer; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); transition: all .12s;
}
.edit-image-toolbar button:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.edit-image-toolbar .img-delete:hover { background: #FEE; color: #C0392B; border-color: #C0392B; }

/* 编辑标记 */
.edit-mark {
  position: absolute; z-index: 8; pointer-events: none; border-radius: 2px;
}
.edit-mark.edited {
  border: 2px solid var(--ok); background: rgba(47,163,114,.1);
  animation: editPulse .6s ease;
}
.edit-mark.deleted {
  border: 2px solid #C0392B; background: rgba(192,57,43,.08);
  animation: editPulse .6s ease;
}
@keyframes editPulse {
  0% { transform: scale(1.05); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(1); opacity: .8; }
}

/* 涂白 */
.edit-whiteout-temp {
  position: absolute; z-index: 9; pointer-events: none;
  background: rgba(255,255,255,.7); border: 1px dashed var(--accent);
}
.edit-whiteout {
  position: absolute; z-index: 8; pointer-events: none;
  background: #fff; border: 1px solid #ddd;
}

/* 编辑模式 SVG 光标 */
.mode-edit .anno-layer.interactive { cursor: crosshair; }
