/* ===== 审阅批注系统（移动端友好）===== */

/* 批注按钮：每段/标题/框体左侧的「＋」，常驻可见，不依赖长按 */
.rb {
  display: inline-block;
  width: 22px; height: 22px;
  line-height: 20px;
  text-align: center;
  color: #a08a5a;
  border: 1px solid #c9b88e;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;
  margin-right: 6px;
  flex: 0 0 auto;
  background: #fdfaf1;
}
.rb:active { background: #e9ddbe; }

/* 已标记的元素 */
.annotated {
  background: #fff7db !important;
  box-shadow: inset 3px 0 0 #e8b93c !important;
}

/* 批注气泡面板 */
#ap {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fdfaf1;
  border-top: 2px solid #8a5a24;
  padding: 16px 16px 20px;
  z-index: 999;
  display: none;
  box-shadow: 0 -6px 24px rgba(90,64,32,.18);
  max-height: 72vh;
  overflow-y: auto;
}
#ap.open { display: block; }

#ap h3 { margin: 0 0 12px; font-size: 16px; color: #4c3d28; }

.type-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.type-row button {
  flex: 1 1 auto;
  min-width: 56px;
  padding: 9px 0;
  border: 1px solid #c9b88e;
  border-radius: 4px;
  background: #fff;
  color: #5c5040;
  font-size: 14px;
  cursor: pointer;
}
.type-row button.sel {
  background: #8a5a24;
  color: #f7efdb;
  border-color: #8a5a24;
}

#ap textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 76px;
  border: 1px solid #c9b88e;
  border-radius: 4px;
  padding: 10px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  background: #fff;
  color: #3a2f22;
}
#ap .ctx {
  font-size: 12.5px;
  color: #9a8a6d;
  margin: 0 0 8px;
  line-height: 1.5;
  max-height: 60px;
  overflow: hidden;
}
.ap-actions { display: flex; gap: 8px; margin-top: 12px; }
.ap-actions button {
  flex: 1;
  padding: 11px 0;
  border-radius: 4px;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid #c9b88e;
}
#ap-save { background: #8a5a24; color: #f7efdb; border-color: #8a5a24; }
#ap-cancel { background: #fff; color: #5c5040; }

/* 顶部审阅工具条 */
#rb-bar {
  position: sticky;
  top: 0;
  z-index: 998;
  background: #f5ecd8;
  border-bottom: 1px solid #d8c9a5;
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
#rb-bar .count {
  font-size: 13px;
  color: #8a5a24;
  margin-right: auto;
}
#rb-bar button {
  padding: 7px 14px;
  border: 1px solid #8a5a24;
  border-radius: 4px;
  background: #fff;
  color: #8a5a24;
  font-size: 13px;
  cursor: pointer;
}
#rb-bar button:active { background: #e9ddbe; }

/* 导出浮层 */
#export-box {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fdfaf1;
  border-top: 2px solid #8a5a24;
  padding: 16px;
  z-index: 999;
  display: none;
  max-height: 70vh;
}
#export-box.open { display: block; }
#export-box h3 { margin: 0 0 10px; font-size: 16px; color: #4c3d28; }
#export-box textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 200px;
  border: 1px solid #c9b88e;
  border-radius: 4px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.6;
  font-family: inherit;
  background: #fff;
  color: #3a2f22;
}
#export-box .ap-actions { display: flex; gap: 8px; margin-top: 10px; }
#export-box .ap-actions button { flex: 1; padding: 11px 0; border-radius: 4px; font-size: 15px; cursor: pointer; border: 1px solid #c9b88e; }
#export-box #export-copy { background: #8a5a24; color: #f7efdb; border-color: #8a5a24; }
#export-box #export-close { background: #fff; color: #5c5040; }

@media (max-width: 640px) {
  .rb { width: 20px; height: 20px; line-height: 18px; font-size: 13px; }
}
