:root {
  --content-editor-accent: #087a5b;
  --content-editor-accent-dark: #075e48;
  --content-editor-danger: #a2342b;
  --content-editor-border: #d9d9d3;
  --content-editor-surface: #ffffff;
  --content-editor-soft: #f4f4f1;
  --content-editor-ink: #171717;
}

.footer-bottom {
  position: relative;
  padding-right: 34px;
}

.content-editor-entry {
  position: absolute;
  top: 50%;
  right: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 2px;
  outline-offset: 3px;
  background: transparent;
  color: inherit;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.18;
  transform: translateY(-50%);
  transition: opacity 160ms ease, color 160ms ease;
}

.content-editor-entry:hover,
.content-editor-entry:focus-visible {
  color: #ffffff;
  opacity: 0.9;
}

.content-editor-add-column {
  position: fixed;
  z-index: 9997;
  top: 50%;
  left: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid #c9c9c3;
  border-radius: 50% !important;
  background: #ffffff;
  color: var(--content-editor-accent-dark);
  font: 26px/1 Arial, sans-serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  transform: translateY(-50%);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.content-editor-add-column:hover,
.content-editor-add-column:focus-visible {
  border-color: var(--content-editor-accent);
  background: var(--content-editor-accent);
  color: #ffffff;
  transform: translateY(-50%) scale(1.06);
}

.hero-mosaic .hero-tile[data-editor-hidden="true"] {
  display: none;
}

body.content-editor-mode .hero-mosaic .hero-tile[data-editor-hidden="true"] {
  display: block;
  opacity: 0.52;
  outline: 2px dashed var(--content-editor-accent);
  outline-offset: -5px;
}

body.content-editor-mode .hero-mosaic .hero-tile[data-editor-hidden="true"]::after {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.34);
  color: #171717;
  content: "已隱藏 / Hidden";
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.product-card[data-editor-hidden="true"] {
  display: none;
}

body.content-editor-mode .product-card[data-editor-hidden="true"] {
  display: block;
  outline: 2px dashed var(--content-editor-accent);
  outline-offset: 5px;
}

body.content-editor-mode .product-card[data-editor-hidden="true"] .product-image-wrap > :not(.content-editor-product-controls),
body.content-editor-mode .product-card[data-editor-hidden="true"] .product-card-info {
  opacity: 0.34;
}

body.content-editor-mode .product-card[data-editor-hidden="true"] .product-image-wrap::after {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.26);
  color: #171717;
  content: "已隱藏 / Hidden";
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.content-editor-product-controls {
  position: absolute;
  z-index: 8;
  top: 8px;
  left: 50%;
  display: flex;
  gap: 5px;
  transform: translateX(-50%);
}

.content-editor-product-controls button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #bfc0ba;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: #171717;
  font: 18px/1 Arial, sans-serif;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.content-editor-product-controls button:hover,
.content-editor-product-controls button:focus-visible {
  border-color: var(--content-editor-accent);
  background: var(--content-editor-accent);
  color: #ffffff;
}

.content-editor-add-product-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 330px;
  padding: 24px 12px;
  border: 1px dashed #a9aaa4;
  border-radius: 4px;
  background: #fafaf8;
  color: #555650;
}

.content-editor-add-product-card:hover,
.content-editor-add-product-card:focus-visible {
  border-color: var(--content-editor-accent);
  background: #f1f7f4;
  color: var(--content-editor-accent-dark);
}

.content-editor-add-product-card > span {
  font: 34px/1 Arial, sans-serif;
}

.content-editor-add-product-card > strong {
  max-width: 100%;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

html[lang^="en"] body.content-editor-mode .hero-mosaic .hero-tile[data-editor-hidden="true"]::after,
html[lang^="en"] body.content-editor-mode .product-card[data-editor-hidden="true"] .product-image-wrap::after {
  content: "Hidden";
}

#content-editor-ui {
  color: var(--content-editor-ink);
  font-family: var(--font-sans, "Microsoft JhengHei", Arial, sans-serif);
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0;
}

#content-editor-ui [hidden] {
  display: none !important;
}

body.content-editor-mode {
  padding-top: 62px;
}

#content-editor-ui button,
#content-editor-ui input,
#content-editor-ui select,
#content-editor-ui textarea {
  letter-spacing: 0;
}

.content-editor-toolbar {
  position: fixed;
  z-index: 10000;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 62px;
  padding: 10px 18px;
  border-bottom: 1px solid #353535;
  background: #171717;
  color: #ffffff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.content-editor-toolbar-title {
  display: grid;
  min-width: 0;
}

.content-editor-toolbar-title strong {
  font-size: 13px;
  font-weight: 700;
}

.content-editor-toolbar-title span {
  overflow: hidden;
  color: #a9aaa5;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-editor-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  max-width: calc(100vw - 230px);
  overflow-x: auto;
  scrollbar-width: thin;
}

#content-editor-ui button,
.content-editor-file-button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #c9c9c3;
  border-radius: 4px;
  background: #ffffff;
  color: #171717;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

#content-editor-ui button:hover,
.content-editor-file-button:hover {
  border-color: #8f908a;
  background: #f5f5f2;
}

#content-editor-ui button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

#content-editor-ui button:focus-visible,
.content-editor-file-button:focus-within,
#content-editor-ui input:focus-visible,
#content-editor-ui select:focus-visible,
#content-editor-ui textarea:focus-visible {
  outline: 2px solid var(--content-editor-accent);
  outline-offset: 2px;
}

.content-editor-toolbar button {
  min-height: 32px;
  border-color: #4a4a47;
  background: #242424;
  color: #f7f7f4;
}

.content-editor-toolbar button:hover {
  border-color: #777873;
  background: #30302f;
}

#content-editor-ui .content-editor-icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  min-height: 32px;
  padding: 0;
  font: 19px/1 Arial, sans-serif;
}

#content-editor-ui button.is-primary,
#content-editor-ui .content-editor-submit {
  border-color: var(--content-editor-accent);
  background: var(--content-editor-accent);
  color: #ffffff;
}

#content-editor-ui .content-editor-publish {
  min-width: 96px;
}

#content-editor-ui button.is-primary:hover,
#content-editor-ui .content-editor-submit:hover {
  border-color: var(--content-editor-accent-dark);
  background: var(--content-editor-accent-dark);
}

.content-editor-panel {
  position: fixed;
  z-index: 9998;
  top: 76px;
  right: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--content-editor-border);
  border-radius: 6px;
  background: var(--content-editor-surface);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
}

.content-editor-panel-body {
  height: 100%;
  overflow: auto;
  padding: 22px;
  overscroll-behavior: contain;
}

.content-editor-panel h2,
.content-editor-dialog h2 {
  margin: 0 0 18px;
  color: var(--content-editor-ink);
  font-size: 19px;
  font-weight: 650;
  line-height: 1.25;
}

.content-editor-panel p {
  margin: 0 0 16px;
  color: #666761;
  font-size: 11px;
}

.content-editor-panel-hint {
  padding: 12px;
  border-left: 3px solid var(--content-editor-accent);
  background: var(--content-editor-soft);
}

.content-editor-overlay {
  position: fixed;
  z-index: 10020;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
}

.content-editor-dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--content-editor-border);
  border-radius: 6px;
  background: var(--content-editor-surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.content-editor-dialog-body {
  padding: 30px;
}

#content-editor-ui .content-editor-dialog-close {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #555650;
  font-size: 20px;
  font-weight: 400;
}

.content-editor-login-form,
.content-editor-password-form,
.content-editor-publish-form,
.content-editor-history-auth-form,
.content-editor-publish-result,
.content-editor-text-form,
.content-editor-media-editor {
  display: grid;
  gap: 15px;
}

.content-editor-login-form label,
.content-editor-password-form label,
.content-editor-publish-form label,
.content-editor-history-auth-form label,
.content-editor-text-form label,
.content-editor-media-editor > label {
  display: grid;
  gap: 6px;
  color: #4d4e49;
  font-size: 10px;
  font-weight: 700;
}

.content-editor-publish-result p,
.content-editor-publish-hint {
  margin: 0 0 18px;
  color: #4d4e49;
  font-size: 13px;
  line-height: 1.55;
}

#content-editor-ui input[type="text"],
#content-editor-ui input[type="password"],
#content-editor-ui input[type="number"],
#content-editor-ui select,
#content-editor-ui textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--content-editor-border);
  border-radius: 3px;
  outline: 0;
  background: #ffffff;
  color: var(--content-editor-ink);
  font-size: 13px;
  font-weight: 400;
}

#content-editor-ui [aria-invalid="true"] {
  border-color: var(--content-editor-danger) !important;
  box-shadow: 0 0 0 1px var(--content-editor-danger);
}

.content-editor-text-label > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.content-editor-text-label output {
  color: #74756f;
  font-size: 10px;
  font-weight: 500;
}

#content-editor-ui textarea {
  min-height: 126px;
  resize: vertical;
}

.content-editor-colour-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.content-editor-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.content-editor-style-grid label,
.content-editor-setting-group label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #4d4e49;
  font-size: 10px;
  font-weight: 700;
}

.content-editor-setting-group {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--content-editor-border);
  border-radius: 4px;
  background: #fafaf8;
}

.content-editor-setting-group legend {
  padding: 0 6px;
  color: #555650;
  font-size: 10px;
  font-weight: 700;
}

.content-editor-block-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

#content-editor-ui .content-editor-block-actions .is-danger {
  border-color: #d7b2ad;
  color: var(--content-editor-danger);
}

.content-editor-colour-grid label {
  min-width: 0;
}

#content-editor-ui input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--content-editor-border);
  border-radius: 3px;
  background: #ffffff;
}

.content-editor-check {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
}

.content-editor-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--content-editor-accent);
}

.content-editor-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.content-editor-form-error {
  min-height: 17px;
  margin: 0 !important;
  color: var(--content-editor-danger) !important;
  font-size: 11px !important;
}

.content-editor-history {
  display: grid;
  gap: 14px;
}

.content-editor-history > h2 {
  margin-bottom: 2px;
}

.content-editor-history-current {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border-left: 3px solid var(--content-editor-accent);
  background: var(--content-editor-soft);
}

.content-editor-history-current span,
.content-editor-history-list small {
  color: #74756f;
  font-size: 10px;
}

.content-editor-history-current strong,
.content-editor-history-list strong {
  font-size: 12px;
  font-weight: 650;
}

.content-editor-history-list {
  display: grid;
  max-height: 360px;
  margin: 0;
  padding: 0;
  overflow: auto;
  border-top: 1px solid var(--content-editor-border);
  list-style: none;
}

.content-editor-history-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--content-editor-border);
}

.content-editor-history-list li > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.content-editor-history-empty {
  margin: 0 !important;
  padding: 16px 0;
}

.content-editor-media-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.content-editor-media-list li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--content-editor-border);
  border-radius: 4px;
  background: #ffffff;
}

.content-editor-media-thumb {
  display: grid;
  place-items: center;
  width: 54px;
  height: 46px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--content-editor-soft);
}

.content-editor-media-thumb img,
.content-editor-media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.content-editor-media-placeholder {
  width: 20px;
  height: 20px;
  border: 1px dashed #a7a8a2;
}

.content-editor-media-name {
  overflow: hidden;
  color: #3f403c;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-editor-media-actions {
  display: flex;
  gap: 3px;
}

#content-editor-ui .content-editor-media-actions button {
  display: grid;
  place-items: center;
  width: 27px;
  min-height: 27px;
  padding: 0;
  font-size: 14px;
}

.content-editor-file-button {
  display: grid;
  place-items: center;
  width: 100%;
  cursor: pointer;
}

body.content-editor-mode [data-content-text-key],
body.content-editor-mode [data-content-media-key] {
  outline-offset: 3px;
  cursor: pointer;
}

body.content-editor-mode [data-content-text-key]:hover {
  outline: 1px dashed var(--content-editor-accent);
}

body.content-editor-mode [data-content-media-key]:hover {
  outline: 2px dashed var(--content-editor-accent);
}

body.content-editor-mode .content-editor-selected {
  outline: 3px solid var(--content-editor-accent) !important;
  outline-offset: 3px;
}

.has-content-carousel {
  position: relative !important;
  isolation: isolate;
}

.content-carousel-source {
  visibility: hidden !important;
  opacity: 0 !important;
}

.content-carousel-layer {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.content-carousel-slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 520ms ease;
}

.content-carousel-slide.is-active {
  opacity: 1;
}

.content-carousel-media {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-position: var(--content-media-x, 50%) var(--content-media-y, 50%) !important;
  transform: scale(var(--content-media-scale, 1)) !important;
}

[data-content-text-key].content-editor-font-size-desktop {
  font-size: var(--content-editor-font-size-desktop) !important;
}

.content-editor-link-disabled {
  cursor: default !important;
}

[data-content-caption-position="top-right"] .hero-tile-copy,
[data-content-caption-position="top-right"] .promo-copy {
  top: 28px !important;
  right: 30px !important;
  bottom: auto !important;
  left: auto !important;
  justify-items: end;
  text-align: right;
}

[data-content-caption-position="bottom-left"] .hero-tile-copy,
[data-content-caption-position="bottom-left"] .promo-copy {
  top: auto !important;
  right: auto !important;
  bottom: 28px !important;
  left: 30px !important;
}

[data-content-caption-position="bottom-right"] .hero-tile-copy,
[data-content-caption-position="bottom-right"] .promo-copy {
  top: auto !important;
  right: 30px !important;
  bottom: 28px !important;
  left: auto !important;
  justify-items: end;
  text-align: right;
}

.content-carousel-layer.fit-contain .content-carousel-media {
  object-fit: contain;
}

.content-carousel-layer.fit-cover .content-carousel-media {
  object-fit: cover;
}

.content-carousel-control,
.content-carousel-dots button {
  pointer-events: auto;
}

.content-carousel-control {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.72);
  color: #ffffff;
  font: 15px/1 Arial, sans-serif;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 160ms ease, background 160ms ease;
}

.content-carousel-control.is-previous {
  left: 9px;
}

.content-carousel-control.is-next {
  right: 9px;
}

.has-content-carousel:hover .content-carousel-control,
.content-carousel-control:focus-visible,
body.content-editor-mode .content-carousel-control {
  opacity: 1;
}

.content-carousel-control:hover {
  background: #141414;
}

.content-carousel-dots {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 9px;
  left: 10px;
  display: flex;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}

.content-carousel-dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 1px solid rgba(20, 20, 20, 0.5);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
}

.content-carousel-dots button.is-active {
  border-color: #141414;
  background: #141414;
}

@media (prefers-reduced-motion: reduce) {
  .content-carousel-slide,
  .content-editor-entry,
  .content-carousel-control {
    transition: none;
  }
}

@media (min-width: 1180px) {
  body.content-editor-mode .site-shell {
    width: calc(100% - 392px);
  }
}

@media (max-width: 760px) {
  [data-content-text-key].content-editor-font-size-mobile {
    font-size: var(--content-editor-font-size-mobile) !important;
  }

  .hero-product-brand > .content-carousel-layer {
    position: relative;
    grid-area: 2 / 1;
    width: 100%;
    height: 100%;
    inset: auto;
  }

  .hero-product-brand .content-carousel-media {
    transform: scale(calc(var(--content-media-scale, 1) * 1.35)) !important;
  }

  .hero-product-brand #hero-title.content-editor-font-size-desktop:not(.content-editor-font-size-mobile) {
    font-size: 30px !important;
  }

  body.content-editor-mode {
    padding-top: 92px;
  }

  .content-editor-toolbar {
    align-items: flex-start;
    gap: 10px;
    min-height: 92px;
    padding: 9px 10px;
  }

  .content-editor-toolbar-title {
    flex: 0 0 auto;
    padding-top: 6px;
  }

  .content-editor-toolbar-title span {
    display: none;
  }

  .content-editor-toolbar-actions {
    justify-content: flex-end;
    max-width: calc(100vw - 108px);
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .content-editor-toolbar button {
    flex: 0 0 auto;
    min-height: 32px;
    padding-inline: 9px;
  }

  .content-editor-add-column {
    top: 43%;
    left: 8px;
    width: 34px;
    height: 34px;
    min-height: 34px;
    font-size: 23px;
  }

  .content-editor-add-product-card {
    min-height: 270px;
  }

  .content-editor-panel {
    z-index: 10005;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(48vh, 460px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 6px 6px 0 0;
  }

  .content-editor-panel-body {
    padding: 18px;
  }

  .content-editor-dialog-body {
    padding: 26px 20px 22px;
  }

  .content-editor-media-list li {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .content-editor-media-thumb {
    width: 48px;
    height: 42px;
  }

  .content-carousel-control {
    width: 28px;
    height: 28px;
    opacity: 0.82;
  }
}

@media (max-width: 430px) {
  .content-editor-toolbar-title strong {
    font-size: 11px;
  }

  .content-editor-toolbar-actions {
    max-width: calc(100vw - 92px);
  }

  .content-editor-toolbar button {
    padding-inline: 8px;
    font-size: 10px;
  }

  .content-editor-colour-grid {
    grid-template-columns: 1fr;
  }

  .content-editor-style-grid,
  .content-editor-block-actions {
    grid-template-columns: 1fr;
  }
}
