.table-gallery {
  width: 252px;
  padding: 9px;
}
.table-grid-caption {
  padding: 3px 3px 9px;
  font-weight: 600;
  min-height: 28px;
}
.table-grid {
  display: grid;
  grid-template-columns: repeat(10, 20px);
  gap: 3px;
  padding: 0 2px 12px;
}
.table-grid button {
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  border: 1px solid #a4a4a4;
  border-radius: 0;
  background: white;
}
.table-grid button.table-grid-active {
  border-color: #185abd;
  background: #dbeafe;
}
.table-grid button:focus-visible {
  outline: 2px solid #185abd;
  outline-offset: 1px;
}
.table-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 5px;
}
.table-dimensions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.table-dimensions label {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.table-dimensions input[type="number"] {
  width: 66px;
}
.table-dimensions input[type="color"] {
  width: 30px;
  height: 24px;
  padding: 1px;
}
.table-dimensions select {
  max-width: 100px;
}
.table-dialog {
  width: min(380px, calc(100vw - 32px));
  padding: 22px;
}
.table-dialog fieldset {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #d5d9df;
}
.table-dialog label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
  gap: 14px;
}
.table-dialog input {
  width: 90px;
}
.table-dialog select {
  max-width: 190px;
}
#table-insert-error {
  color: #a61b1b;
}
.table-column-resize {
  cursor: col-resize !important;
}
.table-resize-preview {
  position: fixed;
  width: 1px;
  border-left: 2px dashed #185abd;
  z-index: 10000;
  pointer-events: none;
}
/* 表格上下文沿用 Word 的分组顺序；固定按钮几何，不随样式或正文排版改变。 */
.table-ribbon {
  padding: 7px 22px 4px 6px;
  gap: 0;
}
.table-ribbon .ribbon-group {
  padding-inline: 9px;
  border-color: #d9d9d9;
}
.table-ribbon .group-content {
  gap: 3px;
}
.table-ribbon .group-label {
  font-size: 12px;
}
.table-ribbon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.table-ribbon .large-tool {
  min-width: 47px;
  padding: 1px 4px;
  gap: 2px;
  font-size: 13px;
  justify-content: flex-start;
  line-height: 17px;
}
.table-ribbon .large-tool > svg {
  width: 32px;
  height: 32px;
}
.table-ribbon button:disabled {
  opacity: 0.42;
}
.table-chevron {
  line-height: 8px;
  height: 9px;
  font-size: 15px;
}
.table-ribbon .table-dimensions {
  gap: 4px;
  justify-content: center;
}
.table-ribbon .table-dimensions input {
  width: 70px;
  height: 28px;
}
.table-ribbon .stack-tools {
  gap: 4px;
}
.table-ribbon .stack-tools button {
  height: 28px;
  padding: 2px 4px;
  white-space: nowrap;
}
.table-align-grid {
  display: grid;
  grid-template-columns: repeat(3, 25px);
  grid-template-rows: repeat(3, 24px);
  gap: 0 2px;
}
.table-align-grid button {
  padding: 2px;
  width: 25px;
  height: 24px;
  min-height: 0;
}
.table-align-symbol {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid #555;
  width: 19px;
  height: 20px;
  padding: 2px;
}
.table-align-symbol i {
  display: block;
  height: 1px;
  width: 9px;
  background: #168bca;
}
.table-align-symbol i:nth-child(2) {
  width: 6px;
}
.align-v-top {
  justify-content: flex-start;
}
.align-v-center {
  justify-content: center;
}
.align-v-bottom {
  justify-content: flex-end;
}
.align-h-left {
  align-items: flex-start;
}
.align-h-center {
  align-items: center;
}
.align-h-right {
  align-items: flex-end;
}
.table-style-options {
  height: var(--ribbon-content-height);
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, 1fr);
  column-gap: 10px;
  align-items: center;
}
.table-style-options label {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 13px;
}
.table-style-options input {
  margin: 0;
  accent-color: #185abd;
  width: 15px;
  height: 15px;
}
.table-style-options label:has(:disabled) {
  opacity: 0.5;
}
.table-styles {
  display: flex;
  gap: 3px;
  padding: 2px;
  border: 1px solid #c9c9c9;
  border-radius: 3px;
  background: white;
}
.table-ribbon .table-style {
  padding: 4px;
  width: 74px;
  height: 66px;
  min-width: 74px;
  border-radius: 0;
}
.table-style-preview {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  width: 62px;
  height: 52px;
}
.table-style-preview i {
  border: 0.5px solid #bbb;
  margin: -0.1px;
}
.table-shading-tools {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 13px;
}
.table-shading-tools > button {
  font-size: 11px;
  padding: 1px 3px;
  min-height: 20px;
}
.table-ribbon .color-label {
  width: auto;
  height: auto;
  min-height: 28px;
}
.table-ribbon .color-picker-trigger {
  min-width: 48px;
  height: 28px;
}
.table-ribbon .table-shading-tools .color-picker-trigger {
  height: 28px;
}
.table-pen-tools {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 139px;
}
.table-pen-tools select {
  height: 22px;
  min-height: 22px;
  font-size: 12px;
  width: 139px;
  padding: 1px 4px;
}
.table-popup {
  min-width: 185px;
}
.table-popup svg {
  width: 22px;
  height: 22px;
}
.table-dialog-error {
  color: #a61b1b;
}
.table-ribbon button[aria-pressed="true"] {
  background: #e2eaf4;
  border-color: #9bb1cd;
}
.table-ribbon .table-style[aria-pressed="true"] {
  outline: 1px solid #526f95;
  outline-offset: -2px;
}
.table-ribbon button:focus-visible,
.table-style-options input:focus-visible {
  outline: 2px solid #185abd;
  outline-offset: 1px;
}
@media (forced-colors: active) {
  .table-style-preview i {
    forced-color-adjust: none;
  }
}
