.text-insert-dialog {
  position: fixed;
  inset: auto;
  margin: 0;
  max-height: calc(100dvh - 16px);
  width: 466px;
  max-width: calc(100vw - 24px);
  padding: 0;
  border: 1px solid #b8c3d0;
  border-radius: 5px;
  box-shadow: none;
  color: #253244;
  background: #fff;
}
.text-insert-dialog::backdrop {
  background: #172b4420;
}
.text-insert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 15px;
  border-bottom: 1px solid #e1e7ef;
  background: #f8fafc;
  cursor: move;
}
.text-insert-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.text-insert-header button {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 20px;
  color: #66758a;
}
.text-insert-body {
  padding: 16px;
  min-height: 307px;
  overflow-y: auto;
}
.text-insert-dialog[open] form {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 18px);
}
.text-insert-header,
.text-insert-footer {
  flex-shrink: 0;
}
.text-insert-dialog label {
  font-size: 12px;
  line-height: 1.6;
}
.text-insert-dialog input:not([type="checkbox"]),
.text-insert-dialog select,
.text-insert-dialog textarea {
  min-width: 0;
  width: 100%;
  font: inherit;
  color: inherit;
  border: 1px solid #c6cfdb;
  border-radius: 2px;
  background: #fff;
  padding: 5px 7px;
  outline: none;
  box-sizing: border-box;
  box-shadow: none;
}
.text-insert-dialog :is(input, select, textarea, button):focus-visible {
  outline: 2px solid #78a9df;
  outline-offset: 1px;
}
.text-insert-dialog :is(input, select, textarea):focus {
  border-color: #5d93c7;
}
.text-insert-dialog textarea {
  resize: none;
}
.text-wide {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}
.text-field-row {
  display: flex;
  gap: 12px;
  align-items: end;
}
.text-field-row > label,
.text-date-summary {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.text-field-row > button {
  flex-shrink: 0;
}
.text-help {
  font-size: 12px;
  line-height: 1.7;
  color: #718096;
  margin: 12px 0 0;
}
.text-checkbox {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 8px 0;
}
.text-checkbox input {
  accent-color: #2866a3;
}
.text-style-gallery,
.text-drop-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}
.text-insert-dialog button {
  cursor: pointer;
}
.text-style-gallery button,
.text-drop-gallery button {
  display: grid;
  justify-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #d5dde7;
  padding: 9px 6px;
  border-radius: 2px;
  font: inherit;
  font-size: 12px;
}
.text-style-gallery button span {
  font-size: 26px;
  color: #2c6fa9;
  line-height: 1.2;
}
.text-style-gallery button[data-text-style="outline"] span {
  color: #fff;
  -webkit-text-stroke: 1px #2c6fa9;
}
.text-style-gallery button[data-text-style="shadow"] span {
  text-shadow: 1px 2px 0 #c4d6e4;
}
.text-style-gallery [aria-pressed="true"],
.text-drop-gallery [aria-pressed="true"] {
  background: #edf5fd;
  border-color: #4286c5;
}
.text-drop-gallery span {
  height: 42px;
  color: #526985;
  text-align: left;
  line-height: 1.4;
}
.text-drop-gallery b {
  float: left;
  font-size: 28px;
  margin-right: 4px;
}
.text-insert-footer {
  display: flex;
  justify-content: end;
  gap: 8px;
  padding: 11px 16px;
  border-top: 1px solid #e1e7ef;
}
.text-insert-footer button {
  min-width: 72px;
}
.text-insert-dialog button:disabled {
  opacity: 0.5;
  cursor: default;
}
.text-date-summary {
  align-self: stretch;
  align-content: start;
  gap: 12px;
  padding: 10px 0;
  font-size: 12px;
  color: #718096;
}
.text-date-summary output {
  color: #225d94;
  font-size: 15px;
  line-height: 1.6;
}
.text-object-illustration {
  width: 68px;
  height: 68px;
  margin: 6px auto 18px;
  padding: 14px;
  color: #3974a8;
  background: #edf4fb;
  border: 1px solid #d5e4f1;
}
.text-object-illustration svg {
  width: 100%;
  height: 100%;
}
.text-insert-error {
  font-size: 12px;
  color: #b42318;
  margin: 12px 0 0;
}
@media (max-height: 560px) {
  .text-insert-body {
    min-height: 0;
    padding: 10px 16px;
  }
  .text-wide {
    margin-bottom: 8px;
  }
  .text-help {
    margin-top: 6px;
  }
}
.text-box-menu {
  min-width: 224px;
}
.text-box-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
}
.text-box-menu kbd {
  margin-left: auto;
  color: #708096;
  font: inherit;
  font-size: 11px;
}
.text-box-menu .vertical-text-box-icon {
  transform: rotate(90deg);
}
.text-box-inline-editor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 35;
  transform-origin: 0 0;
  box-sizing: border-box;
  resize: none;
  border: 1px solid #3576be;
  outline: none;
  box-shadow: none;
  border-radius: 0;
  padding: 4.8px 9.6px;
  margin: 0;
  line-height: normal;
  overflow: auto;
  text-orientation: mixed;
  caret-color: #192735;
}
.text-box-inline-editor[hidden] {
  display: none;
}

/* 固定轻量网格；不加载缩略图，也不在悬停时重绘文档。 */
.word-art-menu {
  display: grid;
  grid-template-columns: repeat(5, 64px);
  gap: 4px;
  padding: 8px;
  width: max-content;
  max-width: calc(100vw - 16px);
  border: 1px solid #aeb8c5;
  border-radius: 4px;
  box-shadow: none;
}
.word-art-menu[hidden] {
  display: none;
}
.word-art-menu button {
  display: grid;
  place-items: center;
  min-width: 0;
  width: 64px;
  height: 68px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
}
.word-art-menu button:hover,
.word-art-menu button:focus-visible {
  background: #edf5fd;
  border-color: #6ca1d3;
  outline: none;
}
.word-art-menu button span {
  color: var(--word-art-color);
  font:
    48px/1 Arial,
    sans-serif;
}
.word-art-menu [data-word-art-preset="outline"] span {
  color: white;
  -webkit-text-stroke: 1px var(--word-art-color);
}
.word-art-menu [data-word-art-preset="shadow"] span {
  text-shadow: 2px 2px 1px #a6a6a6;
}
@media (max-width: 370px) {
  .word-art-menu {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: calc(100vw - 16px);
  }
  .word-art-menu button {
    width: 100%;
  }
}
