html,
body {
  height: 100%;
}

body {
  background: #f0f0eb;
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  align-items: start;
  overflow: hidden;
}

.admin-sidebar {
  padding: 32px 24px;
  color: #ffffff;
  background: #111111;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow: hidden;
}

.admin-sidebar__brand {
  display: block;
  margin-bottom: 28px;
  letter-spacing: 0.28em;
}

.admin-sidebar__menu {
  display: grid;
  gap: 12px;
}

.admin-sidebar__nav {
  display: grid;
  gap: 12px;
}

.admin-sidebar__nav a,
.admin-sidebar__menu > a {
  display: block;
  width: 100%;
  padding: 0;
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
}

.admin-sidebar__nav a.is-active {
  color: #ffffff;
}

.admin-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  height: 100vh;
  padding: 28px 32px;
  overflow: hidden;
}

.admin-page-head {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.admin-page-head h1,
.admin-login__card h1 {
  margin: 0;
  line-height: 1.2;
  font-weight: 400;
}

.admin-page-head .section-heading__eyebrow {
  margin: 0;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.admin-stat-card,
.admin-app-shell,
.admin-login__card {
  background: #ffffff;
  border: 1px solid #d8d8d0;
}

.admin-app-shell {
  height: 100%;
  min-height: 0;
  padding: 20px;
  overflow: hidden;
}

.admin-layout:not(.admin-layout--workspace) {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

.admin-layout:not(.admin-layout--workspace) .admin-sidebar {
  overflow-y: auto;
}

.admin-main:not(.admin-main--workspace) {
  display: block;
  height: auto;
  padding: 40px;
  overflow: visible;
}

.admin-main:not(.admin-main--workspace) .admin-page-head {
  display: block;
}

.admin-main:not(.admin-main--workspace) .admin-page-head h1 {
  margin: 0 0 24px;
}

.admin-app-shell:not(.admin-app-shell--workspace) {
  height: auto;
  padding: 28px;
  overflow: visible;
}

.admin-stat-card {
  padding: 24px;
}

.admin-stat-card span {
  display: block;
  color: #666666;
}

.admin-stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  font-weight: 400;
}

.admin-login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.admin-login__card {
  width: min(420px, calc(100% - 32px));
  padding: 32px;
}

.admin-login__form,
.admin-form {
  display: grid;
  gap: 16px;
}

.admin-login__form label,
.admin-form label {
  display: grid;
  gap: 8px;
}

.admin-login__form input,
.admin-form input,
.admin-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cfcfc6;
}

.admin-form textarea {
  resize: none;
}

.admin-form input[type="file"] {
  padding: 12px 14px;
  border: 1px dashed #cfcfc6;
  background: #fafaf7;
}

.admin-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-toolbar--stacked {
  display: grid;
  gap: 24px;
}

.admin-toolbar > :first-child {
  width: min(100%, 320px);
}

.admin-toolbar .admin-form {
  width: min(100%, 440px);
}

.admin-grid {
  display: grid;
  gap: 20px;
}

.admin-card,
.admin-table {
  background: #ffffff;
  border: 1px solid #d8d8d0;
}

.admin-card {
  display: grid;
  grid-template-columns: 220px 1fr;
}

.admin-card img {
  height: 100%;
  min-height: 180px;
  object-fit: cover;
}

.admin-card__body {
  padding: 20px;
}

.admin-card__actions,
.admin-table__actions {
  display: flex;
  gap: 12px;
}

.admin-card__actions {
  margin-top: 16px;
}

.admin-table__actions {
  align-items: center;
  justify-content: flex-start;
}

.admin-card__actions button:last-child,
.admin-table__actions button:last-child {
  background: #7a1f1f;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 16px;
  border-bottom: 1px solid #ecece7;
  text-align: left;
  vertical-align: top;
}

.admin-table td:last-child {
  width: 120px;
}

.admin-table--messages {
  table-layout: fixed;
  width: 100%;
}

.admin-table--messages th {
  position: relative;
  user-select: none;
}

.admin-table--messages th:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  background: transparent;
}

.admin-table--messages th:not(:last-child):hover::after {
  background: rgba(17, 17, 17, 0.15);
}

.admin-messages-panel {
  display: grid;
  gap: 20px;
}

.admin-col-name {
  width: 180px;
  min-width: 120px;
}

.admin-col-email {
  width: 220px;
  min-width: 120px;
  word-break: break-word;
}

.admin-col-message {
  width: auto;
  min-width: 200px;
  word-break: break-word;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.admin-col-time {
  width: 200px;
  min-width: 160px;
  white-space: nowrap;
}

.admin-messages-panel__pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.admin-messages-panel__pagination .is-current {
  background: #111111;
  color: #ffffff;
}

.admin-hero-inline {
  display: grid;
  gap: 16px;
  padding: 20px 24px;
  border: 1px solid #d8d8d0;
  background: #fafaf7;
}

.admin-hero-inline__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-hero-inline__head h2,
.admin-site-panel h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.admin-hero-inline__head p,
.admin-site-panel p,
.admin-site-preview-card p {
  margin: 0;
  color: #666666;
}

.admin-hero-inline__body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: start;
}

.admin-hero-inline__preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111111;
}

.admin-hero-inline__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-hero-inline__empty {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.08em;
}

.admin-hero-inline__form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.admin-hero-inline__actions {
  display: flex;
  gap: 12px;
}

.admin-galleries-panel {
  display: grid;
  gap: 24px;
}

.admin-galleries-panel__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 28px;
  align-items: stretch;
}

.admin-galleries-panel__hero-panel,
.admin-galleries-panel__workspace,
.admin-galleries-panel__library {
  display: grid;
  gap: 20px;
  align-content: start;
  padding: 24px;
  border: 1px solid #ecece7;
  background: #fafaf7;
}

.admin-galleries-panel__hero-panel {
  min-width: 0;
  height: 100%;
}

.admin-galleries-panel__workspace {
  display: grid;
  align-content: start;
}

.admin-galleries-panel__library {
  grid-column: 1 / -1;
}

.admin-galleries-panel__header {
  display: grid;
  gap: 8px;
}

.admin-galleries-panel__header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.admin-galleries-panel__header p,
.admin-galleries-panel__hero-panel > p {
  margin: 0;
  color: #666666;
}

.admin-galleries-panel__hero-preview,
.admin-galleries-panel__hero-empty {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.admin-galleries-panel__hero-preview {
  overflow: hidden;
  background: #111111;
}

.admin-galleries-panel__hero-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-galleries-panel__hero-empty {
  display: grid;
  place-items: center;
  background: #1a1a1a;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.08em;
}

.admin-galleries-panel__side-actions {
  display: flex;
  justify-content: flex-start;
}

.admin-galleries-panel__hero-settings {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #ecece7;
  background: #ffffff;
}

.admin-galleries-panel__hero-settings p {
  margin: 0;
  color: #666666;
}

.admin-galleries-form {
  width: 100%;
}

.admin-galleries-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.admin-galleries-form__field {
  min-width: 0;
}

.admin-galleries-form__field--wide {
  grid-column: 1 / -1;
}

.admin-galleries-form__status,
.admin-galleries-form__actions {
  grid-column: 1 / -1;
}

.admin-galleries-form__status {
  margin: 0;
  color: #666666;
}

.admin-galleries-form__hint {
  margin: 0;
  color: #666666;
  font-size: 0.85rem;
  text-align: right;
}

.admin-galleries-form__actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-editor {
  display: grid;
  gap: 12px;
}

.admin-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-editor__toolbar button.is-active {
  background: #111111;
  color: #ffffff;
}

.admin-editor__content {
  min-height: 360px;
  padding: 18px;
  border: 1px solid #cfcfc6;
  background: #ffffff;
  cursor: text;
}

.admin-editor__content .ProseMirror {
  min-height: 320px;
  outline: none;
}

.admin-editor__content .ProseMirror > * + * {
  margin-top: 1rem;
}

.admin-editor__content img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.admin-editor__help {
  margin: 0;
  color: #666666;
  font-size: 0.92rem;
}

.admin-galleries-panel__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

.admin-galleries-panel__library-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  width: 100%;
}

.admin-galleries-panel__primary-actions {
  display: flex;
  gap: 12px;
}

.admin-galleries-panel__bulk-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-galleries-panel__select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-galleries-panel__search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  width: min(100%, 420px);
  justify-self: center;
}

.admin-galleries-panel__search input {
  width: 100%;
}

.admin-galleries-panel__table {
  display: grid;
  padding-top: 20px;
  gap: 20px;
  border-top: 1px solid #ecece7;
}

.admin-galleries-panel__table .admin-table {
  width: 100%;
}

.admin-galleries-panel__pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-top: 20px;
}

.admin-galleries-panel__pagination .is-current {
  background: #111111;
  color: #ffffff;
}

.admin-site-page {
  display: grid;
  gap: 16px;
  height: 100%;
}

.admin-site-page__loading {
  display: grid;
  place-items: center;
  color: #666666;
}

.admin-site-page__row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.admin-site-page__card {
  background: #ffffff;
  border: 1px solid #e1e1da;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.admin-site-page__card--form {
  align-content: start;
}

.admin-site-page__card--full {
  grid-column: 1 / -1;
}

.admin-site-page__card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.admin-site-page__card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-site-page__card-head h3 {
  margin: 0;
}

.admin-site-page__card-head button {
  padding: 6px 12px;
  border: 1px solid #d0d0c8;
  background: #ffffff;
  font-size: 0.85rem;
  cursor: pointer;
}

.admin-site-page__card-head button:hover {
  border-color: #111111;
}

.admin-site-page__preview {
  width: 40px;
  height: 40px;
  background: #f5f5f0;
  overflow: hidden;
  flex-shrink: 0;
}

.admin-site-page__preview--avatar {
  border-radius: 50%;
}

.admin-site-page__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-site-page__preview-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #999999;
  font-size: 0.6rem;
}

.admin-site-page__image-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-site-page__upload-btn {
  padding: 6px 10px;
  border: 1px solid #d0d0c8;
  background: #ffffff;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.admin-site-page__upload-btn:hover {
  border-color: #111111;
}

.admin-site-page__url-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid #d0d0c8;
  font-size: 0.85rem;
}

.admin-site-page__url-input:focus {
  outline: none;
  border-color: #111111;
}

.admin-site-page__fields {
  display: grid;
  gap: 10px;
}

.admin-site-page__fields--social {
  grid-template-columns: repeat(3, 1fr);
}

.admin-site-page__field {
  display: grid;
  gap: 4px;
}

.admin-site-page__field span {
  font-size: 0.78rem;
  color: #666666;
}

.admin-site-page__field input,
.admin-site-page__field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d0d0c8;
  font-size: 0.9rem;
}

.admin-site-page__field input:focus,
.admin-site-page__field textarea:focus {
  outline: none;
  border-color: #111111;
}

.admin-site-page__field textarea {
  resize: none;
}

.admin-site-page__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
}

.admin-site-page__actions button {
  padding: 10px 24px;
  border: 1px solid #111111;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  font-size: 0.9rem;
}

.admin-site-page__actions button:hover {
  background: #333333;
}

.admin-site-page__actions button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-site-page__success {
  margin: 0;
  color: #2d7a4a;
  font-size: 0.9rem;
}

.admin-site-page__error {
  margin: 0;
  color: #7a1f1f;
  font-size: 0.9rem;
}

.admin-empty {
  padding: 24px;
  color: #666666;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .admin-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .admin-main {
    height: auto;
    padding: 24px;
    overflow: visible;
  }

  .admin-stats,
  .admin-card,
  .admin-galleries-panel__layout,
  .admin-hero-inline__body,
  .admin-site-page__row,
  .admin-site-page__fields--social {
    grid-template-columns: 1fr;
  }

  .admin-galleries-panel__hero-panel,
  .admin-galleries-panel__workspace,
  .admin-galleries-panel__library {
    padding: 20px;
  }

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

  .admin-galleries-panel__library-actions,
  .admin-galleries-panel__search {
    grid-template-columns: 1fr;
  }

  .admin-galleries-panel__controls {
    align-items: flex-start;
  }

  .admin-galleries-panel__search {
    width: 100%;
    justify-self: stretch;
  }

  .admin-toolbar {
    flex-direction: column;
  }
}

.admin-page-head--with-back {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.admin-page-head--with-back > div {
  display: grid;
  gap: 6px;
}

.admin-page-head__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.admin-page-head--with-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.admin-page-head--with-actions > div:first-child {
  display: grid;
  gap: 6px;
}

.admin-images__header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-images__header-actions input[type="text"] {
  padding: 8px 12px;
  border: 1px solid #d0d0c8;
  min-height: 38px;
  width: 200px;
}

.admin-images__header-sync {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid #d0d0c8;
  background: #f5f4ef;
  color: #111111;
  cursor: pointer;
}

.admin-images__header-sync:hover {
  background: #eceae2;
}

.admin-images__header-sync:disabled {
  opacity: 0.6;
  cursor: wait;
}

.admin-images__header-upload input {
  display: none;
}

.admin-images__header-upload span {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid #111111;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.admin-images__header-upload:hover span {
  background: #333333;
}

.admin-gallery-edit-page__limits {
  display: flex;
  justify-content: center;
  padding: 0 16px;
  color: #666666;
  font-size: 0.85rem;
  white-space: nowrap;
}

.admin-main--gallery-edit {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  padding-top: 20px;
}

.admin-back-link {
  width: fit-content;
  line-height: 1.2;
  color: #666666;
}

.admin-hero-page {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  height: 100%;
  min-height: 0;
  align-items: start;
}

.admin-hero-page__panel {
  display: grid;
  gap: 18px;
  min-height: 0;
  padding: 22px;
  border: 1px solid #ecece7;
  background: #fafaf7;
}

.admin-hero-page__panel--controls {
  align-content: start;
  grid-auto-rows: max-content;
  height: fit-content;
}

.admin-hero-page__visual {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  padding: 22px;
  border: 1px solid #ecece7;
  background: #ffffff;
}

.admin-hero-page__visual-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.admin-hero-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-hero-page__header h2,
.admin-gallery-browser__toolbar h2,
.admin-gallery-edit__section-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
}

.admin-hero-page__header p,
.admin-hero-page__visual-head p,
.admin-gallery-browser__toolbar p,
.admin-gallery-edit__section-head p,
.admin-gallery-row__meta,
.admin-gallery-row__description {
  margin: 0;
  color: #666666;
}

.admin-hero-page__preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: min(62vh, 560px);
  overflow: hidden;
  background: #111111;
  border: 1px solid #ecece7;
}

.admin-hero-page__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-hero-page__preview-empty,
.admin-gallery-row__cover-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.08em;
}

/* Hero 预览布局 - PC端和手机端 */
.admin-hero-page__previews {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.6fr);
  gap: 24px;
  align-items: stretch;
}

.admin-hero-page__preview-item {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.admin-hero-page__preview-item h4 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: #666666;
}

.admin-hero-page__preview--mobile {
  height: 100%;
}

.admin-hero-page__preview-empty small {
  display: block;
  margin-top: 8px;
  font-size: 0.75rem;
  opacity: 0.7;
}

.admin-hero-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

.admin-hero-page__actions button {
  min-width: 100px;
}

.admin-hero-page__error,
.admin-gallery-browser__error {
  margin: 0;
  color: #7a1f1f;
}

.admin-hero-page__success {
  margin: 0;
  color: #2d7a4a;
}

.admin-gallery-edit__success {
  margin: 0;
  padding: 12px 20px;
  color: #2d7a4a;
  font-size: 0.92rem;
  background: #f0fff5;
  border-top: 1px solid #b0e0c0;
}

.admin-gallery-browser {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  height: 100%;
  min-height: 0;
}

.admin-gallery-browser__toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.admin-gallery-browser__title {
  display: grid;
  gap: 4px;
}

.admin-gallery-browser__search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  max-width: 720px;
}

.admin-gallery-browser__list-shell {
  min-height: 0;
  overflow-y: auto;
  max-height: calc(100vh - 340px);
  padding-right: 8px;
}

.admin-gallery-list {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.admin-gallery-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 0;
  padding: 12px 14px;
  border: 1px solid #ecece7;
  background: #fafaf7;
}

.admin-gallery-row__cover {
  flex-shrink: 0;
  width: 112px;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: #ecece7;
}

.admin-gallery-row__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-gallery-row__body {
  flex: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.admin-gallery-row__body h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.admin-gallery-row__description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.45;
  font-size: 0.95rem;
}

.admin-gallery-row__meta {
  font-size: 0.86rem;
}

.admin-gallery-row__actions,
.admin-gallery-browser__pagination,
.admin-gallery-edit__toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.admin-gallery-browser__pagination {
  justify-content: center;
  padding-top: 4px;
}

.admin-gallery-browser__pagination .is-current {
  background: #111111;
  color: #ffffff;
}

.admin-gallery-edit {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
}

.admin-gallery-edit-shell {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
}

.admin-gallery-edit__workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.admin-gallery-edit__topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 16px;
  align-items: end;
  padding: 16px 18px;
  border: 1px solid #e1e1da;
  background: #ffffff;
}

.admin-gallery-edit__identity {
  display: grid;
  gap: 4px;
  align-content: end;
}

.admin-gallery-edit__back {
  font-size: 0.92rem;
}

.admin-gallery-edit__eyebrow {
  margin: 0;
  color: #666666;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.admin-gallery-edit__identity h1 {
  margin: 0;
  line-height: 1.05;
  font-size: clamp(2rem, 2.6vw, 2.6rem);
  font-weight: 500;
}

.admin-gallery-edit__meta {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  min-width: 0;
}

.admin-gallery-edit__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex-shrink: 0;
}

.admin-gallery-edit__field--title {
  width: 240px;
}

.admin-gallery-edit__field--cover-url {
  width: 180px;
}

.admin-gallery-edit__field--description {
  flex: 1;
  min-width: 200px;
}

.admin-gallery-edit__field > span,
.admin-gallery-edit__meta-upload > span:first-of-type {
  color: #666666;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.admin-gallery-edit__input-wrap {
  position: relative;
  width: 100%;
}

.admin-gallery-edit__input-wrap input,
.admin-gallery-edit__field > input {
  width: 100%;
  min-height: 44px;
}

.admin-gallery-edit__input-wrap input {
  padding-right: 60px;
}

.admin-gallery-edit__counter {
  position: absolute;
  right: 8px;
  bottom: 6px;
  color: #8a8a84;
  font-size: 0.68rem;
  pointer-events: none;
}

.admin-gallery-edit__meta input {
  min-height: 44px;
}

.admin-gallery-edit__action-upload {
  white-space: nowrap;
}

.admin-gallery-edit__actions {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
}

.admin-gallery-edit__editor-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #e1e1da;
  background: #ffffff;
}

.admin-gallery-edit__save,
.admin-gallery-edit__action-upload {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #d0d0c8;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.admin-gallery-edit__save {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

.admin-gallery-edit__save:hover,
.admin-gallery-edit__action-upload:hover {
  border-color: #111111;
}

.admin-gallery-edit__editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #e1e1da;
  background: #fafaf7;
}

.admin-gallery-edit__editor-toolbar button {
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6c6c64;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
  flex: 0 0 auto;
}

.admin-gallery-edit__editor-toolbar button:hover,
.admin-gallery-edit__editor-toolbar button:focus-visible,
.admin-gallery-edit__editor-toolbar button.is-active {
  color: #111111;
  background: #f1efe8;
}

.admin-gallery-edit__tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
}

.admin-gallery-edit__tool-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.admin-gallery-edit__toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #e1e1da;
  border-radius: 10px;
  background: #ffffff;
  flex: 0 0 auto;
}

.admin-gallery-edit__image-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
}

.admin-gallery-edit__image-align {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.admin-gallery-edit__image-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6c6c64;
  cursor: pointer;
  transition: color 0.18s ease;
}

.admin-gallery-edit__image-toggle:hover,
.admin-gallery-edit__image-toggle:focus-visible,
.admin-gallery-edit__image-toggle.is-active {
  color: #111111;
}

.admin-gallery-edit__image-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.admin-gallery-edit__image-overlay {
  position: absolute;
  z-index: 4;
}

.admin-gallery-edit__image-reset {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
}

.admin-gallery-edit__image-slider {
  width: 112px;
  margin: 0;
}

.admin-gallery-edit__image-value {
  min-width: 40px;
  color: #666666;
  font-size: 0.82rem;
  white-space: nowrap;
}

.admin-gallery-edit__editor-scroll {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0 24px;
}

.admin-gallery-edit__editor-host {
  width: 100%;
  min-height: max(560px, 100%);
  background: #ffffff;
}

.admin-gallery-edit__status {
  margin: 0;
  padding: 14px 24px 0;
  color: #9a2c2c;
  font-size: 0.92rem;
}

.admin-gallery-edit__toolbar-separator {
  display: none;
}

.admin-gallery-edit__blocks {
  display: grid;
  gap: 4px;
  padding: 8px 10px 0;
}

.admin-gallery-edit__block {
  border: 1px solid #e1e1da;
  background: #ffffff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-gallery-edit__block.is-active {
  border-color: #111111;
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.08);
}

.admin-gallery-edit__block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px;
  border-bottom: 1px solid #efefe9;
  background: #fafaf7;
}

.admin-gallery-edit__block-title {
  color: #333333;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

.admin-gallery-edit__block-body .admin-gallery-edit__field > span {
  font-size: 0.62rem;
}

.admin-gallery-edit__block-meta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.admin-gallery-edit__block-body {
  padding: 6px 8px;
}

.admin-gallery-edit__mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6c6c64;
  cursor: pointer;
  transition: color 0.18s ease;
}

.admin-gallery-edit__mini-btn:hover,
.admin-gallery-edit__mini-btn:focus-visible {
  color: #111111;
}

.admin-gallery-edit__mini-btn svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.admin-gallery-edit__block-remove {
  color: #8e3a3a;
}

.admin-gallery-edit__block-remove:hover,
.admin-gallery-edit__block-remove:focus-visible {
  color: #681919;
}

.admin-gallery-edit__rich-editor {
  min-height: 92px;
  min-width: 0;
}

.admin-gallery-edit__rich-editor .ql-toolbar.ql-snow {
  display: none;
}

.admin-gallery-edit__rich-editor .ql-container.ql-snow {
  border: 0;
  font: inherit;
}

.admin-gallery-edit__rich-editor .ql-editor {
  min-height: 92px;
  padding: 0;
  font-size: 0.84rem;
  line-height: 1.5;
}

.admin-gallery-edit__rich-editor .ql-editor.ql-blank::before {
  left: 0;
  right: 0;
  color: #8a8a84;
  font-style: normal;
}

.admin-gallery-edit__rich-editor .ql-editor h1,
.admin-gallery-edit__rich-editor .ql-editor h2,
.admin-gallery-edit__rich-editor .ql-editor h3,
.admin-gallery-edit__rich-editor .ql-editor blockquote,
.admin-gallery-edit__rich-editor .ql-editor ul,
.admin-gallery-edit__rich-editor .ql-editor ol,
.admin-gallery-edit__rich-editor .ql-editor hr {
  margin-top: 0;
  margin-bottom: 0.42rem;
}

.admin-gallery-edit__rich-editor .ql-editor img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.4rem auto;
}

.admin-gallery-edit__rich-editor--prose,
.admin-gallery-edit__rich-editor--prose .ql-editor {
  min-height: 116px;
}

.admin-gallery-edit__rich-editor--layout,
.admin-gallery-edit__rich-editor--layout .ql-editor,
.admin-gallery-edit__rich-editor--column,
.admin-gallery-edit__rich-editor--column .ql-editor {
  min-height: 84px;
}

.admin-gallery-edit__layout {
  display: grid;
  gap: 6px;
  align-items: start;
}

.admin-gallery-edit__layout--media-left,
.admin-gallery-edit__layout--media-right {
  grid-template-columns: minmax(120px, 0.32fr) minmax(0, 0.68fr);
}

.admin-gallery-edit__layout--media-right .admin-gallery-edit__layout-media {
  order: 2;
}

.admin-gallery-edit__layout--columns-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.admin-gallery-edit__layout-column,
.admin-gallery-edit__layout-text,
.admin-gallery-edit__layout-media {
  min-width: 0;
}

.admin-gallery-edit__image-settings {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-gallery-edit__image-settings--compact {
  gap: 3px;
}

.admin-gallery-edit__image-preview {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 110px;
  height: auto;
  object-fit: contain;
  border: 1px solid #efefe9;
  background: #f2f2ed;
}

.admin-gallery-edit__image-empty {
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 1px dashed #d0d0c8;
  background: #fafaf7;
  color: #8a8a84;
  font-size: 0.68rem;
}

.admin-gallery-edit__image-fields {
  display: grid;
  gap: 4px;
}

.admin-gallery-edit__image-fields--compact {
  grid-template-columns: minmax(0, 1.5fr) 56px minmax(180px, 1fr);
  gap: 4px;
  align-items: end;
}

.admin-gallery-edit__image-fields--compact .admin-gallery-edit__field {
  min-width: 0;
}

.admin-gallery-edit__field--compact-url {
  grid-column: 1;
}

.admin-gallery-edit__field--compact-width {
  grid-column: 3;
}

.admin-gallery-edit__image-row {
  display: grid;
  gap: 4px;
  align-items: end;
}

.admin-gallery-edit__image-row--upload {
  grid-template-columns: 72px;
}

.admin-gallery-edit__image-row--options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-gallery-edit__image-row--options.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.admin-gallery-edit__image-row .admin-gallery-edit__action-upload {
  min-height: 28px;
  padding: 0 6px;
  font-size: 0.68rem;
}

.admin-gallery-edit__image-fields--compact .admin-gallery-edit__action-upload {
  min-width: 56px;
}

.admin-gallery-edit__mini-input,
.admin-gallery-edit__mini-select {
  min-height: 28px;
  padding: 0 6px;
  border: 1px solid #d0d0c8;
  background: #ffffff;
  font-size: 0.78rem;
}

.admin-gallery-edit__range {
  width: 100%;
  height: 18px;
  margin: 0;
}

.admin-gallery-edit__scale-control {
  display: grid;
  gap: 2px;
}

.admin-gallery-edit__scale-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.admin-gallery-edit__scale-reset {
  min-width: 28px;
  min-height: 18px;
  padding: 0 4px;
  border: 1px solid #d0d0c8;
  background: #ffffff;
  color: #111111;
  font-size: 0.68rem;
  line-height: 1;
  cursor: pointer;
}

.admin-gallery-edit__range-wrap {
  position: relative;
}

.admin-gallery-edit__range-zero {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 1px;
  height: 12px;
  background: #9e9e95;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.admin-gallery-edit__range-wrap .admin-gallery-edit__range {
  position: relative;
  z-index: 1;
  background: transparent;
}

.admin-gallery-edit__divider {
  height: 1px;
  background: #d7d7cf;
}

.admin-gallery-edit__editor-host .ql-container.ql-snow {
  border: 0;
  height: auto;
  min-height: 100%;
  font: inherit;
}

.admin-gallery-edit__editor-host .ql-editor {
  min-height: 560px;
  padding: 26px 30px 32px;
  font-size: 1rem;
  line-height: 1.75;
}

.admin-gallery-edit__editor-host .ql-editor::after {
  content: '';
  display: block;
  clear: both;
}

.admin-gallery-edit__editor-host .ql-editor h1,
.admin-gallery-edit__editor-host .ql-editor h2,
.admin-gallery-edit__editor-host .ql-editor h3 {
  line-height: 1.25;
}

.admin-gallery-edit__editor-host .ql-editor p,
.admin-gallery-edit__editor-host .ql-editor blockquote,
.admin-gallery-edit__editor-host .ql-editor li {
  line-height: 1.8;
}

.admin-gallery-edit__editor-host .ql-editor p.is-image-float-wrap {
  display: contents;
}

.admin-gallery-edit__editor-host .ql-editor img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.25rem auto;
  cursor: pointer;
  transition: box-shadow 0.18s ease, outline-color 0.18s ease;
}

.admin-gallery-edit__editor-host .ql-editor img[data-float="left"],
.admin-gallery-edit__editor-host .ql-editor img[data-float="right"] {
  display: block;
  max-width: 48%;
  margin-top: 0.35rem;
  margin-bottom: 1rem;
}

.admin-gallery-edit__editor-host .ql-editor img[data-float="left"] {
  float: left;
  margin-left: 0;
  margin-right: 1.5rem;
}

.admin-gallery-edit__editor-host .ql-editor img[data-float="right"] {
  float: right;
  margin-left: 1.5rem;
  margin-right: 0;
}

.admin-gallery-edit__editor-host .ql-editor img.is-active {
  outline: 1px solid rgba(17, 17, 17, 0.38);
  outline-offset: 6px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.72);
}

.admin-gallery-edit__editor-host .ql-editor.ql-blank::before {
  left: 42px;
  right: 30px;
  color: #8a8a84;
  font-style: normal;
}

.admin-gallery-edit__editor-host .ql-editor blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 2px solid #111111;
  color: #555555;
}

.admin-gallery-edit__editor-host .ql-editor ul,
.admin-gallery-edit__editor-host .ql-editor ol {
  padding-left: 1.5rem;
}

.admin-gallery-edit__editor-host .ql-editor h1,
.admin-gallery-edit__editor-host .ql-editor h2,
.admin-gallery-edit__editor-host .ql-editor h3,
.admin-gallery-edit__editor-host .ql-editor blockquote,
.admin-gallery-edit__editor-host .ql-editor ul,
.admin-gallery-edit__editor-host .ql-editor ol,
.admin-gallery-edit__editor-host .ql-editor hr {
  clear: both;
}

@media (max-width: 900px) {
  .admin-gallery-browser__toolbar,
  .admin-gallery-browser__search {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .admin-gallery-row {
    flex-direction: column;
  }

  .admin-gallery-row__cover {
    width: 100%;
    max-width: 200px;
  }

  .admin-gallery-row__actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .admin-gallery-edit__meta {
    flex-direction: column;
    gap: 12px;
  }

  .admin-gallery-edit__field--title,
  .admin-gallery-edit__field--cover-url,
  .admin-gallery-edit__field--description {
    width: 100%;
  }

  .admin-gallery-edit__layout--media-left,
  .admin-gallery-edit__layout--media-right,
  .admin-gallery-edit__layout--columns-2,
  .admin-gallery-edit__image-row {
    grid-template-columns: 1fr;
  }

  .admin-gallery-edit__image-fields--compact {
    grid-template-columns: 1fr;
  }

  .admin-gallery-edit__image-preview {
    max-height: none;
  }

  .admin-gallery-edit__actions {
    justify-items: stretch;
  }

  .admin-gallery-edit-page__limits {
    justify-content: flex-start;
    padding: 0;
  }

  .admin-hero-page,
  .admin-gallery-edit {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
  }

  .admin-app-shell,
  .admin-sidebar {
    overflow: visible;
  }

  .admin-edit-mode-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .admin-edit-mode-header__left {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .admin-gallery-edit-long__topbar {
    grid-template-columns: 1fr;
  }

  .admin-gallery-edit-long__meta {
    flex-direction: column;
    gap: 12px;
  }

  .admin-gallery-edit-long__field--title,
  .admin-gallery-edit-long__field--cover-url,
  .admin-gallery-edit-long__field--description {
    width: 100%;
  }

  .admin-gallery-edit-long__workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .admin-gallery-edit-long__left-panel {
    border-right: none;
    border-bottom: 1px solid #e1e1da;
  }

  .admin-gallery-edit-long__preview-area {
    max-height: 50vh;
  }
}

/* 作品集列表 - 内容类型标签 */
.admin-gallery-row__type-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid #d0d0c8;
  border-radius: 4px;
  background: #fafaf7;
  color: #666666;
  font-size: 0.7rem;
  font-weight: 400;
  vertical-align: middle;
}

/* 作品集列表 - 置顶徽章 */
.admin-gallery-row__pin-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #111111;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 500;
  vertical-align: middle;
}

/* 置顶按钮激活状态 */
.admin-gallery-row__actions button.is-active {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid #111111;
}

/* 编辑模式切换头部 */
.admin-edit-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid #e1e1da;
  background: #fafaf7;
}

.admin-edit-mode-header__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-back-link {
  color: #666666;
  font-size: 0.82rem;
}

.admin-back-link:hover {
  color: #111111;
}

.admin-edit-mode-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border: 1px solid #111111;
  border-radius: 4px;
  background: #111111;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 500;
}

.admin-edit-mode-tag--long {
  background: #b06b2d;
  border-color: #b06b2d;
}

.admin-edit-mode-default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d0d0c8;
  border-radius: 4px;
  background: #ffffff;
  color: #666666;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.admin-edit-mode-default:hover:not(:disabled) {
  border-color: #111111;
  color: #111111;
}

.admin-edit-mode-default.is-active {
  background: #efeee9;
  border-color: #c9c5b8;
  color: #444444;
}

.admin-edit-mode-default:disabled {
  opacity: 0.6;
  cursor: wait;
}

.admin-edit-mode-switch {
  font-size: 0.82rem;
  color: #666666;
}

.admin-edit-mode-switch:hover {
  color: #111111;
}

/* 新建下拉菜单 */
.admin-create-dropdown {
  position: relative;
}

.admin-create-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #111111;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.admin-create-dropdown__trigger:hover {
  background: #333333;
}

.admin-create-dropdown__trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.admin-create-dropdown__arrow {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.admin-create-dropdown__menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  min-width: 220px;
  margin-top: 4px;
  padding: 6px 0;
  border: 1px solid #e1e1da;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.admin-create-dropdown__menu button {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.admin-create-dropdown__menu button:hover {
  background: #fafaf7;
}

.admin-create-dropdown__label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #111111;
}

.admin-create-dropdown__desc {
  font-size: 0.78rem;
  color: #666666;
}

/* 长图编辑页 */
.admin-gallery-edit-long {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.admin-gallery-edit-long__topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 16px;
  align-items: end;
  padding: 16px 18px;
  border: 1px solid #e1e1da;
  background: #ffffff;
}

.admin-gallery-edit-long__meta {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  min-width: 0;
}

.admin-gallery-edit-long__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex-shrink: 0;
}

.admin-gallery-edit-long__field--title {
  width: 240px;
}

.admin-gallery-edit-long__field--cover-url {
  width: 180px;
}

.admin-gallery-edit-long__field--description {
  flex: 1;
  min-width: 200px;
}

.admin-gallery-edit-long__field > span {
  color: #666666;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.admin-gallery-edit-long__input-wrap {
  position: relative;
  width: 100%;
}

.admin-gallery-edit-long__input-wrap input,
.admin-gallery-edit-long__field > input {
  width: 100%;
  min-height: 44px;
}

.admin-gallery-edit-long__input-wrap input {
  padding-right: 60px;
}

.admin-gallery-edit-long__counter {
  position: absolute;
  right: 8px;
  bottom: 6px;
  color: #8a8a84;
  font-size: 0.68rem;
  pointer-events: none;
}

.admin-gallery-edit-long__actions {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
}

.admin-gallery-edit-long__save {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #111111;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.admin-gallery-edit-long__save:hover {
  background: #333333;
}

.admin-gallery-edit-long__main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #e1e1da;
  background: #ffffff;
}

.admin-gallery-edit-long__workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.admin-gallery-edit-long__left-panel {
  display: grid;
  grid-template-rows: auto auto;
  gap: 0;
  border-right: 1px solid #e1e1da;
  background: #fafaf7;
}

.admin-gallery-edit-long__requirements {
  padding: 20px;
  border-bottom: 1px solid #e1e1da;
}

.admin-gallery-edit-long__requirements h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 500;
}

.admin-gallery-edit-long__requirements ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #555555;
}

.admin-gallery-edit-long__requirements li {
  margin: 3px 0;
}

.admin-gallery-edit-long__requirements strong {
  color: #111111;
}

.admin-gallery-edit-long__upload-panel {
  padding: 20px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.admin-gallery-edit-long__upload-panel h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.admin-gallery-edit-long__upload-info {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #e1e1da;
  background: #ffffff;
}

.admin-gallery-edit-long__upload-info p {
  margin: 0;
  font-size: 0.78rem;
  color: #555555;
}

.admin-gallery-edit-long__upload-info span {
  color: #111111;
}

.admin-gallery-edit-long__upload-actions {
  display: flex;
  gap: 8px;
}

.admin-gallery-edit-long__upload-actions button {
  flex: 1;
  min-height: 38px;
  border: 1px solid #d0d0c8;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.admin-gallery-edit-long__upload-actions button:hover {
  border-color: #111111;
}

.admin-gallery-edit-long__url-input {
  display: grid;
  gap: 6px;
}

.admin-gallery-edit-long__url-input span {
  font-size: 0.78rem;
  color: #666666;
}

.admin-gallery-edit-long__url-input input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #d0d0c8;
  font-size: 0.82rem;
}

.admin-gallery-edit-long__preview-area {
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  background: #ffffff;
}

.admin-gallery-edit-long__preview-shell {
  min-height: 200px;
  display: grid;
  align-content: start;
}

.admin-gallery-edit-long__placeholder {
  display: grid;
  place-items: center;
  min-height: 300px;
  border: 1px dashed #d0d0c8;
  background: #fafaf7;
  color: #8a8a84;
  font-size: 0.9rem;
}

.admin-gallery-edit-long__preview-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid #e1e1da;
}

.admin-gallery-edit-long__status {
  margin: 0;
  padding: 12px 20px;
  color: #9a2c2c;
  font-size: 0.92rem;
  background: #fff5f5;
  border-top: 1px solid #f0d0d0;
}

.admin-gallery-edit-long__success {
  margin: 0;
  padding: 12px 20px;
  color: #2d7a4a;
  font-size: 0.92rem;
  background: #f0fff5;
  border-top: 1px solid #b0e0c0;
}

/* 图片库弹窗 */
.admin-hero-page__library-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-hero-page__library {
  width: min(90vw, 800px);
  max-height: 80vh;
  background: #ffffff;
  border: 1px solid #d8d8d0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.admin-hero-page__library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e1e1da;
  background: #fafaf7;
}

.admin-hero-page__library-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.admin-hero-page__library-header button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  color: #666666;
  cursor: pointer;
}

.admin-hero-page__library-header button:hover {
  color: #111111;
}

.admin-hero-page__library-content {
  padding: 20px;
  overflow-y: auto;
}

.admin-hero-page__library-content p {
  margin: 0;
  color: #666666;
  text-align: center;
  padding: 40px 0;
}

.admin-hero-page__library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.admin-hero-page__library-item {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #e1e1da;
  background: #f5f5f0;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-hero-page__library-item:hover {
  border-color: #111111;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-hero-page__library-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 通用图片选择器 */
.image-picker-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
}

.image-picker {
  width: min(95vw, 900px);
  max-height: 85vh;
  background: #ffffff;
  border: 1px solid #d8d8d0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.image-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e1e1da;
  background: #fafaf7;
}

.image-picker__header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
}

.image-picker__close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  color: #666666;
  cursor: pointer;
  line-height: 1;
}

.image-picker__close:hover {
  color: #111111;
}

.image-picker__tabs {
  display: flex;
  border-bottom: 1px solid #e1e1da;
}

.image-picker__tab {
  flex: 1;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: #666666;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.image-picker__tab:hover {
  color: #111111;
}

.image-picker__tab.is-active {
  color: #111111;
  border-bottom-color: #111111;
}

.image-picker__content {
  padding: 16px;
  overflow-y: auto;
}

.image-picker__panel--library {
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.image-picker__search {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #d0d0c8;
  font-size: 0.9rem;
}

.image-picker__search:focus {
  outline: none;
  border-color: #111111;
}

.image-picker__library-loading,
.image-picker__library-empty {
  text-align: center;
  padding: 40px 0;
  color: #666666;
}

.image-picker__library-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.image-picker__item {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #e1e1da;
  background: #f5f5f0;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.image-picker__item:hover {
  border-color: #111111;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-picker__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-picker__error {
  color: #7a1f1f;
  text-align: center;
  padding: 20px;
}

.image-picker__upload-label {
  display: block;
  cursor: pointer;
}

.image-picker__upload-input {
  display: none;
}

.image-picker__upload-btn {
  display: block;
  padding: 32px 20px;
  border: 2px dashed #d0d0c8;
  background: #fafaf7;
  text-align: center;
  color: #666666;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.image-picker__upload-label:hover .image-picker__upload-btn {
  border-color: #111111;
  color: #111111;
}

.image-picker__upload-status {
  margin-top: 12px;
  text-align: center;
  color: #666666;
}

.image-picker__upload-status.is-success {
  color: #2d7a4a;
}

.image-picker__upload-status.is-error {
  color: #7a1f1f;
}

/* 图片库页面 */
.admin-images {
  display: grid;
  gap: 16px;
}

.admin-images__error {
  margin: 0;
  color: #7a1f1f;
}

.admin-images__status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-images__status {
  margin: 0;
  color: #666666;
  font-size: 0.95rem;
}

.admin-images__selection-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-images__selection-bar button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #d0d0c8;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
}

.admin-images__selection-bar button:hover:not(:disabled) {
  background: #f3f2ec;
}

.admin-images__selection-bar button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-images__danger-btn {
  border-color: #c41e3a !important;
  color: #c41e3a !important;
}

.admin-images__loading,
.admin-images__empty {
  padding: 60px 20px;
  text-align: center;
  color: #666666;
}

.admin-images__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.admin-images__item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #e1e1da;
  background: #f5f5f0;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-images__item:hover {
  border-color: #111111;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-images__item.is-selected {
  border-color: #111111;
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.12);
}

.admin-images__select-box {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #d9d9d2;
  background: rgba(255, 255, 255, 0.95);
}

.admin-images__select-box span {
  font-size: 0.8rem;
  color: #444444;
}

.admin-images__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-images__item-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.78) 100%);
  color: #ffffff;
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.admin-images__item:hover .admin-images__item-name {
  opacity: 1;
  transform: translateY(0);
}

.admin-images__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding-top: 16px;
}

.admin-images__pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid #d0d0c8;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.admin-images__pagination button:hover:not(:disabled) {
  border-color: #111111;
}

.admin-images__pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-images__pagination button.is-active {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

.admin-images__pagination-ellipsis {
  border: 0 !important;
  background: transparent !important;
  cursor: default !important;
}

.admin-images__count {
  margin: 0;
  text-align: center;
  color: #666666;
  font-size: 0.85rem;
}

.admin-images__modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-images__modal {
  width: min(90vw, 640px);
  max-height: 90vh;
  background: #ffffff;
  border: 1px solid #d8d8d0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.admin-images__modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}

.admin-images__modal-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.admin-images__modal-preview {
  position: relative;
  background: #1a1a1a;
  min-height: 200px;
  max-height: 50vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-images__modal-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.admin-images__modal-info {
  padding: 16px;
  display: grid;
  gap: 8px;
}

.admin-images__modal-info p {
  margin: 0;
  font-size: 0.9rem;
  word-break: break-all;
}

.admin-images__modal-url {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.admin-images__modal-rename {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.admin-images__modal-rename input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d0d0c8;
  font-size: 0.85rem;
}

.admin-images__modal-rename button {
  padding: 0 14px;
  border: 1px solid #d0d0c8;
  background: #f5f4ef;
  color: #111111;
  cursor: pointer;
}

.admin-images__modal-rename button:hover {
  background: #eceae2;
}

.admin-images__modal-url input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d0d0c8;
  font-size: 0.85rem;
}

.admin-images__modal-url button {
  padding: 0 14px;
  border: 1px solid #111111;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
}

.admin-images__modal-url button:hover {
  background: #333333;
}

.admin-images__modal-delete {
  background: #ffffff !important;
  color: #c41e3a !important;
  border: 1px solid #c41e3a !important;
}

.admin-images__modal-delete:hover {
  background: #c41e3a !important;
  color: #ffffff !important;
}

@media (max-width: 900px) {
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-images__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-images__header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-images__header-actions input[type="text"] {
    width: 100%;
  }

  .admin-images__status-row {
    align-items: stretch;
  }
}
