.remark-toolbar {
  position: fixed;
  z-index: 75;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--light);
  border: 1px solid var(--lightgray);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.remark-toolbar.show {
  display: flex;
}

.remark-toolbar button {
  font-family: var(--bodyFont);
  cursor: pointer;
}
.rt-bold {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--lightgray);
  background: transparent;
  color: var(--dark);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}
.rt-bold:hover {
  background: var(--highlight);
}
.rt-label {
  font-size: 11px;
  color: var(--gray);
  user-select: none;
}
.rt-sep {
  width: 1px;
  height: 18px;
  background: var(--lightgray);
}
.rt-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  padding: 0;
  transition: transform 0.1s ease;
}
.rt-swatch:hover {
  transform: scale(1.15);
}
.rt-remark {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid var(--lightgray);
  background: transparent;
  color: var(--dark);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 14px;
  line-height: 1;
}
.rt-remark:hover {
  background: var(--highlight);
}

.remark-range {
  border-bottom: 2px dotted var(--secondary);
  cursor: help;
}

.remark-inline {
  display: inline;
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--highlight);
  color: var(--secondary);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 0.92em;
  line-height: 1.4;
  white-space: pre-wrap;
  cursor: text;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 0.12s ease;
}
.remark-inline::before {
  content: "※ ";
  opacity: 0.65;
  user-select: none;
}
.remark-inline:hover {
  box-shadow: inset 0 0 0 1px var(--secondary);
}
.remark-inline.editing {
  outline: 1px solid var(--secondary);
  outline-offset: 1px;
  background: var(--light);
}
.remark-inline:empty::before {
  content: "写批注…";
  opacity: 0.45;
  font-family: var(--bodyFont);
  font-style: normal;
}

.remark-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  background: var(--dark);
  color: var(--light);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 77;
}
.remark-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sync-pill {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  padding: 5px 10px;
  border: 1px solid var(--lightgray);
  border-radius: 999px;
  background: var(--light);
  color: var(--gray);
  font-family: var(--bodyFont);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sync-pill:hover {
  opacity: 1;
}
.sync-pill.on {
  color: var(--secondary);
  border-color: var(--secondary);
  opacity: 0.8;
}
