/* A shared action hierarchy for the Chinese administration UI. */
.cms-admin .btn { cursor: pointer; flex-shrink: 0; }
.cms-admin .btn:disabled { cursor: not-allowed; }
.cms-admin .btn.secondary { color: #1677ff; border-color: #91caff; background: #f0f7ff; box-shadow: none; }
.cms-admin .btn.secondary:hover { color: #0958d9; border-color: #4096ff; background: #e6f4ff; }
.cms-admin .btn:disabled:is(.secondary, .danger, .primary) { color: #bfbfbf; border-color: #d9d9d9; background: #f5f5f5; box-shadow: none; }
.cms-admin :is(.cms-button-group, .cms-editor-actions) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cms-admin :is(.cms-toolbar, .cms-page-head, .cms-panel-title) > .row { gap: 10px; }
.cms-admin .cms-toolbar .search-form { align-items: center; }
.cms-admin .cms-toolbar .search-form input { width: 280px; }
.cms-admin .cms-toolbar + .cms-table-wrap { margin-top: 4px; }

.cms-admin .cms-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; min-height: 28px; }
.cms-admin .cms-row-actions .btn.cms-action-link {
  padding: 2px 0;
  min-height: 28px;
  border: 0;
  border-radius: 3px;
  color: #1677ff;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  line-height: 24px;
  text-decoration: none;
}
.cms-admin .cms-row-actions .btn.cms-action-link:hover { color: #0958d9; background: #e6f4ff; box-shadow: 0 0 0 4px #e6f4ff; }
.cms-admin .cms-row-actions .btn.cms-action-link.danger { color: #ff4d4f; }
.cms-admin .cms-row-actions .btn.cms-action-link.danger:hover { color: #cf1322; background: #fff2f0; box-shadow: 0 0 0 4px #fff2f0; }
.cms-admin .cms-row-actions .btn.cms-action-link:disabled { color: #bfbfbf; background: transparent; box-shadow: none; }
.cms-admin .cms-row-actions .btn.cms-more-action { gap: 4px; color: #595959; }
.cms-admin .cms-row-actions .btn.cms-more-action[aria-expanded="true"] { color: #1677ff; }
.cms-admin .cms-more-action svg { transition: transform .15s; }
.cms-admin .cms-more-action[aria-expanded="true"] svg { transform: rotate(180deg); }

.cms-admin .cms-action-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 6px;
  width: 192px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 24px #0000001a, 0 2px 6px #0000000d;
}
.cms-admin .cms-action-menu .btn {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 4px;
  color: #595959;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  text-align: left;
}
.cms-admin .cms-action-menu .btn:is(:hover, :focus-visible) { color: #1677ff; background: #e6f4ff; }
.cms-admin .cms-action-menu .btn.danger { color: #ff4d4f; }
.cms-admin .cms-action-menu .btn.danger:is(:hover, :focus-visible) { color: #cf1322; background: #fff2f0; }
.cms-admin .cms-action-menu .btn.danger:not(:first-child) { margin-top: 6px; border-top: 1px solid #f0f0f0; border-top-left-radius: 0; border-top-right-radius: 0; }

.cms-admin .cms-content-table { min-width: 920px; }
.cms-admin .cms-content-table .cms-thumbnail-column { width: 108px; }
.cms-admin .cms-content-title { min-width: 220px; max-width: 480px; }
.cms-admin .cms-content-title strong { display: block; line-height: 22px; overflow-wrap: anywhere; }
.cms-admin .cms-content-site { min-width: 130px; }
.cms-admin .cms-content-category { min-width: 120px; max-width: 200px; overflow-wrap: anywhere; }
.cms-admin .cms-content-stats { min-width: 120px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cms-admin .cms-content-stats strong { display: inline; white-space: nowrap; }
.cms-admin .cms-content-updated { min-width: 160px; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.cms-admin .cms-actions-column { width: 196px; min-width: 196px; }
.cms-admin .cms-actions-column .cms-row-actions { flex-wrap: nowrap; }
.cms-admin .cms-card-actions { padding-top: 16px; margin-top: 16px; border-top: 1px solid #f0f0f0; }
.cms-admin .cms-editor-head { align-items: flex-start; gap: 16px; padding: 16px 20px; background: #fff; border: 1px solid #f0f0f0; border-radius: 8px; }
.cms-admin .cms-editor-context { display: grid; gap: 6px; flex-shrink: 0; }
.cms-admin .cms-editor-context > span { font-size: 12px; color: #8c8c8c; }
.cms-admin .cms-editor-actions { justify-content: flex-end; margin-left: auto; gap: 10px 16px; }
.cms-admin .cms-editor-actions .cms-row-actions { padding-inline: 4px; }
.cms-admin .cms-page-head > .row:empty { display: none; }
.cms-admin .cms-gallery-field > .row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.cms-admin .cms-gallery-field > .row .btn { width: 100%; }
.cms-admin .cms-editor .cms-card > .check { margin: 16px 0 12px; }
.cms-admin .cms-editor [data-editor-save] { width: 100%; margin-top: 12px; }
.cms-admin .cms-inquiry > .cms-stack { gap: 10px; }
.cms-admin .cms-job-actions { min-width: 180px; }

/* Footer actions stay together on the right, including forms with a hint. */
.cms-admin .dialog-foot { justify-content: flex-end; gap: 10px; }
.cms-admin .dialog-foot > :is(span, small, p):first-child { margin-right: auto; }
.cms-admin .dialog-foot > span:empty { display: none; }
.cms-admin .dialog-foot > .hint { flex: 1 1 240px; }
.cms-admin .cms-delete-confirm + .form-error:empty { display: none; }
@media (min-width: 901px) {
  .cms-admin .cms-content-table .cms-actions-column { position: sticky; right: 0; background: #fff; box-shadow: -8px 0 8px -8px #00000026; }
  .cms-admin .cms-content-table th.cms-actions-column { background: #fafafa; z-index: 1; }
  .cms-admin .cms-content-table tr:hover td.cms-actions-column { background: #fafafa; }
}
@media (max-width: 720px) {
  .cms-admin .cms-editor-head { padding: 14px 16px; }
  .cms-admin .cms-editor-actions { width: 100%; justify-content: flex-start; margin-left: 0; }
  .cms-admin .cms-toolbar .search-form { min-width: 0; }
  .cms-admin .cms-toolbar .search-form input { width: 100%; flex: 1; }
  .cms-admin .cms-toolbar .pager { flex-wrap: wrap; }
  .cms-admin .cms-toolbar > .row { max-width: 100%; }
  .cms-admin .dialog-foot { padding: 12px 16px; }
  .cms-admin .dialog-foot > .hint { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cms-admin .cms-more-action svg { transition: none; }
}
