:root {
  --ink: #17202a;
  --muted: #66717d;
  --line: #dfe4e8;
  --brand: #223f63;
  --accent: #b78b43;
  --soft: #f6f8fa;
  --white: #fff;
  --danger: #b44a3f;
  --header-h: 56px;
  --sidebar-w: 250px;
}

* {
  box-sizing: border-box;
}

body {
  height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: var(--soft);
}

a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

/* ---------- 顶栏 ---------- */
.admin-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--header-h);
  padding: 0 16px;
  color: #fff;
  background: #162435;
  box-shadow: 0 6px 18px rgba(17, 27, 38, .16);
  z-index: 30;
}

.admin-header__brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-header__brand strong {
  font-size: 16px;
  line-height: 1.2;
}

.admin-header__brand span {
  color: #a9b8c6;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.admin-header .admin-link {
  padding: 6px 10px;
  color: #d7e0e8;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
}

.admin-header .admin-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

.admin-menu {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.admin-menu span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.save-state {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #cfd9e2;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.save-state.is-dirty {
  color: #2b1c07;
  background: var(--accent);
}

.btn-save {
  min-height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  color: #111a24;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.btn-save:hover {
  filter: brightness(1.05);
}

.btn-cancel {
  min-height: 36px;
  padding: 0 14px;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, .24);
}

.panel-foot .btn-cancel {
  color: #66717d;
  background: #fff;
  border: 1px solid var(--line);
}

.panel-foot .btn-cancel:hover {
  color: #8c241b;
  border-color: #d39088;
  background: #fff7f5;
}

.drag-ghost {
  position: absolute;
  top: -1000px;
  left: -1000px;
  max-width: 220px;
  padding: 7px 12px;
  color: #fff;
  background: var(--brand);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 20px rgba(17, 27, 38, .3);
}

.badge {
  display: inline-block;
  min-width: 16px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #d9dee4;
  color: #4c5866;
  font-size: 11px;
  font-style: normal;
  text-align: center;
}

.badge--muted {
  background: #f0e2c8;
  color: #7a5a17;
}

/* ---------- 骨架 ---------- */
.admin-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.admin-sidebar {
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px 24px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.admin-sidebar__search {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 0 8px;
  background: #fff;
}

.admin-sidebar__search input {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 400;
}

.admin-nav {
  display: grid;
  gap: 6px;
}

.nav-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.nav-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  background: #f4f7f9;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.nav-group__head em {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
}

.nav-group__head::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .18s ease;
}

.nav-group[data-open="1"] .nav-group__head::after {
  transform: rotate(-135deg);
}

.nav-group__items {
  display: none;
  padding: 6px;
  gap: 2px;
}

.nav-group[data-open="1"] .nav-group__items {
  display: grid;
}

.nav-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px 8px 12px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}

.nav-item:hover {
  background: #f2f6f9;
}

.nav-item.is-active {
  border-left-color: var(--accent);
  background: #eef3f7;
  color: var(--brand);
  font-weight: 800;
}

.nav-item__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item__sub {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item .badge {
  justify-self: start;
}

.nav-item--new .nav-item__label::before {
  content: "+ ";
  color: var(--accent);
  font-weight: 800;
}

.nav-item.is-filtered {
  display: none;
}

.admin-sidebar__hint {
  margin: 0 0 8px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.admin-sidebar__hint.is-active {
  color: #7a5a17;
  font-weight: 700;
}

.nav-item--sortable {
  padding-left: 24px;
  cursor: grab;
}

.nav-item--sortable:active {
  cursor: grabbing;
}

.nav-item__grip {
  position: absolute;
  left: 8px;
  top: 10px;
  width: 10px;
  height: 16px;
  background-image: radial-gradient(circle, #b3bcc4 1.3px, transparent 1.4px);
  background-size: 5px 5px;
}

.nav-item--sortable:hover .nav-item__grip {
  background-image: radial-gradient(circle, var(--brand) 1.3px, transparent 1.4px);
}

.nav-item.is-dragging {
  opacity: .5;
}

.nav-item.is-drop-before {
  box-shadow: inset 0 3px 0 0 var(--accent);
}

.nav-item.is-drop-after {
  box-shadow: inset 0 -3px 0 0 var(--accent);
}

.admin-main {
  min-height: 0;
  overflow-y: auto;
}

.admin-main__inner {
  width: min(1000px, 100%);
  margin: 0 auto;
  padding: 14px 18px 90px;
}

/* ---------- 面板 ---------- */
.admin-panel {
  display: none;
  margin-bottom: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(17, 27, 38, .07);
}

.admin-panel.is-active {
  display: block;
}

.admin-panel__head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  padding: 14px 18px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
}

.admin-panel__head h2 {
  margin: 0;
  font-size: 19px;
}

.admin-panel__path {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-panel__link {
  margin-left: auto;
  font-size: 13px;
}

.panel-note {
  margin: 12px 18px 0;
  padding: 9px 12px;
  border-left: 3px solid var(--accent);
  background: #fdf8ef;
  color: #6a5426;
  font-size: 13px;
}

.panel-note a {
  font-weight: 800;
}

.panel-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.panel-nav {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.panel-nav__link {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
}

.panel-nav__link.is-disabled {
  color: #a9b2bb;
  border-style: dashed;
  font-weight: 400;
}

/* ---------- 折叠分区 ---------- */
.field-group {
  position: relative;
  margin: 12px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.field-group > summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: #fbfcfd;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.field-group > summary::-webkit-details-marker {
  display: none;
}

.field-group > summary:hover {
  background: #f3f7fa;
}

.field-group__title {
  font-size: 15px;
  font-weight: 800;
}

.field-group__note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.field-group > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .18s ease;
}

.field-group[open] > summary {
  border-bottom: 1px solid var(--line);
}

.field-group[open] > summary::after {
  transform: rotate(-135deg);
}

.field-group__body {
  padding: 14px;
}

/* ---------- 表单 ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 700;
}

.field-group__body > label:last-child,
.field-group__body > div:last-child label:last-child {
  margin-bottom: 0;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-weight: 400;
  background: #fff;
}

select {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(34, 63, 99, .12);
}

input[type="file"] {
  padding: 9px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-top: 23px;
}

.check-row input {
  width: auto;
  margin: 0;
}

.check-row--inline {
  min-height: 0;
  margin: 0;
  font-size: 13px;
}

.field-note {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.notice {
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 6px;
  font-weight: 700;
}

.notice--success {
  color: #0f4f3e;
  background: #dff4ec;
}

.notice--error {
  color: #8c241b;
  background: #ffe2df;
}

/* ---------- 图片字段 ---------- */
.image-field {
  margin: 12px 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.image-field__title {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 800;
}

.image-field__controls {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(200px, .6fr);
  gap: 10px;
  margin-top: 10px;
}

.image-field__controls label {
  margin-bottom: 0;
}

.image-preview {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.image-preview a {
  display: block;
}

.image-thumb {
  position: relative;
  display: block;
  flex: 0 0 150px;
}

.image-preview img {
  width: 150px;
  height: 88px;
  max-width: 150px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.image-preview div {
  min-width: 0;
}

.image-preview strong {
  display: block;
  margin: 4px 0 6px;
}

.image-preview span {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.image-preview--empty {
  min-height: 88px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-style: dashed;
}

.image-preview--editable {
  position: relative;
}

.image-preview--editable .preview-remove {
  top: 4px;
  right: 4px;
}

.gallery-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 10px 0 16px;
}

.gallery-preview__item {
  position: relative;
  cursor: grab;
  transition: opacity .18s ease, transform .18s ease;
}

.gallery-preview__item.is-dragging {
  opacity: .45;
  transform: scale(.98);
}

.gallery-preview a {
  display: block;
  overflow: hidden;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}

.gallery-preview img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.gallery-preview span {
  display: block;
  padding: 8px;
  overflow-wrap: anywhere;
}

.drag-handle {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 2;
  padding: 3px 7px;
  color: #fff;
  background: rgba(22, 36, 53, .78);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

.preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 24px;
  min-width: 0;
  min-height: 24px;
  height: 24px;
  padding: 0;
  color: #fff;
  background: var(--danger);
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(17, 27, 38, .22);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.replace-image-button {
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 0 0 6px 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.image-preview--editable .replace-image-button {
  align-self: end;
  width: 120px;
  border-radius: 4px;
}

.upload-helper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: -4px 0 14px;
}

.pending-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.pending-preview figure {
  width: 132px;
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.pending-preview img {
  width: 100%;
  height: 78px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.pending-preview figcaption {
  padding: 6px 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.upload-status {
  color: var(--muted);
  font-size: 13px;
}

.upload-status.is-error {
  color: #8c241b;
}

.delete-control {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: -2px 0 12px;
}

.delete-control input {
  display: none;
}

.delete-toggle {
  min-height: 30px;
  padding: 0 12px;
  color: #fff;
  background: var(--danger);
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.delete-control span {
  color: var(--muted);
  font-size: 13px;
}

.sub-card {
  padding: 16px;
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sub-card--new {
  border-style: dashed;
  background: #fff;
}

.sub-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.sub-card__head h3 {
  margin: 0;
}

.sub-card__head span {
  color: var(--muted);
  font-size: 13px;
}

.sub-card.is-marked-delete {
  border-color: #d39088;
  background: #fff7f5;
  opacity: .72;
}

.is-hidden {
  display: none;
}

textarea.is-hidden {
  display: none !important;
}

/* ---------- 联系方式 ---------- */
.contact-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 18px 0;
  padding: 10px 12px;
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-quick span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.contact-quick button {
  min-height: 30px;
  padding: 0 12px;
  color: var(--brand);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.contact-quick button:hover {
  color: #111a24;
  background: var(--accent);
  border-color: var(--accent);
}

.contact-list {
  display: grid;
}

.contact-item > summary {
  padding-left: 30px;
}

.contact-item .drag-handle {
  left: 10px;
  top: 50%;
  width: 14px;
  height: 18px;
  padding: 0;
  transform: translateY(-50%);
  background: none;
  border-radius: 0;
  cursor: grab;
  pointer-events: auto;
}

.contact-item .drag-handle::before {
  content: "";
  display: block;
  width: 14px;
  height: 18px;
  background-image: radial-gradient(circle, #98a3ad 1.4px, transparent 1.5px);
  background-size: 7px 6px;
}

.contact-item.is-dragging {
  opacity: .5;
}

.contact-card__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.contact-card__title {
  font-size: 15px;
  font-weight: 800;
}

.contact-card__head .delete-control {
  margin: 0 0 0 auto;
}

.contact-method-card {
  padding: 14px;
  background: #fff;
}

.contact-method-card .contact-qr-field .image-field {
  margin: 10px 0 0;
  padding: 10px;
}

.contact-method-card .image-field__title {
  font-size: 14px;
}

.contact-method-card .image-preview {
  min-height: 76px;
}

.contact-method-card .image-thumb {
  flex-basis: 96px;
}

.contact-method-card .image-preview img {
  width: 96px;
  height: 72px;
  max-width: 96px;
}

/* ---------- 富文本编辑器 ---------- */
.rich-wrap {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.rich-toolbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: #f3f6f8;
  border-bottom: 1px solid var(--line);
}

.rich-toolbar__sep {
  width: 1px;
  height: 20px;
  margin: 0 3px;
  background: var(--line);
}

.rich-toolbar button {
  min-height: 28px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.rich-toolbar button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.rich-toolbar button.is-active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.rich-toolbar select {
  width: auto;
  min-width: 96px;
  margin: 0;
  padding: 4px 6px;
  font-size: 13px;
  font-weight: 700;
}

.rich-status {
  margin-left: auto;
  padding-right: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.rich-editor {
  min-height: 220px;
  max-height: 460px;
  overflow-y: auto;
  padding: 14px 16px;
  background: #fff;
  outline: 0;
  line-height: 1.75;
  font-size: 15px;
}

.rich-editor:focus {
  box-shadow: inset 0 0 0 2px rgba(34, 63, 99, .12);
}

.rich-editor.is-empty::before {
  content: attr(data-placeholder);
  color: #9aa5b1;
}

.rich-editor h2 {
  margin: 18px 0 10px;
  font-size: 22px;
}

.rich-editor h3 {
  margin: 16px 0 8px;
  font-size: 18px;
}

.rich-editor h4 {
  margin: 14px 0 8px;
  font-size: 16px;
}

.rich-editor p {
  margin: 0 0 10px;
}

.rich-editor blockquote {
  margin: 14px 0;
  padding: 8px 14px;
  border-left: 4px solid var(--accent);
  background: #fdf8ef;
  color: #5c6169;
}

.rich-editor hr {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.rich-editor ul,
.rich-editor ol {
  margin: 10px 0;
  padding-left: 24px;
}

.rich-editor a {
  text-decoration: underline;
}

.rich-editor p.rich-empty-paragraph {
  min-height: 28px;
  margin: 8px 0 12px;
  border-radius: 4px;
}

.rich-editor p.rich-empty-paragraph:focus {
  outline: 1px dashed rgba(34, 63, 99, .2);
  outline-offset: 4px;
}

.rich-wrap.is-fullscreen {
  position: fixed;
  inset: 24px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(17, 27, 38, .3);
}

.rich-wrap.is-fullscreen .rich-editor {
  flex: 1 1 auto;
  max-height: none;
}

.rich-image-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: -4px 0 14px;
  padding: 8px 10px;
  border: 1px solid #e1d0a8;
  border-radius: 6px;
  background: #fffaf0;
}

.rich-image-toolbar[hidden] {
  display: none;
}

.rich-image-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rich-image-toolbar button {
  min-height: 28px;
  padding: 0 10px;
  color: var(--brand);
  background: #fff;
  border: 1px solid #dccda9;
  border-radius: 4px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.rich-image-toolbar button.is-active {
  color: #111a24;
  background: var(--accent);
  border-color: var(--accent);
}

.rich-image-toolbar [data-image-remove] {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.rich-editor figure {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.rich-editor figure.rich-figure {
  width: 100%;
}

.rich-editor figure.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(183, 139, 67, .16);
}

.rich-editor figure.size-small {
  width: 42%;
}

.rich-editor figure.size-medium {
  width: 62%;
}

.rich-editor figure.size-large {
  width: 82%;
}

.rich-editor figure.size-full {
  width: 100%;
}

.rich-editor figure.align-left {
  margin-right: auto;
  margin-left: 0;
}

.rich-editor figure.align-center {
  margin-right: auto;
  margin-left: auto;
}

.rich-editor figure.align-right {
  margin-right: 0;
  margin-left: auto;
}

.rich-editor figure img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 4px;
  cursor: default;
}

.rich-editor figcaption {
  margin-top: 8px;
  padding-top: 8px;
  color: #637789;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.65;
  border-top: 1px solid #e9eef2;
}

.rich-editor figcaption,
.rich-editor figcaption * {
  color: #637789 !important;
  font-size: 13px !important;
  font-style: normal !important;
  font-weight: 400 !important;
  line-height: 1.65 !important;
}

/* ---------- 登录页 ---------- */
.admin-login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  height: auto;
  overflow: auto;
  display: grid;
}

.login-card {
  width: min(420px, 100%);
  padding: 26px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 34px rgba(17, 27, 38, .1);
}

.login-card h1 {
  margin-top: 0;
}

.login-card p {
  color: var(--muted);
}

.login-card button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  color: #111a24;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.login-card a {
  display: inline-block;
  margin-top: 16px;
}

/* ---------- 响应式 ---------- */
.admin-backdrop {
  display: none;
}

@media (max-width: 1080px) {
  .form-grid--compact,
  .image-field__controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-w: 0px;
  }

  .admin-menu {
    display: flex;
  }

  .admin-body {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: 0;
    z-index: 40;
    width: 270px;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 12px 30px rgba(17, 27, 38, .2);
  }

  body.is-sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-backdrop {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 35;
    background: rgba(17, 27, 38, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }

  body.is-sidebar-open .admin-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .form-grid,
  .form-grid--compact,
  .image-field__controls {
    grid-template-columns: 1fr;
  }

  .admin-main__inner {
    padding: 12px 12px 90px;
  }

  .field-group {
    margin: 12px;
  }

  .rich-editor figure.size-small,
  .rich-editor figure.size-medium,
  .rich-editor figure.size-large {
    width: 100%;
  }
}
