/* MOC 发布页：Share your MOC 四段表单 + 底栏操作 */

.publish-page {
  background: #fff;
  padding-bottom: 72px;
}

.publish-hero {
  background: var(--yellow);
  padding: 36px 0 40px;
  text-align: center;
}

.publish-hero__inner {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
}

.publish-hero__title {
  margin: 0;
  color: #111;
  font-size: clamp(34px, 4.2vw, 48px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.publish-hero__desc {
  margin: 14px auto 0;
  max-width: 720px;
  color: #111;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
}

.publish-body {
  width: min(980px, calc(100% - 40px));
  margin: 28px auto 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.publish-card {
  background: #eaf4fb;
  border-radius: 14px;
  padding: 28px 32px 32px;
}

.publish-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.publish-card__num {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--yellow);
  color: #111;
  font-size: 18px;
  font-weight: 900;
  line-height: 34px;
  text-align: center;
}

.publish-card__title {
  margin: 0;
  color: #111;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.publish-card__title .req {
  color: #e53935;
  font-weight: 800;
}

.publish-card__hint {
  margin-left: 6px;
  color: #8a8a8a;
  font-size: 15px;
  font-weight: 600;
}

.publish-card__lead {
  margin: 0 0 20px;
  color: #6b6b6b;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.publish-field {
  margin-bottom: 18px;
}

.publish-field:last-child {
  margin-bottom: 0;
}

.publish-label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-size: 15px;
  font-weight: 700;
}

.publish-label .req {
  color: #e53935;
}

.publish-label--desc {
  color: var(--blue);
  font-weight: 800;
}

.publish-label--desc span {
  color: #6b6b6b;
  font-weight: 600;
}

.publish-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #c5d8e8;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease;
}

.publish-input:focus {
  border-color: var(--blue);
}

.publish-input::placeholder {
  color: #b0b0b0;
  font-weight: 500;
}

/* 富文本 */
.publish-editor {
  border: 1px solid #c5d8e8;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.publish-editor__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-bottom: 1px solid #e6eef5;
  background: #fafcfe;
}

.publish-style {
  position: relative;
  margin-right: 6px;
}

.publish-style__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #444;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.publish-style__btn:hover,
.publish-style__btn.is-open {
  background: #eef5fb;
}

.publish-style__btn img {
  width: 10px;
  height: auto;
}

.publish-style__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5;
  min-width: 120px;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.publish-style__menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #333;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.publish-style__menu button:hover {
  background: #eef5fb;
}

.publish-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.publish-tool:hover,
.publish-tool.is-on {
  background: #eef5fb;
}

.publish-tool img {
  width: 16px;
  height: auto;
  max-height: 18px;
  object-fit: contain;
}

.publish-tool--bold img { width: 12px; }
.publish-tool--italic img { width: 6px; }
.publish-tool--underline img { width: 13px; }

.publish-editor__body {
  min-height: 160px;
  max-height: 320px;
  overflow: auto;
  padding: 14px 16px;
  color: #222;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  outline: none;
}

.publish-editor__body:empty::before {
  content: attr(data-placeholder);
  color: #b0b0b0;
  font-style: italic;
  font-weight: 500;
  pointer-events: none;
}

.publish-editor__body:focus {
  box-shadow: inset 0 0 0 1px rgba(0, 130, 196, 0.25);
}

.publish-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 36px;
  margin-top: 6px;
  margin-bottom: 22px;
}

.publish-meta__item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.publish-meta__item .publish-label {
  margin: 0;
  flex: 0 0 auto;
  min-width: 72px;
}

.publish-select {
  position: relative;
  flex: 1;
  min-width: 0;
}

.publish-select__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  padding: 0 36px;
  border: 1px solid #c5d8e8;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.publish-select__btn img {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: auto;
  transform: translateY(-50%);
  pointer-events: none;
}

.publish-select__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 6;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.publish-select__menu button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #333;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.publish-select__menu button:hover,
.publish-select__menu button.is-on {
  background: #eef5fb;
  color: var(--blue);
}

/* 分享方式卡片 */
.publish-share-label {
  margin-bottom: 12px;
}

.publish-share {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.publish-share__card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 16px 18px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.publish-share__card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.publish-share__card.is-on {
  border-color: var(--blue);
  background: #f3f3f3;
  box-shadow: none;
}

.publish-share__icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.publish-share__icon--bag {
  width: 40px;
  height: 40px;
}

.publish-share__text {
  min-width: 0;
}

.publish-share__title {
  display: block;
  color: #111;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.publish-share__desc {
  display: block;
  margin-top: 4px;
  color: #777;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

/* Part List 上传区 */
.publish-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 36px 24px;
  border: 2px dashed #b7c9d8;
  border-radius: 12px;
  background: #f4f9fd;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.publish-drop.is-dragging,
.publish-drop:hover {
  border-color: var(--blue);
  background: #edf6fc;
}

.publish-drop__cloud {
  width: 72px;
  height: auto;
  margin-bottom: 18px;
  pointer-events: none;
}

.publish-drop__btn {
  min-width: 200px;
  min-height: 46px;
  padding: 0 28px;
  border: 0;
  border-radius: 10px;
  background: var(--yellow);
  color: #111;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
}

.publish-drop__btn:hover {
  background: var(--yellow-deep);
}

.publish-drop__or {
  margin: 14px 0 0;
  color: #555;
  font-size: 14px;
  font-weight: 600;
}

.publish-drop__formats {
  margin: 8px 0 0;
  color: #9a9a9a;
  font-size: 12px;
  font-weight: 600;
}

.publish-drop__file {
  margin: 12px 0 0;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

/* 图片 / 说明书 */
.publish-media {
  margin-top: 8px;
}

.publish-media + .publish-media {
  margin-top: 22px;
}

.publish-media__label {
  display: block;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
}

.publish-media__label .req {
  color: #e53935;
}

.publish-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.publish-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.publish-btn--yellow {
  background: var(--yellow);
  color: #111;
}

.publish-btn--yellow:hover:not(:disabled) {
  background: var(--yellow-deep);
}

.publish-btn--blue {
  background: var(--blue);
  color: #fff;
}

.publish-btn--blue:hover:not(:disabled) {
  background: var(--blue-deep);
}

.publish-btn__icon {
  width: 16px;
  height: auto;
  object-fit: contain;
}

.publish-btn__plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.publish-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.publish-thumb {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d5e4ef;
}

.publish-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.publish-thumb__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  cursor: pointer;
}

.publish-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.publish-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d5e4ef;
  color: #333;
  font-size: 14px;
  font-weight: 700;
}

.publish-file button {
  border: 0;
  background: transparent;
  color: #999;
  font-size: 18px;
  cursor: pointer;
}

.publish-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
  padding-top: 8px;
}

.publish-actions__btn {
  min-width: 200px;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.publish-actions__btn--draft {
  background: var(--blue);
  color: #fff;
}

.publish-actions__btn--draft:hover {
  background: var(--blue-deep);
}

.publish-actions__btn--submit {
  background: var(--yellow);
  color: #111;
}

.publish-actions__btn--submit:hover {
  background: var(--yellow-deep);
}

.publish-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  transform: translateX(-50%);
  padding: 12px 22px;
  border-radius: 10px;
  background: rgba(17, 17, 17, 0.88);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.publish-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 860px) {
  .publish-card {
    padding: 22px 18px 24px;
  }

  .publish-meta,
  .publish-share {
    grid-template-columns: 1fr;
  }

  .publish-meta__item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .publish-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .publish-actions__btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .publish-hero {
    padding: 28px 0 30px;
  }

  .publish-hero__desc {
    font-size: 13px;
  }

  .publish-card__title {
    font-size: 18px;
  }

  .publish-editor__bar {
    gap: 0;
  }
}
