/* =====================================================
 * RapidProto 管理界面样式
 * 现代简洁风格，参考 AxhubMake 界面设计
 * ===================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px; color: #1e293b; background: #f0f2f5;
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; flex-direction: column; height: 100%; }

/* ===== 顶部工具栏 ===== */
#topbar {
  height: 54px; flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: #fff; border-bottom: 1px solid #e8ecf1; z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
#logo { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; white-space: nowrap; color: #0f172a; }
#logo .logo-ic {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
#logo .logo-ic svg { width: 16px; height: 16px; color: #fff; }
#logo .logo-ic .logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; display: block; }
#logo .sub { color: #94a3b8; font-weight: 400; font-size: 12px; margin-left: 4px; }
.spacer { flex: 1; }

/* 顶部居中工具组 */
#topbar-center { display: flex; align-items: center; gap: 8px; }

/* 图标按钮 */
.tbtn-icon {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid #e2e8f0; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: #2563eb; transition: all .15s ease; flex-shrink: 0;
}
.tbtn-icon:hover { background: #eff6ff; border-color: #93c5fd; transform: scale(1.05); }
.tbtn-icon svg { width: 14px; height: 14px; }

/* 项目选择器（自定义下拉） */
#project-selector {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid #eef0f3;
}
.proj-dropdown { flex: 1; position: relative; }
.proj-trigger {
  width: 100%; height: 36px; display: flex; align-items: center; gap: 8px;
  padding: 0 10px; border: 1.5px solid #e2e8f0; border-radius: 9px;
  background: #fff; cursor: pointer; font-family: inherit; font-size: 13px;
  color: #1e293b; transition: all .15s ease; text-align: left;
}
.proj-trigger:hover { border-color: #cbd5e1; background: #fafbfc; }
.proj-dropdown.open .proj-trigger { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.proj-trigger-icon {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: #64748b;
}
.proj-trigger-icon svg { width: 13px; height: 13px; }
.proj-trigger-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.proj-trigger-arrow { width: 14px; height: 14px; color: #94a3b8; flex-shrink: 0; transition: transform .2s; }
.proj-dropdown.open .proj-trigger-arrow { transform: rotate(180deg); }

/* 下拉菜单 */
.proj-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 300; overflow: hidden;
  animation: projMenuIn .15s ease;
}
@keyframes projMenuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.proj-dropdown.open .proj-menu { display: block; }
.proj-menu-search {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
}
.proj-menu-search svg { width: 14px; height: 14px; color: #94a3b8; flex-shrink: 0; }
.proj-menu-search input {
  flex: 1; border: none; outline: none; font-size: 12.5px; font-family: inherit;
  color: #1e293b; background: transparent;
}
.proj-menu-search input::placeholder { color: #94a3b8; }
.proj-menu-list { max-height: 240px; overflow-y: auto; padding: 4px; }
.proj-menu-list::-webkit-scrollbar { width: 4px; }
.proj-menu-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* 分组标题 */
.proj-group-label {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px 4px;
  font-size: 11px; font-weight: 600; color: #94a3b8; letter-spacing: .3px; text-transform: none;
}
.proj-group-label svg { width: 12px; height: 12px; }

/* 项目条目 */
.proj-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px;
  cursor: pointer; transition: all .12s; border: none; background: none; width: 100%;
  font-family: inherit; font-size: 13px; color: #334155; text-align: left;
}
.proj-item:hover { background: #f1f5f9; }
.proj-item.active { background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.proj-item-icon {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.proj-item-icon svg { width: 14px; height: 14px; }
.proj-item-icon.personal { background: #eff6ff; color: #3b82f6; }
.proj-item-icon.team { background: #f0fdf4; color: #16a34a; }
.proj-item-info { flex: 1; min-width: 0; }
.proj-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-item-meta { font-size: 11px; color: #94a3b8; margin-top: 1px; }
.proj-item.active .proj-item-meta { color: #60a5fa; }
.proj-item-badge {
  font-size: 11px; color: #94a3b8; background: #f1f3f5; padding: 2px 7px;
  border-radius: 8px; font-weight: 500; flex-shrink: 0;
}
.proj-item.active .proj-item-badge { background: rgba(37,99,235,.1); color: #2563eb; }

/* 底部新建按钮 */
.proj-menu-footer { padding: 4px; border-top: 1px solid #f1f5f9; }
.proj-menu-add {
  display: flex; align-items: center; gap: 7px; width: 100%; padding: 8px 10px;
  border: none; background: none; cursor: pointer; font-size: 12.5px; font-family: inherit;
  color: #3b82f6; border-radius: 7px; transition: all .12s; font-weight: 500;
}
.proj-menu-add:hover { background: #eff6ff; }
.proj-menu-add svg { width: 14px; height: 14px; }

/* 空状态 */
.proj-menu-empty {
  padding: 20px; text-align: center; color: #94a3b8; font-size: 12px;
}

/* 项目操作下拉菜单 */
.project-actions {
  position: relative;
}
.project-actions-menu {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 6px;
  min-width: 180px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1); z-index: 200; padding: 6px; overflow: hidden;
}
.project-actions-menu.show { display: block; }
.project-action-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px;
  border: none; background: none; cursor: pointer; font-size: 13px; font-family: inherit;
  color: #475569; border-radius: 6px; transition: all .15s; text-align: left;
}
.project-action-item:hover { background: #f1f5f9; color: #1e293b; }
.project-action-item:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.project-action-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.project-action-item.danger { color: #dc2626; }
.project-action-item.danger:hover { background: #fef2f2; color: #dc2626; }

/* 工具栏按钮 */
.tbtn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 16px; border-radius: 9px;
  border: 1px solid #e2e8f0; background: #fff; color: #475569; font-size: 12.5px; cursor: pointer;
  white-space: nowrap; transition: all .2s cubic-bezier(.4,0,.2,1); font-family: inherit; font-weight: 500;
}
.tbtn:hover { background: #f8fafc; border-color: #cbd5e1; color: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.tbtn:active { transform: scale(.97); }
.tbtn.primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb); border-color: transparent; color: #fff;
  box-shadow: 0 2px 6px rgba(37,99,235,.25);
}
.tbtn.primary:hover { box-shadow: 0 4px 12px rgba(37,99,235,.35); background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.tbtn.danger { color: #dc2626; }
.tbtn.danger:hover { background: #fef2f2; border-color: #fecaca; }
.tbtn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.tbtn.active { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.tbtn .ic { width: 15px; height: 15px; flex-shrink: 0; }

/* ===== 主体三栏 ===== */
#main { flex: 1; display: flex; min-height: 0; position: relative; }
.panel { background: #fff; display: flex; flex-direction: column; min-height: 0; }

/* 左侧面板 - 浅灰底色，层次分明 */
#left-panel { width: 248px; border-right: 1px solid #e8ecf1; flex-shrink: 0; background: #fafbfc; transition: width .25s ease, opacity .2s ease; overflow: hidden; }
#left-panel.collapsed { width: 0; border-right: none; opacity: 0; pointer-events: none; }
/* 中间面板 */
#center-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #eef1f5; }
/* 右侧面板 */
#right-panel { width: 320px; border-left: 1px solid #e8ecf1; flex-shrink: 0; display: flex; flex-direction: column; background: #fafbfc; transition: width .25s ease, opacity .2s ease; overflow: hidden; }
#right-panel.collapsed { width: 0; border-left: none; opacity: 0; pointer-events: none; }

/* 面板折叠切换按钮 */
.panel-toggle {
  margin-left: auto; width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; cursor: pointer; transition: all .15s; border: none; background: none; padding: 0;
}
.panel-toggle:hover { background: #f1f5f9; color: #475569; }
.panel-toggle svg { width: 14px; height: 14px; }

/* 侧边栏展开恢复按钮（浮在中间面板边缘） */
.panel-restore {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 20px; height: 48px; border-radius: 0 8px 8px 0;
  background: #fff; border: 1px solid #e2e8f0; border-left: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #94a3b8; z-index: 50; box-shadow: 2px 0 6px rgba(0,0,0,.06);
  transition: all .15s;
}
.panel-restore:hover { background: #eff6ff; color: #2563eb; }
.panel-restore svg { width: 12px; height: 12px; }
.panel-restore.left { left: 0; }
.panel-restore.right { right: 0; border-radius: 8px 0 0 8px; border-right: none; border-left: 1px solid #e2e8f0; box-shadow: -2px 0 6px rgba(0,0,0,.06); }

/* 面板标题栏 */
.panel-title {
  height: 42px; flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  padding: 0 16px; border-bottom: 1px solid #eef0f3;
  font-size: 12px; font-weight: 600; color: #64748b; letter-spacing: .3px;
}
.panel-title .pt-ic { width: 15px; height: 15px; color: #94a3b8; flex-shrink: 0; }
.panel-title .act {
  margin-left: auto; width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #2563eb; cursor: pointer; transition: all .2s; letter-spacing: 0;
}
.panel-title .act + .act {
  margin-left: 4px;
}
.panel-title .act:hover { background: #eff6ff; transform: scale(1.05); }
.panel-title .act svg { width: 14px; height: 14px; }

/* ===== 项目列表（已废弃，改用下拉列表） ===== */
/* 页面列表 */
#page-list { flex: 1 1 55%; min-height: 60px; overflow-y: auto; padding: 8px 10px; }
#page-list::-webkit-scrollbar { width: 5px; }
#page-list::-webkit-scrollbar-track { background: transparent; }
#page-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.page-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px;
  cursor: pointer; font-size: 13px; transition: all .15s ease; margin-bottom: 2px;
}
.page-item:hover { background: #f1f3f5; }
.page-item.active {
  background: linear-gradient(135deg, #eff6ff, #e8f0fe); color: #1d4ed8; font-weight: 600;
  box-shadow: 0 1px 3px rgba(37,99,235,.08);
}
.page-item .p-ic { width: 15px; height: 15px; color: #94a3b8; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.page-item .p-ic svg { width: 15px; height: 15px; }
.page-item .p-ic.doc { color: #059669; }
.page-item.active .p-ic { color: #2563eb; }
.page-item.active .p-ic.doc { color: #059669; }
.page-item .p-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-item .p-badge {
  min-width: 20px; height: 20px; border-radius: 10px; background: #f1f3f5; color: #64748b;
  font-size: 11px; line-height: 20px; text-align: center; padding: 0 6px; font-weight: 600;
}
.page-item.active .p-badge { background: rgba(37,99,235,.12); color: #2563eb; }
.page-item .p-ops { display: none; gap: 2px; }
.page-item:hover .p-ops { display: flex; }
.page-item .p-ops button {
  border: none; background: none; cursor: pointer; color: #94a3b8;
  padding: 4px; border-radius: 5px; display: flex; align-items: center; transition: all .15s;
}
.page-item .p-ops button:hover { background: #e2e8f0; color: #1e293b; }
.page-item .p-ops button svg { width: 13px; height: 13px; }

/* 内联创建表单 */
.page-item.inline-form {
  background: #eff6ff; border: 1.5px solid #93c5fd; padding: 8px 10px;
}
.inline-input {
  flex: 1; border: none; background: transparent; font-size: 13px; font-family: inherit;
  color: #1e293b; outline: none; padding: 4px 8px;
}
.inline-input::placeholder { color: #94a3b8; }
.inline-folder-sel {
  height: 26px; border: 1px solid #93c5fd; border-radius: 6px; padding: 0 6px;
  font-size: 11px; font-family: inherit; color: #2563eb; background: #fff;
  outline: none; cursor: pointer; flex-shrink: 0; max-width: 90px;
}
.inline-cancel {
  border: none; background: none; cursor: pointer; color: #94a3b8; padding: 4px;
  border-radius: 5px; display: flex; align-items: center; transition: all .15s;
}
.inline-cancel:hover { background: #fef2f2; color: #dc2626; }
.inline-cancel svg { width: 13px; height: 13px; }

/* 文件夹分组 */
.folder-group { margin-top: 6px; }
.folder-head {
  display: flex; align-items: center; gap: 6px; padding: 7px 10px;
  font-size: 11.5px; font-weight: 600; color: #64748b; cursor: default;
  border-radius: 7px; transition: background .15s;
}
.folder-head:hover { background: #f1f3f5; }
.folder-head svg { width: 14px; height: 14px; color: #94a3b8; flex-shrink: 0; }
.folder-count {
  min-width: 18px; height: 18px; border-radius: 9px; background: #e2e8f0;
  font-size: 10px; line-height: 18px; text-align: center; color: #64748b; padding: 0 5px;
}
.folder-del {
  margin-left: auto; border: none; background: none; cursor: pointer; color: #cbd5e1;
  padding: 3px; border-radius: 5px; display: flex; align-items: center; transition: all .15s;
  opacity: 0;
}
.folder-head:hover .folder-del { opacity: 1; }
.folder-del:hover { background: #fef2f2; color: #dc2626; }
.folder-del svg { width: 12px; height: 12px; }
.folder-rename {
  border: none; background: none; cursor: pointer; color: #cbd5e1;
  padding: 3px; border-radius: 5px; display: flex; align-items: center; transition: all .15s;
  opacity: 0;
}
.folder-head:hover .folder-rename { opacity: 1; }
.folder-rename:hover { background: #eff6ff; color: #2563eb; }
.folder-rename svg { width: 12px; height: 12px; }
.folder-group .page-item { padding-left: 24px; }

#left-empty {
  padding: 32px 20px; text-align: center; color: #94a3b8; font-size: 12px; line-height: 2;
}
#left-empty svg { width: 40px; height: 40px; color: #d1d5db; margin-bottom: 12px; display: block; margin-left: auto; margin-right: auto; }

/* ===== 中间预览区 ===== */
#center-tools {
  height: 46px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 16px;
  background: #fff; border-bottom: 1px solid #e8ecf1;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
#center-tools .ct-info { font-size: 12px; color: #64748b; }

#preview-wrap {
  flex: 1; min-height: 0; position: relative; margin: 14px; border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(15,23,42,.08), 0 0 0 1px rgba(15,23,42,.04); background: #fff;
}
#preview-frame { width: 100%; height: 100%; border: none; }
#preview-mask {
  position: absolute; inset: 0; background: rgba(241,245,249,.9); display: none;
  align-items: center; justify-content: center; font-size: 13px; color: #64748b; z-index: 10;
  backdrop-filter: blur(3px);
}
#preview-mask.show { display: flex; }

/* ===== 文档列表与编辑器 ===== */
#doc-list { flex: 1 1 45%; min-height: 0; overflow-y: auto; padding: 8px 10px; display: none; }
#doc-list::-webkit-scrollbar { width: 5px; }
#doc-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

#doc-editor-wrap {
  flex: 1; min-height: 0; display: none; flex-direction: column; margin: 14px; border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(15,23,42,.08), 0 0 0 1px rgba(15,23,42,.04); background: #fff;
}
#doc-editor-toolbar {
  height: 44px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  border-bottom: 1px solid #e8ecf1; background: #fff;
}
#doc-editor-title { font-size: 13px; font-weight: 600; color: #1e293b; }
#doc-editor-status { font-size: 11px; color: #94a3b8; }
#doc-editor-status.dirty { color: #d97706; }
#doc-editor { flex: 1; min-height: 0; overflow: hidden; }
#doc-editor.vditor { border: none; }

/* ===== 右侧标注面板 ===== */
#ann-tools {
  flex-shrink: 0; display: flex; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid #eef0f3; flex-wrap: wrap; align-items: center;
}
#ann-tools .tbtn { height: 28px; padding: 0 11px; font-size: 12px; }

#ann-list { flex: 1; overflow-y: auto; padding: 10px 12px; }
#ann-list::-webkit-scrollbar { width: 5px; }
#ann-list::-webkit-scrollbar-track { background: transparent; }
#ann-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.ann-item {
  border: 1px solid #e8ecf1; border-radius: 11px; margin-bottom: 10px; overflow: hidden;
  transition: all .2s ease; background: #fff;
}
.ann-item:hover { box-shadow: 0 3px 10px rgba(15,23,42,.06); border-color: #d1d5db; }
.ann-item-head { display: flex; align-items: center; gap: 9px; padding: 11px 13px; cursor: pointer; transition: background .15s; }
.ann-item-head:hover { background: #f8fafc; }
.ann-badge {
  min-width: 24px; height: 24px; border-radius: 12px; color: #fff;
  font: 600 11px/24px sans-serif; text-align: center; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.ann-title { flex: 1; font-weight: 500; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-ops { display: flex; gap: 2px; }
.ann-ops button {
  border: none; background: none; cursor: pointer; color: #94a3b8;
  padding: 5px; border-radius: 6px; display: flex; align-items: center; transition: all .15s;
}
.ann-ops button:hover { background: #e2e8f0; color: #1e293b; }
.ann-ops button.del:hover { color: #dc2626; background: #fef2f2; }
.ann-ops button svg { width: 13px; height: 13px; }

.ann-body { padding: 0 13px 13px; }
.ann-locator {
  font-size: 11px; color: #64748b; background: #f8fafc; border: 1px solid #f1f3f5;
  border-radius: 7px; padding: 7px 11px; margin-top: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, "SF Mono", monospace;
}
.ann-content { font-size: 12px; color: #475569; line-height: 1.7; margin-top: 8px; white-space: normal; word-break: break-word; }
.ann-content h1, .ann-content h2, .ann-content h3, .ann-content h4 { margin: 8px 0 4px; font-weight: 600; color: #1e293b; line-height: 1.4; }
.ann-content h1 { font-size: 15px; } .ann-content h2 { font-size: 14px; } .ann-content h3 { font-size: 13px; } .ann-content h4 { font-size: 12px; }
.ann-content p, .ann-content div { margin: 2px 0; }
.ann-content ul, .ann-content ol { margin: 4px 0; padding-left: 20px; }
.ann-content li { margin: 2px 0; }
.ann-content code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 11px; color: #e11d48; }
.ann-content pre { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px; margin: 6px 0; overflow-x: auto; font-size: 11px; }
.ann-content pre code { background: none; padding: 0; color: inherit; }
.ann-content a { color: #2563eb; text-decoration: none; } .ann-content a:hover { text-decoration: underline; }
.ann-content strong { font-weight: 600; color: #1e293b; }
.ann-content img.rpp-md-img { max-width: 100%; height: auto; border-radius: 6px; margin: 6px 0; cursor: zoom-in; display: block; border: 1px solid #e8ecf1; }
.ann-content img.rpp-md-img:hover { opacity: .85; }

#ann-empty { padding: 32px 18px; text-align: center; color: #94a3b8; font-size: 12px; line-height: 2; }
#ann-empty svg { width: 36px; height: 36px; color: #d1d5db; margin-bottom: 10px; display: block; margin-left: auto; margin-right: auto; }

/* ===== 弹窗 ===== */
#modal-root {
  /* 高于 #admin-modal-root(1000)：在管理弹窗内打开的表单/确认框（如 FTP 账号）需置顶 */
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1100;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
#modal-root.show { display: flex; }

/* 管理弹窗 */
#admin-modal-root {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1000;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
#admin-modal-root.show { display: flex; }

.modal {
  background: #fff; border-radius: 18px; width: 640px; max-width: 92vw; max-height: 86vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 25px 50px rgba(15,23,42,.25), 0 0 0 1px rgba(15,23,42,.05);
  animation: modalIn .25s cubic-bezier(.4,0,.2,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.modal.wide { width: 820px; }
.modal.narrow { width: 460px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 22px;
  border-bottom: 1px solid #f1f5f9; font-size: 15px; font-weight: 600; color: #0f172a;
}
.modal-head button {
  border: none; background: #f1f5f9; width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; cursor: pointer; transition: all .15s;
}
.modal-head button:hover { background: #e2e8f0; color: #1e293b; transform: scale(1.05); }
.modal-head button svg { width: 14px; height: 14px; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid #f1f5f9; }

/* ===== 表单 ===== */
.f-group { margin-bottom: 16px; }
.f-label { display: block; font-size: 12px; color: #475569; margin-bottom: 7px; font-weight: 500; }
.f-input, .f-textarea {
  width: 100%; border: 1.5px solid #e2e8f0; border-radius: 9px; padding: 9px 13px; font-size: 13px;
  font-family: inherit; outline: none; background: #fff; color: #1e293b; transition: all .2s ease;
}
.f-input:focus, .f-textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.f-textarea { min-height: 60px; resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.6; }
.f-row { display: flex; gap: 14px; }
.f-row .f-group { flex: 1; }
.f-hint { font-size: 11.5px; color: #94a3b8; margin-top: 6px; line-height: 1.7; }
.f-hint b { color: #64748b; }

.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2.5px solid transparent; transition: all .15s; }
.color-dot:hover { transform: scale(1.15); }
.color-dot.selected { border-color: #1e293b; box-shadow: 0 0 0 2px #fff inset; }

/* ===== 导出选项 ===== */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt-card {
  border: 1.5px solid #e2e8f0; border-radius: 13px; padding: 16px; cursor: pointer;
  transition: all .2s ease; background: #fff;
}
.opt-card:hover { border-color: #93c5fd; background: #fafbff; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(37,99,235,.08); }
.opt-card.selected { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 1.5px #2563eb; }
.opt-card .oc-title { font-weight: 600; font-size: 13px; margin-bottom: 5px; color: #0f172a; }
.opt-card .oc-desc { font-size: 11.5px; color: #64748b; line-height: 1.6; }
.opt-check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; cursor: pointer; color: #475569; }
.opt-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: #2563eb; }

/* ===== 结果区 ===== */
.result-box {
  margin-top: 16px; border-radius: 11px; background: #f0fdf4; border: 1px solid #bbf7d0;
  padding: 16px; font-size: 12.5px; line-height: 1.7;
}
.result-box.error { background: #fef2f2; border-color: #fecaca; }
.result-box a { color: #2563eb; text-decoration: none; font-weight: 500; }
.result-box a:hover { text-decoration: underline; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; background: #f1f5f9; padding: 2px 7px; border-radius: 5px; }

.hidden { display: none !important; }

/* ===== 标注表单侧边栏 ===== */
#ann-form-sidebar {
  display: none; flex-direction: column; height: 100%;
}
#ann-form-sidebar.active {
  display: flex;
}
#ann-form-sidebar .afs-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid #eef0f3; font-size: 13px; font-weight: 600; color: #1e293b;
}
#ann-form-sidebar .afs-head .afs-close {
  margin-left: auto; width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; cursor: pointer; border: none; background: none; transition: all .15s;
}
#ann-form-sidebar .afs-head .afs-close:hover { background: #f1f5f9; color: #1e293b; }
#ann-form-sidebar .afs-head .afs-close svg { width: 14px; height: 14px; }
#ann-form-sidebar .afs-body {
  flex: 1; overflow-y: auto; padding: 14px 16px;
}
#ann-form-sidebar .afs-body .f-group { margin-bottom: 14px; }
#ann-form-sidebar .afs-body .f-label {
  display: block; font-size: 11.5px; font-weight: 600; color: #64748b; margin-bottom: 5px;
}
#ann-form-sidebar .afs-body .f-input {
  width: 100%; height: 34px; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 0 10px;
  font-size: 13px; font-family: inherit; color: #1e293b; outline: none; transition: border-color .15s;
}
#ann-form-sidebar .afs-body .f-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
#ann-form-sidebar .afs-body .f-textarea {
  width: 100%; min-height: 140px; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 8px 10px;
  font-size: 13px; font-family: inherit; color: #1e293b; outline: none; resize: vertical; transition: border-color .15s;
}
#ann-form-sidebar .afs-body .f-textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
#ann-form-sidebar .afs-body .ann-locator {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; color: #64748b;
  background: #f1f5f9; border-radius: 6px; padding: 6px 8px; word-break: break-all; line-height: 1.5;
}
#ann-form-sidebar .afs-body .f-hint {
  font-size: 11px; color: #94a3b8; line-height: 1.6; margin-top: 4px;
}
#ann-form-sidebar .afs-body .f-hint .mono {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; background: #f1f5f9; padding: 1px 5px; border-radius: 3px;
}
#ann-form-sidebar .afs-foot {
  display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid #eef0f3;
}

/* 页面说明（在 ann-list 内） */
.page-desc-item {
  border: 1px solid #e8ecf1; border-radius: 11px; margin-bottom: 10px; overflow: hidden;
  transition: all .2s ease; background: #fff;
}
.page-desc-item:hover { box-shadow: 0 3px 10px rgba(15,23,42,.06); border-color: #d1d5db; }
.pd-head {
  display: flex; align-items: center; gap: 9px; padding: 11px 13px;
}
.pd-head svg { width: 15px; height: 15px; color: #64748b; flex-shrink: 0; }
.pd-head .pd-title { flex: 1; font-weight: 600; font-size: 12.5px; color: #475569; }
.pd-head .pd-ops { display: flex; gap: 2px; }
.pd-head .pd-ops button {
  border: none; background: none; cursor: pointer; color: #94a3b8;
  padding: 5px; border-radius: 6px; display: flex; align-items: center; transition: all .15s;
}
.pd-head .pd-ops button:hover { background: #e2e8f0; color: #1e293b; }
.pd-head .pd-ops button svg { width: 13px; height: 13px; }
.pd-body { padding: 0 13px 13px; }
.pd-content { font-size: 12px; color: #475569; line-height: 1.7; white-space: normal; word-break: break-word; }
.pd-content.empty { color: #94a3b8; font-style: italic; font-size: 12px; }
.pd-content h1, .pd-content h2, .pd-content h3 { margin: 8px 0 4px; font-weight: 600; color: #1e293b; }
.pd-content h1 { font-size: 15px; } .pd-content h2 { font-size: 14px; } .pd-content h3 { font-size: 13px; }
.pd-content p { margin: 2px 0; }
.pd-content ul, .pd-content ol { margin: 4px 0; padding-left: 20px; }
.pd-content li { margin: 2px 0; }
.pd-content code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 11px; color: #e11d48; }
.pd-content pre { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px; margin: 6px 0; overflow-x: auto; font-size: 11px; }
.pd-content pre code { background: none; padding: 0; color: inherit; }
.pd-content blockquote { border-left: 3px solid #3b82f6; padding-left: 10px; margin: 6px 0; color: #64748b; }
.pd-content a { color: #2563eb; text-decoration: none; } .pd-content a:hover { text-decoration: underline; }
.pd-content strong { font-weight: 600; color: #1e293b; }
.pd-content img.rpp-md-img { max-width: 100%; height: auto; border-radius: 6px; margin: 6px 0; cursor: zoom-in; display: block; border: 1px solid #e8ecf1; }
.pd-content img.rpp-md-img:hover { opacity: .85; }
.pd-edit-area {
  width: 100%; min-height: 120px; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 8px 10px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.6;
  color: #1e293b; outline: none; resize: vertical; transition: border-color .15s;
}
.pd-edit-area:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.pd-edit-actions { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; }
.pd-edit-actions button {
  border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px 12px;
  font-size: 12px; cursor: pointer; transition: all .15s;
}
.pd-edit-actions .pd-btn-cancel { background: #fff; color: #64748b; }
.pd-edit-actions .pd-btn-cancel:hover { background: #f8fafc; }
.pd-edit-actions .pd-btn-save { background: #2563eb; color: #fff; border-color: #2563eb; }
.pd-edit-actions .pd-btn-save:hover { background: #1d4ed8; }

/* 可折叠分组 */
.ann-group-head {
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: #94a3b8;
  font-weight: 600; padding: 8px 4px 4px; cursor: pointer; user-select: none;
}
.ann-group-head svg { width: 12px; height: 12px; transition: transform .2s; flex-shrink: 0; }
.ann-group-head.collapsed svg { transform: rotate(-90deg); }

/* ===== 垃圾箱 ===== */
.trash-item {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
  border: 1px solid #e8ecf1; border-radius: 10px; margin-bottom: 8px; background: #fff;
  transition: box-shadow .15s;
}
.trash-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.trash-item-info { min-width: 0; flex: 1; }
.trash-item-name { font-size: 13px; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trash-item-time { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.trash-item-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: 12px; }
.tbtn-sm {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px;
  border-radius: 7px; border: 1px solid #e8ecf1; background: #fff; color: #475569;
  font-size: 11px; cursor: pointer; user-select: none; transition: all .15s; font-weight: 500;
}
.tbtn-sm:hover { background: #f8fafc; border-color: #cbd5e1; }
.tbtn-sm svg { width: 13px; height: 13px; }
.tbtn-sm.danger { color: #ef4444; border-color: #fecaca; }
.tbtn-sm.danger:hover { background: #fef2f2; border-color: #fca5a5; }

/* ===== 拖拽排序 ===== */
.page-item[draggable="true"] { cursor: grab; }
.page-item[draggable="true"]:active { cursor: grabbing; }
.page-item.dragging { opacity: 0.4; }
.page-item.drag-over { background: #dbeafe; border-color: #93c5fd; }
.page-item.drag-over-before { border-top: 2px solid #2563eb; margin-top: -1px; }
.page-item.drag-over-after { border-bottom: 2px solid #2563eb; margin-bottom: -1px; }
.folder-group.drag-over .folder-head { background: #dbeafe; border-color: #93c5fd; }
.folder-group.drag-over-before { border-top: 2px solid #2563eb; margin-top: -1px; }
.folder-group.drag-over-after { border-bottom: 2px solid #2563eb; margin-bottom: -1px; }
.folder-head[draggable="true"] { cursor: grab; }
.folder-head[draggable="true"]:active { cursor: grabbing; }
#page-list.drag-over-root { background: #f0f9ff; outline: 2px dashed #93c5fd; outline-offset: -2px; }
.page-children { margin-left: 16px; }
.page-children .page-item { font-size: 12px; }

/* ===== 折叠按钮 ===== */
.folder-toggle { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; font-size: 10px; color: #64748b; cursor: pointer; user-select: none; flex-shrink: 0; }
.folder-toggle:hover { color: #2563eb; }
.folder-toggle-placeholder { display: inline-block; width: 16px; flex-shrink: 0; }
.page-toggle { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; font-size: 9px; color: #64748b; cursor: pointer; user-select: none; flex-shrink: 0; margin-right: 2px; }
.page-toggle:hover { color: #2563eb; }

/* ===== Lightbox 图片大图查看 ===== */
.rpp-lightbox {
  position: fixed; inset: 0; z-index: 2147483647; background: rgba(15,23,42,.82);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
  animation: rpp-lb-fadein .18s ease; backdrop-filter: blur(4px);
}
@keyframes rpp-lb-fadein { from { opacity: 0; } to { opacity: 1; } }
.rpp-lightbox img {
  max-width: 92vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 16px 60px rgba(0,0,0,.45);
  object-fit: contain; cursor: default; animation: rpp-lb-scalein .2s ease;
}
@keyframes rpp-lb-scalein { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rpp-lightbox-close {
  position: absolute; top: 16px; right: 20px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: none; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  transition: background .15s;
}
.rpp-lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ================= 管理弹窗样式 ================= */
.admin-tab {
  display: block; width: 100%; padding: 10px 16px; border: none; background: none;
  text-align: left; font-size: 13px; color: #64748b; cursor: pointer; transition: all .15s;
}
.admin-tab:hover { background: #f1f5f9; color: #1e293b; }
.admin-tab.active { background: #eff6ff; color: #2563eb; font-weight: 500; border-right: 2px solid #2563eb; }
.admin-list-item {
  display: flex; align-items: center; padding: 10px 12px; border-bottom: 1px solid #f1f5f9;
  transition: background .1s;
}
.admin-list-item:hover { background: #f8fafc; }
.admin-list-item:last-child { border-bottom: none; }
.admin-list-item .ali-info { flex: 1; }
.admin-list-item .ali-name { font-size: 13px; font-weight: 500; color: #1e293b; }
.admin-list-item .ali-desc { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.admin-list-item .ali-actions { display: flex; gap: 6px; }
.admin-badge {
  display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 500;
}
.admin-badge.admin { background: #fef3c7; color: #92400e; }
.admin-badge.user { background: #e0f2fe; color: #0369a1; }
.admin-badge.owner { background: #dcfce7; color: #166534; }
.admin-badge.editor { background: #e0f2fe; color: #0369a1; }
.admin-badge.viewer { background: #f1f5f9; color: #475569; }
.admin-member-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; margin: 3px;
  background: #f1f5f9; border-radius: 6px; font-size: 12px;
}
.admin-member-tag .amt-remove {
  width: 16px; height: 16px; border-radius: 50%; border: none; background: #e2e8f0;
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #64748b;
}
.admin-member-tag .amt-remove:hover { background: #fecaca; color: #dc2626; }

/* 团队选择组件 */
.team-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.team-select-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.team-select-item.selected {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.team-select-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.team-select-item.selected .team-select-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.team-select-info {
  flex: 1;
  min-width: 0;
}

.team-select-name {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-select-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.team-select-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  flex-shrink: 0;
  opacity: 0;
  transition: all 0.2s;
}

.team-select-item.selected .team-select-check {
  background: #3b82f6;
  color: #fff;
  opacity: 1;
}

/* 顶部轻提示（Tauri 环境原生 alert 的兜底） */
.levinpr-toast {
  position: fixed; top: 18px; left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: #1e293b; color: #f8fafc;
  padding: 8px 18px; border-radius: 8px;
  font-size: 13px; z-index: 30000;
  opacity: 0; transition: all .25s ease;
  pointer-events: none; max-width: 80vw;
  box-shadow: 0 6px 20px rgba(15,23,42,.25);
}
.levinpr-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.levinpr-toast.error { background: #dc2626; }
