:root {
  --bg: #ffffff;
  --surface: #f4f4f7;
  --surface-strong: #ececf1;
  --text: #3f4050;
  --muted: #7c7d8b;
  --soft: #b8bac8;
  --line: #dedfe8;
  --accent: #ec4c89;
  --accent-dark: #d73573;
  --radius-card: 12px;
  --radius-dialog: 28px;
  --radius-dialog-inner: 20px;
  --radius-pill: 999px;
  --zcool-font: "PingFang SC", "Lantinghei SC", "Microsoft YaHei", "HanHei SC", "Helvetica Neue", "Open Sans", Arial, "Hiragino Sans GB", "微软雅黑", STHeiti, "WenQuanYi Micro Hei", SimSun, sans-serif, HYWenHei-GEW;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--zcool-font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  width: min(100%, 2520px);
  margin: 0 auto;
  padding: 18px 70px 80px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0 0 32px;
  background:
    linear-gradient(180deg, #fff 0%, #fff 78%, rgb(255 255 255 / 0) 100%);
}

.main-nav {
  display: grid;
  grid-template-columns: auto minmax(280px, 520px) auto 1fr auto;
  align-items: center;
  gap: 26px;
  min-height: 54px;
}

.brand {
  color: #12131d;
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.brand-image {
  display: flex;
  align-items: center;
  width: 138px;
  height: 44px;
  overflow: hidden;
}

.brand-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.compact-nav {
  grid-template-columns: auto minmax(280px, 520px) 1fr auto;
}

.compact-account {
  grid-column: auto;
}

.search {
  position: relative;
  width: 100%;
  height: 52px;
  margin: 0;
}

.search input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  border-radius: var(--radius-pill);
  background: #f1f1f5;
  color: #555664;
  padding: 0 132px 0 24px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.search input::placeholder {
  color: #70717e;
}

.search input:focus {
  background: #f7f7fa;
  box-shadow:
    inset 0 0 0 1px #e7e7ef,
    0 10px 34px rgb(29 30 40 / 0.08);
}

.search-button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 8px 18px rgb(236 76 137 / 0.2);
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.search-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.search-button:active {
  transform: translateY(1px) scale(0.98);
}

.search-button span,
.search-button span::after {
  position: absolute;
  display: block;
  content: "";
}

.search-button span {
  left: 12px;
  top: 10px;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
}

.search-button span::after {
  width: 8px;
  height: 2px;
  left: 10px;
  top: 12px;
  border-radius: 2px;
  background: #fff;
  transform: rotate(45deg);
  transform-origin: left center;
}

.search-type {
  position: absolute;
  top: 0;
  right: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: #474855;
  font-size: 13px;
  font-weight: 800;
}

.search-type span,
.nav-links span,
.popular-button span {
  width: 7px;
  height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.compact-nav .nav-links,
.compact-nav .upgrade-button,
.compact-nav .icon-only {
  display: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #2d2e39;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.account-actions {
  grid-column: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.upgrade-button,
.create-button,
.filters-button,
.popular-button,
.icon-only,
.profile-button,
.mobile-menu {
  border: 1px solid var(--line);
  background: #fff;
  color: #242531;
  font-weight: 800;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.upgrade-button {
  height: 42px;
  padding: 0 21px;
  border-color: #090a14;
  border-radius: var(--radius-pill);
  background: #090a14;
  color: #fff;
}

.create-button {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
}

.icon-only,
.profile-button,
.mobile-menu {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-color: transparent;
  border-radius: 50%;
  background: transparent;
}

.profile-button {
  overflow: visible;
}

.profile-button span {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8fd3ff, #ff8c78);
  color: #fff;
}

.profile-button span::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #28c777;
  content: "";
}

.mobile-menu {
  display: none;
}

.mobile-menu span,
.mobile-menu span::before,
.mobile-menu span::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #292a35;
  content: "";
}

.mobile-menu span::before {
  transform: translateY(-6px);
}

.mobile-menu span::after {
  transform: translateY(4px);
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 54px 0 0;
  gap: 24px;
}

.popular {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.popular::-webkit-scrollbar {
  display: none;
}

.popular-button,
.filters-button {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: 12px;
  background: #fff;
  white-space: nowrap;
}

.filters-button {
  border-radius: var(--radius-pill);
}

.filters-button span {
  width: 13px;
  height: 13px;
  background: currentColor;
  clip-path: polygon(0 16%, 100% 16%, 74% 42%, 74% 80%, 48% 92%, 48% 42%);
}

.chip,
.follow-button {
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: #30313c;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 1px 1px rgb(30 31 40 / 0.03);
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.chip {
  padding: 0 24px;
  border: 1px solid #e9e9ee;
  background: #fff;
}

.chip:hover,
.chip.is-active {
  color: #242531;
  border-color: transparent;
  background: #f4f4f6;
}

.chip:active,
.follow-button:active {
  transform: translateY(1px);
}

.follow-button {
  position: relative;
  min-width: 102px;
  padding: 0 35px 0 18px;
  border-radius: 8px;
  flex: 0 0 auto;
}

.follow-button span,
.follow-button span::before {
  position: absolute;
  display: block;
  content: "";
}

.follow-button span {
  right: 16px;
  top: 13px;
  width: 8px;
  height: 8px;
  border-right: 1.7px solid #6d6e7b;
  border-bottom: 1.7px solid #6d6e7b;
  transform: rotate(45deg);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(245px, 1fr));
  gap: 34px 34px;
}

.shot {
  min-width: 0;
  animation: rise 420ms ease both;
}

.thumb {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1.42 / 1;
  padding: 0;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  transform: translateZ(0);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.shot:hover .thumb {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgb(36 37 48 / 0.11);
}

.thumb::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0), rgb(0 0 0 / 0.14));
  transition: opacity 180ms ease;
  z-index: 2;
}

.shot:hover .thumb::before {
  opacity: 1;
}

.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgb(255 255 255 / 0.88);
  color: #6d6f7b;
  font-size: 13px;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 2px 0;
}

.creator {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.45);
}

.name {
  min-width: 0;
  overflow: hidden;
  color: #4d4e5c;
  font-size: 14px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier {
  height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  background: #efeff4;
  color: #5c5d69;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  flex: 0 0 auto;
}

.tier.plus {
  color: #fff;
  background: #252637;
}

.stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: #686978;
  font-size: 13px;
  font-weight: 650;
  flex: 0 0 auto;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat::before {
  display: inline-block;
  width: 14px;
  height: 14px;
  opacity: 0.72;
  background: none;
  font-size: 14px;
  line-height: 14px;
  text-align: center;
}

.stat.likes::before {
  content: "♡";
}

.stat.views::before {
  content: "◉";
}

.empty-state {
  max-width: 460px;
  margin: 80px auto;
  text-align: center;
}

.empty-state h1 {
  margin: 0 0 10px;
  color: #31323e;
  font-size: 28px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.upload-view[hidden],
.auth-modal[hidden] {
  display: none;
}

.upload-view {
  min-height: 100dvh;
  background: #fff;
  color: #2f3038;
}

.zcool-upload-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid #ececf1;
  background: #fff;
}

.zcool-upload-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #191a20;
  font-size: 20px;
  font-weight: 900;
}

.zcool-upload-brand strong {
  letter-spacing: -0.02em;
}

.zcool-upload-brand span {
  font-size: 18px;
}

.upload-profile {
  transform: scale(.86);
}

.zcool-upload-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 386px;
  min-height: calc(100dvh - 54px);
  padding-bottom: 76px;
  background: linear-gradient(90deg, #fff 0, #fff calc(100% - 386px), #f6f6f8 calc(100% - 386px));
}

.zcool-editor-main {
  position: relative;
  min-height: calc(100dvh - 130px);
  padding: 38px clamp(24px, 12vw, 720px) 140px clamp(24px, 28vw, 720px);
}

.zcool-title-input {
  width: min(720px, 100%);
  height: 54px;
  border: 0;
  border-bottom: 1px solid #ededf1;
  outline: 0;
  resize: none;
  overflow: hidden;
  display: block;
  color: #23242b;
  font-size: 24px;
  font-weight: 500;
  line-height: 36px;
  font-family: var(--zcool-font);
}

.zcool-title-input::placeholder,
.caption-block::placeholder,
.image-caption::placeholder {
  color: #b9bac2;
}

.zcool-title-count {
  width: min(720px, 100%);
  margin-top: -36px;
  text-align: right;
  color: #b0b1bb;
  font-size: 12px;
  pointer-events: none;
}

.layout-stage {
  margin-top: 42px;
}

.zcool-intro-copy {
  width: min(720px, 100%);
  margin: 38px 0 28px;
  color: #b0b1bb;
  line-height: 1.9;
  font-size: 15px;
  font-weight: 650;
}

.zcool-intro-copy p {
  margin: 0;
}

.zcool-image-block {
  position: relative;
  display: grid;
  place-items: center;
  width: min(720px, 100%);
  min-height: 420px;
  border: 0;
  background: #fff;
  cursor: pointer;
}

.zcool-image-block input,
.cover-uploader input {
  display: none;
}

.zcool-image-block img {
  display: none;
  width: 100%;
  max-height: 720px;
  object-fit: contain;
}

.zcool-image-menu {
  position: absolute;
  left: -30px;
  top: 10px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid #aaaeb8;
  border-radius: 50%;
  color: #7d808c;
  font-size: 13px;
}

.zcool-upload-empty {
  width: 100%;
  min-height: 360px;
  display: grid;
  place-items: center;
  gap: 10px;
  border: 1px dashed #dadbe2;
  border-radius: 4px;
  color: #9b9ca6;
  text-align: center;
}

.zcool-upload-empty b {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d6d7dd;
  color: #fff;
  font-size: 30px;
  font-weight: 400;
}

.zcool-upload-empty strong,
.zcool-upload-empty em {
  display: block;
  font-style: normal;
  font-weight: 650;
}

.image-caption {
  width: min(720px, 100%);
  min-height: 42px;
  margin-top: 14px;
  border: 0;
  outline: 0;
  resize: vertical;
  color: #777985;
  text-align: center;
  font-size: 14px;
}

.caption-block {
  width: min(720px, 100%);
  min-height: 120px;
  margin-top: 28px;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid #f0f0f3;
  outline: 0;
  resize: vertical;
  color: #333441;
  line-height: 1.8;
  font-size: 15px;
}

.zcool-quick-tools {
  position: fixed;
  right: 408px;
  bottom: 132px;
  z-index: 50;
  display: grid;
  gap: 14px;
}

.zcool-quick-tools button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #e2e3e8;
  border-radius: 50%;
  background: #fff;
  color: #555865;
  font-size: 11px;
  box-shadow: 0 8px 22px rgb(28 29 36 / .08);
}

.zcool-quick-tools span {
  display: block;
  font-weight: 900;
  font-size: 13px;
}

.zcool-settings-panel {
  position: sticky;
  top: 54px;
  height: calc(100dvh - 54px);
  overflow: auto;
  padding: 32px 28px 110px;
  border-left: 1px solid #eeeef2;
  background: #f7f7f9;
}

.cover-uploader {
  height: 150px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border: 1px dashed #d9dbe2;
  border-radius: 8px;
  background: #fff;
  color: #8f9099;
  cursor: pointer;
  overflow: hidden;
}

.cover-uploader img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-uploader span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
}

.cover-uploader b {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d8d9df;
  color: #fff;
  font-size: 28px;
  font-weight: 400;
}

.zcool-settings-panel label {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
  color: #4f5059;
  font-weight: 800;
}

.zcool-settings-panel .required-field::before {
  content: "*";
  color: #ff5b43;
  margin-right: 2px;
}

.zcool-settings-panel small {
  justify-self: end;
  margin-top: -24px;
  color: #aaaab3;
  font-size: 12px;
  font-weight: 600;
}

.zcool-settings-panel input,
.zcool-settings-panel select {
  width: 100%;
  height: 42px;
  border: 1px solid #dedfe5;
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: #555661;
}

.field-hint {
  margin: -14px 0 24px;
  color: #aaaab3;
  font-size: 12px;
  line-height: 1.5;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin: 14px 0;
  color: #4f5059;
  font-weight: 800;
}

.switch-row em {
  padding: 3px 8px;
  border-radius: 999px;
  background: #ff6148;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.switch-row .switch {
  margin: 0 0 0 auto;
}

.switch {
  position: relative;
  width: 36px;
  height: 20px;
  display: block;
  cursor: pointer;
}

.switch input {
  position: absolute;
  inset: 0;
  width: 36px;
  height: 20px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.switch span {
  width: 36px;
  height: 20px;
  display: block;
  border-radius: 999px;
  background: #dedfe5;
  position: relative;
  transition: background .18s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgb(0 0 0 / .18);
  transition: transform .18s ease;
}

.switch input:checked + span {
  background: #ff5a3d;
}

.switch input:checked + span::after {
  transform: translateX(16px);
}

.evidence-card {
  margin: 6px 0 20px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fff;
  color: #777985;
  font-size: 13px;
  line-height: 1.6;
}

.evidence-card strong {
  color: #4a4b54;
  font-size: 14px;
}

.evidence-card a {
  float: right;
  color: #ff5a3d;
  text-decoration: none;
  font-weight: 800;
}

.evidence-card p {
  margin: 6px 0 0;
}

.related-product-panel[hidden] {
  display: none;
}

.related-product-panel {
  margin: 0 0 18px;
}

.attachment-uploader {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  align-items: center;
}

.attachment-uploader input {
  display: none;
}

.attachment-uploader b {
  grid-column: 1 / -1;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #1f2027;
  color: #fff;
  font-weight: 900;
}

.more-settings {
  margin-top: 18px;
  border-top: 1px solid #ebebef;
  padding-top: 18px;
}

.more-settings-toggle {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: #4d4e58;
  font-weight: 850;
}

.more-settings-body {
  display: grid;
  gap: 18px;
  padding-top: 16px;
}

.more-settings-body.is-collapsed {
  display: none;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #4f5059;
  font-weight: 750;
}

.radio-row > span {
  margin-right: auto;
}

.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 650;
}

.radio-row input {
  width: auto;
  height: auto;
  accent-color: #ff563f;
}

.supabase-note {
  padding: 14px;
  border-radius: 10px;
  background: #fff;
  color: #777985;
  line-height: 1.5;
  font-size: 12px;
}

.zcool-publish-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-top: 1px solid #ececf1;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 -8px 24px rgb(20 21 28 / .04);
}

.word-limit,
.draft-status {
  color: #9a9ba5;
  font-weight: 750;
}

.draft-status {
  color: #777985;
}

.bar-icon {
  width: 38px;
  height: 38px;
  border: 1px solid #dedfe5;
  border-radius: 10px;
  background: #fff;
  color: #555865;
}

.publish-orange {
  height: 42px;
  min-width: 126px;
  border: 0;
  border-radius: 9px;
  background: #ff5a3d;
  color: #fff;
  font-weight: 900;
}

.publish-orange:active,
.ghost-pill:active,
.bar-icon:active {
  transform: translateY(1px);
}

@media (max-width: 980px) {
  .zcool-upload-header {
    padding: 0 18px;
  }

  .zcool-upload-shell {
    grid-template-columns: 1fr;
    background: #fff;
  }

  .zcool-editor-main {
    padding: 28px 18px 36px;
  }

  .zcool-title-input,
  .zcool-title-count,
  .zcool-intro-copy,
  .zcool-image-block,
  .image-caption,
  .caption-block {
    width: 100%;
  }

  .zcool-image-block {
    min-height: 300px;
  }

  .zcool-settings-panel {
    position: relative;
    top: auto;
    height: auto;
    padding: 24px 18px 104px;
    border-left: 0;
    border-top: 1px solid #eeeef2;
  }

  .zcool-quick-tools {
    position: fixed;
    right: 18px;
    bottom: 92px;
  }

  .zcool-publish-bar {
    height: auto;
    min-height: 72px;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 14px;
    overflow-x: auto;
  }

  .word-limit,
  .draft-status {
    flex: 0 0 auto;
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  .zcool-upload-brand strong {
    font-size: 18px;
  }

  .zcool-upload-brand span {
    font-size: 15px;
  }

  .zcool-title-input {
    font-size: 21px;
  }

  .publish-orange {
    min-width: 88px;
  }
}

.auth-modal[hidden] {
  display: none;
}

.upload-view {
  min-height: 100dvh;
  background: #fff;
}

.upload-promo {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 56px;
  background: #f2f3fa;
  color: #454653;
  font-size: 13px;
  font-weight: 650;
}

.upload-promo strong {
  padding: 3px 8px;
  border-radius: 4px;
  background: #222333;
  color: #fff;
  font-size: 11px;
}

.upload-promo button {
  border: 0;
  background: transparent;
  color: #11121a;
  font-weight: 850;
}

.promo-close {
  position: absolute;
  right: 18px;
}

.upload-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px;
}

.upload-actions {
  display: flex;
  gap: 10px;
}

.ghost-pill,
.dark-pill {
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  font-weight: 800;
}

.ghost-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: #222331;
}

.dark-pill {
  border: 1px solid #11121a;
  background: #11121a;
  color: #fff;
}

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  min-height: calc(100dvh - 108px);
  border-top: 1px solid #eeeef3;
}

.editor-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 52px 24px 92px;
}

.editor-title {
  width: min(760px, 86vw);
  border: 0;
  outline: 0;
  color: #9c9daa;
  text-align: center;
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 24px;
}

.upload-artboard {
  position: relative;
  display: grid;
  place-items: center;
  width: min(820px, 86vw);
  min-height: 460px;
  overflow: hidden;
  border: 1px dashed #e2e3ec;
  border-radius: 12px;
  background: #fafafd;
  cursor: pointer;
}

.upload-artboard input {
  display: none;
}

.upload-artboard img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upload-empty {
  max-width: 320px;
  color: #7c7d8b;
  text-align: center;
  line-height: 1.6;
}

.upload-empty strong {
  display: block;
  color: #333441;
  font-size: 18px;
}

.caption-block {
  width: min(630px, 76vw);
  min-height: 54px;
  margin-top: 64px;
  padding: 16px 18px;
  resize: vertical;
  border: 1.5px solid #f08bd3;
  border-radius: 9px;
  outline: 0;
  color: #333441;
}

.floating-tools {
  position: absolute;
  right: max(16px, calc(50% - 430px));
  bottom: 94px;
  display: grid;
  gap: 5px;
  padding: 9px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 44px rgb(18 19 30 / 0.12);
}

.floating-tools button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #8b8c98;
}

.floating-tools .danger {
  color: #ef5c80;
}

.insert-block {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  height: 38px;
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #fff;
  color: #5a5b67;
  font-weight: 800;
}

.editor-sidebar {
  padding: 24px 22px;
  border-left: 1px solid #eeeef3;
}

.close-editor-panel {
  border: 0;
  background: transparent;
  color: #6f707c;
  margin-bottom: 22px;
}

.editor-sidebar h2 {
  display: flex;
  gap: 10px;
  margin: 0 0 28px;
  color: #333441;
}

.editor-sidebar label {
  display: grid;
  gap: 9px;
  margin-bottom: 22px;
  color: #555663;
  font-weight: 750;
}

.editor-sidebar input,
.editor-sidebar select {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 12px;
  background: #fff;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.segmented button {
  height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented .is-selected {
  color: #6552ff;
  box-shadow: inset 0 0 0 2px #7765ff;
}

.alignment span {
  display: block;
  margin-bottom: 9px;
  color: #555663;
  font-weight: 750;
}

.supabase-note {
  padding: 14px;
  border-radius: 12px;
  background: #fff8dc;
  color: #725315;
  line-height: 1.5;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
}

.auth-card {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  margin: 12dvh auto;
  padding: 34px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 90px rgb(20 21 30 / 0.26);
}

.auth-card img {
  width: 150px;
  display: block;
  margin-bottom: 22px;
}

.auth-card h2 {
  margin: 0 0 8px;
}

.auth-card p {
  margin: 0 0 22px;
  color: #70717d;
}

.auth-card label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  font-weight: 750;
}

.auth-card input {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
}

.auth-card .primary-action {
  width: 100%;
}

.auth-status {
  display: block;
  margin-top: 14px;
  color: #6f707c;
}

.shot-modal[hidden] {
  display: none;
}

.shot-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgb(16 17 24 / 0.52);
  backdrop-filter: blur(10px);
}

.shot-dialog {
  position: relative;
  width: min(1420px, calc(100vw - 72px));
  max-height: calc(100dvh - 40px);
  margin: 20px auto;
  overflow: auto;
  scrollbar-width: none;
  border-radius: var(--radius-dialog);
  background: #fff;
  box-shadow: 0 28px 90px rgb(20 21 30 / 0.26);
}

.shot-dialog::-webkit-scrollbar {
  display: none;
}

.modal-scrollbar {
  position: sticky;
  top: 22px;
  float: right;
  width: 8px;
  height: calc(100dvh - 84px);
  margin-right: 9px;
  margin-bottom: calc(-100dvh + 84px);
  border-radius: var(--radius-pill);
  background: rgb(31 32 43 / 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 25;
}

.modal-scrollbar.is-visible {
  opacity: 1;
}

.modal-scrollbar span {
  display: block;
  width: 100%;
  min-height: 36px;
  border-radius: inherit;
  background: rgb(31 32 43 / 0.44);
  transform: translateY(0);
}

.modal-close,
.modal-nav {
  position: fixed;
  z-index: 120;
  border: 0;
  background: #fff;
  color: #3e3f4b;
  box-shadow: 0 10px 30px rgb(20 21 30 / 0.16);
  transition:
    transform 140ms ease,
    background 140ms ease;
}

.modal-close {
  top: 22px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 38px;
}

.modal-nav {
  top: 50%;
  width: 46px;
  height: 58px;
  border-radius: var(--radius-dialog-inner);
  font-size: 36px;
  line-height: 1;
  transform: translateY(-50%);
}

.modal-prev {
  left: 22px;
}

.modal-next {
  right: 22px;
}

.modal-close:hover,
.modal-nav:hover {
  background: #f7f7fa;
}

.modal-close:active,
.modal-nav:active {
  transform: translateY(1px) scale(0.98);
}

.modal-nav:active {
  transform: translateY(-50%) scale(0.98);
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 44px 54px 22px;
}

.detail-copy {
  min-width: 0;
}

.detail-copy h1 {
  margin: 0 0 16px;
  color: #20212c;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

.detail-author {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #70717d;
  font-weight: 650;
}

.detail-avatar {
  width: 28px;
  height: 28px;
}

.detail-author-name,
.detail-team {
  color: #363744;
  font-weight: 780;
}

.detail-for {
  color: #8b8c98;
}

.work-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  color: #238755;
  font-size: 13px;
  font-weight: 780;
}

.work-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2cc46c;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.icon-action,
.secondary-action,
.primary-action {
  height: 42px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.icon-action {
  width: 42px;
  border: 1px solid var(--line);
  background: #fff;
  color: #4a4b57;
  font-size: 20px;
}

.icon-action.is-liked {
  border-color: #ffb5c9;
  background: #fff0f5;
  color: #ec4c89;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fff;
  color: #343541;
  padding: 0 18px;
}

.primary-action {
  border: 1px solid #11121a;
  background: #11121a;
  color: #fff;
  padding: 0 20px;
}

.secondary-action:hover,
.icon-action:hover {
  background: #f7f7fa;
  border-color: #cfd1dc;
}

.primary-action:hover {
  background: #2a2b35;
}

.icon-action:active,
.secondary-action:active,
.primary-action:active {
  transform: translateY(1px) scale(0.98);
}

.palette-row {
  display: flex;
  gap: 8px;
  padding: 0 54px 24px;
}

.palette-swatch {
  width: 42px;
  height: 30px;
  border-radius: calc(var(--radius-dialog-inner) - 8px);
  border: 1px solid rgb(0 0 0 / 0.08);
}

.detail-media {
  margin: 0 54px;
  overflow: hidden;
  border-radius: var(--radius-dialog-inner);
  background: #f0f0f4;
}

.detail-media img {
  display: block;
  width: 100%;
  aspect-ratio: 1.42 / 1;
  object-fit: cover;
}

.detail-description {
  max-width: 760px;
  margin: 28px 54px 0;
  color: #555663;
  font-size: 16px;
  line-height: 1.7;
}

.designer-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  margin: 36px 54px 0;
  padding: 24px;
  border: 1px solid #ececf3;
  border-radius: var(--radius-dialog-inner);
  background: #fafafd;
}

.image-pending,
.layout-image:not(.has-text) {
  display: none;
}

.designer-avatar {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

.designer-card h2 {
  margin: 0 0 5px;
  color: #242531;
  font-size: 18px;
}

.designer-card p {
  margin: 0;
  color: #737480;
  line-height: 1.5;
}

.more-section {
  padding: 42px 54px 54px;
}

.more-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.more-title-row h2 {
  margin: 0;
  color: #242531;
  font-size: 22px;
}

.compact {
  height: 36px;
  padding-inline: 15px;
}

.more-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.more-card {
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--radius-dialog-inner);
  background: #f0f0f4;
}

.more-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1.42 / 1;
  object-fit: cover;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1720px) {
  .page-shell {
    padding-inline: 44px;
  }

  .main-nav {
    grid-template-columns: auto minmax(260px, 500px) 1fr auto;
    gap: 22px;
  }

  .nav-links {
    gap: 22px;
  }

  .gallery {
    grid-template-columns: repeat(5, minmax(220px, 1fr));
  }
}

@media (max-width: 1360px) {
  .main-nav {
    grid-template-columns: auto minmax(260px, 1fr) auto;
  }

  .nav-links {
    display: none;
  }

  .account-actions {
    grid-column: auto;
  }

  .icon-only {
    display: none;
  }

  .gallery {
    grid-template-columns: repeat(4, minmax(210px, 1fr));
  }
}

@media (max-width: 1020px) {
  .page-shell {
    padding-inline: 22px;
  }

  .topbar {
    padding-bottom: 26px;
  }

  .main-nav {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
  }

  .account-actions:not(.compact-account) {
    display: none;
  }

  .mobile-menu {
    display: grid;
  }

  .filter-row {
    align-items: center;
    margin-top: 34px;
  }

  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 20px;
  }

  .shot-dialog {
    width: min(100vw - 32px, 920px);
  }

  .detail-head {
    display: block;
  }

  .detail-actions {
    margin-top: 20px;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 10px 14px 56px;
  }

  .topbar {
    padding-bottom: 24px;
  }

  .main-nav {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }

  .brand {
    font-size: 25px;
  }

  .brand-image {
    width: 108px;
    height: 40px;
  }

  .search {
    height: 46px;
  }

  .search input {
    padding: 0 54px 0 18px;
    font-size: 13px;
  }

  .search-type {
    display: none;
  }

  .search-button {
    width: 34px;
    height: 34px;
    top: 6px;
    right: 6px;
  }

  .search-button span {
    left: 10px;
    top: 9px;
  }

  .filter-row {
    display: flex;
    gap: 10px;
    margin-top: 22px;
  }

  .popular {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    justify-content: flex-start;
    gap: 8px;
  }

  .popular::-webkit-scrollbar {
    display: none;
  }

  .follow-button {
    display: none;
  }

  .popular-button,
  .filters-button {
    height: 36px;
    padding-inline: 13px;
    border-radius: var(--radius-pill);
    font-size: 13px;
  }

  .filters-button {
    flex: 0 0 auto;
  }

  .chip {
    height: 36px;
    padding-inline: 14px;
    font-size: 13px;
  }

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

  .name {
    font-size: 13px;
  }

  .tier {
    display: none;
  }

  .meta {
    align-items: flex-start;
  }

  .stats {
    display: none;
  }

  .shot-dialog {
    width: 100vw;
    max-height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .modal-scrollbar {
    top: 68px;
    height: calc(100dvh - 90px);
    margin-right: 5px;
    margin-bottom: calc(-100dvh + 90px);
  }

  .modal-close {
    top: 12px;
    right: 12px;
  }

  .modal-nav {
    display: none;
  }

  .detail-head {
    display: block;
    padding: 72px 16px 18px;
  }

  .detail-copy h1 {
    font-size: 28px;
    line-height: 1.08;
  }

  .detail-actions {
    margin-top: 18px;
    flex-wrap: wrap;
  }

  .palette-row {
    padding: 0 16px 18px;
    overflow-x: auto;
  }

  .detail-media,
  .detail-description,
  .designer-card {
    margin-left: 16px;
    margin-right: 16px;
  }

  .detail-media {
    border-radius: var(--radius-dialog-inner);
  }

  .detail-media img {
    aspect-ratio: 1.42 / 1;
    object-fit: contain;
  }

  .designer-card {
    grid-template-columns: auto 1fr;
    padding: 18px;
  }

  .designer-card .primary-action {
    grid-column: 1 / -1;
    width: 100%;
  }

  .more-section {
    padding: 32px 16px 44px;
  }

  .more-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (max-width: 460px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 12px;
  }

  .page-shell {
    padding-inline: 12px;
  }

  .avatar {
    width: 20px;
    height: 20px;
  }

  .name {
    max-width: 88px;
  }

  .detail-author {
    align-items: flex-start;
  }

  .detail-actions > * {
    flex: 1 1 auto;
  }

  .icon-action {
    flex: 0 0 42px;
  }

  .primary-action {
    min-width: 128px;
  }
}

@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .editor-sidebar {
    border-left: 0;
    border-top: 1px solid #eeeef3;
  }
}

@media (max-width: 760px) {
  .compact-account {
    display: none;
  }

  .editor-title {
    font-size: 24px;
  }

  .upload-artboard {
    width: calc(100vw - 28px);
    min-height: 280px;
  }

  .caption-block {
    width: calc(100vw - 34px);
    margin-top: 38px;
  }

  .floating-tools {
    right: 18px;
    bottom: 74px;
  }
}

@media (max-width: 340px) {
  .gallery,
  .more-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

/* ZCOOL-style free layout editor */
.legacy-field {
  display: none !important;
}

.layout-stage {
  position: relative;
  width: min(720px, 100%);
  min-height: 540px;
}

.layout-blocks {
  display: grid;
  gap: 18px;
  min-height: 540px;
  align-content: start;
}

.layout-blocks.is-dragging-image {
  outline: 1px dashed #ff6a45;
  outline-offset: 18px;
  background: rgb(255 106 69 / 0.03);
}

.layout-block {
  position: relative;
  min-height: 34px;
  display: grid;
  justify-items: center;
}

.layout-block::before {
  position: absolute;
  inset: -10px -12px;
  border: 1px solid transparent;
  border-radius: 10px;
  content: "";
  pointer-events: none;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.layout-block:hover::before,
.layout-block.is-active::before {
  border-color: #ececf1;
  background: rgb(247 247 249 / 0.42);
}

.block-handle,
.block-floating-tools {
  position: absolute;
  left: -42px;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.block-handle {
  top: 1px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1.5px solid #5e626a;
  border-radius: 50%;
  background: transparent;
  color: #555862;
  font-size: 0;
  font-weight: 600;
}

.block-handle::before {
  content: "\2630";
  font-size: 13px;
  line-height: 1;
}

.layout-block:not(.has-text) .block-handle {
  border-color: #ff5c3d;
  color: #ff5c3d;
}

.layout-block:not(.has-text) .block-handle::before {
  content: "+";
  font-size: 20px;
  font-weight: 400;
}

.layout-block.tools-open .block-handle {
  border-color: #ff5c3d;
  color: #ff5c3d;
}

.block-floating-tools {
  top: 34px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #ececf1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 38px rgb(20 21 28 / 0.12);
  transform: translateY(-4px);
}

.layout-block:hover .block-handle,
.layout-block.is-active .block-handle {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.layout-block.tools-open .block-floating-tools {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.block-floating-tools button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #72737f;
  font-size: 12px;
  font-weight: 850;
}

.block-floating-tools button:hover {
  background: #f2f2f6;
  color: #20212c;
}

.block-floating-tools .danger {
  color: #ff563f;
}

.zcool-compose-panel {
  width: 244px;
  gap: 0;
  padding: 20px 20px 14px;
  border-radius: 8px;
  box-shadow: 0 18px 34px rgb(20 21 28 / 0.14);
  top: 35px;
  left: -32px;
}

.zcool-compose-panel .insert-menu-row,
.zcool-compose-panel .format-row {
  width: 100%;
  border-radius: 4px;
}

.zcool-compose-panel .insert-menu-row {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0;
  text-align: left;
}

.zcool-compose-panel .insert-menu-row b {
  min-width: 0;
  white-space: nowrap;
}

.text-format-panel {
  min-height: 246px;
}

.empty-compose-panel {
  min-height: 292px;
}

.insert-menu-list {
  margin-top: 22px;
  display: grid;
  gap: 8px;
}

.insert-menu-row {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #222;
  font-family: var(--zcool-font);
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  text-align: left;
}

.insert-menu-row:hover {
  color: #ff5c3d;
}

.insert-menu-row .tool-ico {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #23242b;
  font-size: 15px;
  line-height: 1;
}

.insert-menu-row .pdf-ico {
  font-size: 8px;
  font-weight: 800;
  border: 1px solid currentColor;
  border-radius: 3px;
}

.insert-menu-row b {
  font: inherit;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(6, 24px);
  gap: 15px 9px;
  align-items: center;
}

.text-format-panel button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #2f3038;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}

.text-format-panel button:hover,
.text-format-panel button.is-selected {
  background: #fff0e9;
  color: #ff6a45;
}

.text-format-panel .format-section-title {
  display: block;
  margin: 25px 0 10px;
  color: #555865;
  font-size: 13px;
  font-weight: 650;
}

.text-format-panel .format-row {
  width: 100%;
  height: 34px;
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  padding: 0;
  border-radius: 0;
  color: #30313c;
  font-size: 14px;
  font-weight: 650;
}

.text-format-panel .format-row:hover {
  background: transparent;
  color: #ff563f;
}

.text-format-panel .format-row span {
  width: 24px;
  color: #30313c;
  font-size: 21px;
}

.compact-tools {
  width: auto;
}

.text-block {
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  outline: 0;
  resize: none;
  overflow: hidden;
  background: transparent;
  color: rgb(34 34 34);
  font-size: 16px;
  line-height: 28px;
  white-space: pre-wrap;
  font-family: "PingFang SC", var(--zcool-font);
  font-weight: 400;
}

.layout-block.is-active .text-block {
  background: transparent;
  border-radius: 3px;
}

.syl-editor {
  width: 100%;
  min-height: 28px;
  position: relative;
}

.ProseMirror {
  display: block;
  min-height: 28px;
  font-size: 16px;
  line-height: 28px;
  font-family: "PingFang SC", var(--zcool-font);
  color: rgb(34 34 34);
}

.text-block::placeholder {
  color: rgb(186 186 186);
  opacity: 1;
  font-family: "PingFang SC", var(--zcool-font);
  font-size: 16px;
  line-height: 28px;
}

.insert-block,
.block-insert-popover,
.zcool-quick-tools,
.zcool-intro-copy {
  display: none !important;
}

.text-style-h1 {
  font-size: 30px;
  font-weight: 850;
  line-height: 1.35;
}

.text-style-h2 {
  font-size: 24px;
  font-weight: 820;
  line-height: 1.45;
}

.text-style-h3 {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.55;
}

.text-block.is-bold {
  font-weight: 850;
}

.text-block.is-italic {
  font-style: italic;
}

.text-block.is-underline {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-block.is-quote {
  padding-left: 18px;
  border-left: 4px solid #d9dbe2;
  color: #555865;
}

.text-block.is-bullet-list::before {
  content: "• ";
}

.text-block.is-ordered-list::before {
  content: "1. ";
}

.text-block.has-link {
  color: #246bce;
}

.image-block-shell {
  width: 100%;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.image-upload-target {
  position: relative;
  width: 100%;
  min-height: 360px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #fff;
}

.image-upload-target img {
  display: block;
  width: 100%;
  max-height: 720px;
  object-fit: contain;
}

.image-delete-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.62);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.image-upload-target:hover .image-delete-button,
.layout-block.is-active .image-delete-button,
.image-delete-button:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.layout-block.width-small .image-block-shell,
.layout-block.width-small .block-caption {
  width: min(420px, 100%);
}

.layout-block.width-medium .image-block-shell,
.layout-block.width-medium .block-caption {
  width: min(560px, 100%);
}

.layout-block.width-full .image-block-shell,
.layout-block.width-full .block-caption {
  width: 100%;
}

.layout-block.align-left {
  justify-items: start;
}

.layout-block.align-center {
  justify-items: center;
}

.layout-block.align-right {
  justify-items: end;
}

.image-layout-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.layout-block:hover .image-layout-toolbar,
.layout-block.is-active .image-layout-toolbar {
  opacity: 1;
  transform: translateY(0);
}

.image-layout-toolbar button {
  height: 28px;
  border: 1px solid #e0e1e8;
  border-radius: 999px;
  background: #fff;
  color: #555865;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.image-layout-toolbar button:hover {
  border-color: #ffb2a4;
  color: #ff563f;
}

.block-caption {
  width: 100%;
  min-height: 38px;
  border: 0;
  outline: 0;
  resize: vertical;
  color: #777985;
  text-align: center;
  font-size: 14px;
}

.video-placeholder {
  width: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px dashed #d8d9e0;
  border-radius: 8px;
  background: #fafafd;
  color: #8e8f99;
}

.video-placeholder strong {
  color: #333441;
  font-size: 18px;
}

.insert-block {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  height: 38px;
  min-width: 210px;
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #fff;
  color: #5a5b67;
  font-weight: 800;
}

.insert-block span {
  display: inline-block;
  margin-right: 8px;
  color: #20212c;
  font-size: 18px;
  line-height: 1;
}

.block-insert-popover {
  position: absolute;
  left: 50%;
  bottom: 48px;
  z-index: 12;
  display: flex;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5e6ed;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 48px rgb(20 21 28 / 0.16);
  transform: translateX(-50%);
}

.block-insert-popover[hidden] {
  display: none;
}

.block-insert-popover button {
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #f4f4f7;
  color: #333441;
  padding: 0 15px;
  font-weight: 850;
}

.block-insert-popover button:hover {
  background: #11121a;
  color: #fff;
}

@media (max-width: 980px) {
  .zcool-upload,
  .zcool-upload-shell,
  .zcool-editor-main,
  .zcool-settings-panel {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
  }

  .zcool-upload-shell {
    display: block;
    min-width: 0;
  }

  .zcool-editor-main {
    min-width: 0;
    padding: 28px 18px 36px !important;
  }

  .layout-stage {
    width: 100%;
    max-width: 100%;
  }

  .block-handle,
  .block-floating-tools {
    left: auto;
    right: 6px;
  }

  .zcool-compose-panel {
    left: auto;
    right: 0;
    width: min(244px, calc(100vw - 34px));
  }

  .block-handle {
    top: -16px;
  }

  .block-floating-tools {
    top: 16px;
  }

  .image-upload-target {
    min-height: 280px;
  }

  .zcool-quick-tools {
    right: 16px;
    bottom: 88px;
  }

  .zcool-publish-bar {
    max-width: 100vw;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .zcool-publish-bar > * {
    flex: 0 0 auto;
  }
}

@media (max-width: 520px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .layout-blocks {
    gap: 22px;
  }

  .layout-block::before {
    inset: -8px;
  }

  .block-floating-tools {
    grid-template-columns: repeat(3, 28px);
    border-radius: 18px;
  }

  .text-format-panel {
    right: 0;
    width: min(244px, calc(100vw - 34px));
    grid-template-columns: none;
    border-radius: 10px;
  }

  .format-grid {
    grid-template-columns: repeat(6, 24px);
  }

  .image-layout-toolbar {
    justify-content: flex-start;
  }

  .image-upload-target {
    min-height: 220px;
  }

  .insert-block {
    width: 100%;
  }

  .zcool-publish-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    overflow: hidden;
  }

  .word-limit {
    display: none;
  }

  .draft-status {
    width: 100%;
    text-align: center;
  }

  .bar-icon {
    width: 34px;
    height: 34px;
  }

  .ghost-pill,
  .publish-orange {
    height: 34px;
    min-width: auto;
    padding: 0 12px;
  }
}

@media (max-width: 520px) {
  main.zcool-upload .zcool-publish-bar {
    height: auto;
    min-height: 92px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    overflow: hidden;
  }

  main.zcool-upload .zcool-publish-bar > * {
    flex: 0 1 auto;
  }

  main.zcool-upload .word-limit {
    display: none;
  }

  main.zcool-upload .draft-status {
    flex-basis: 100%;
    text-align: center;
  }
}

/* Final ZCOOL editor panel overrides: keep menu rows readable even when generic tool-button rules apply. */
main.zcool-upload .zcool-compose-panel {
  display: block !important;
  width: 244px !important;
  min-width: 244px !important;
  max-width: min(244px, calc(100vw - 34px)) !important;
  padding: 20px 20px 14px !important;
}

main.zcool-upload .zcool-compose-panel .format-grid {
  display: grid !important;
  grid-template-columns: repeat(6, 24px) !important;
  gap: 15px 9px !important;
}

main.zcool-upload .zcool-compose-panel .format-grid button {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  padding: 0 !important;
  border-radius: 5px !important;
  white-space: nowrap !important;
}

main.zcool-upload .zcool-compose-panel .insert-menu-list {
  display: grid !important;
  gap: 8px !important;
  margin-top: 22px !important;
}

main.zcool-upload .zcool-compose-panel .insert-menu-row,
main.zcool-upload .zcool-compose-panel .format-row {
  width: 100% !important;
  min-width: 0 !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  padding: 0 !important;
  border-radius: 4px !important;
  text-align: left !important;
  white-space: nowrap !important;
}

main.zcool-upload .zcool-compose-panel .insert-menu-row b,
main.zcool-upload .zcool-compose-panel .format-row {
  writing-mode: horizontal-tb !important;
  white-space: nowrap !important;
}

main.zcool-upload .zcool-compose-panel .tool-ico,
main.zcool-upload .zcool-compose-panel .format-row span {
  flex: 0 0 18px !important;
}
