/* ============================================
   编辑器与发布 - 编辑器弹窗、微信朋友圈风格
   ============================================ */

/* 编辑器 */
.editor-modal textarea {
  width: 100%;
  border: none;
  outline: none;
  font-size: calc(var(--font-size) * 0.9375);
  line-height: 1.6;
  resize: none;
  font-family: inherit;
  background: transparent;
  color: var(--text);
}
.image-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
}
.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-item .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size);
  cursor: pointer;
}
.preview-item.add-more {
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.preview-item.add-more svg {
  fill: var(--text-secondary);
}
.editor-tools {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: calc(var(--font-size) * 0.875);
  cursor: pointer;
}
.upload-btn svg { fill: var(--text-secondary); }
.markdown-tip {
  font-size: calc(var(--font-size) * 0.75);
  color: var(--text-secondary);
}

/* 编辑器 - 微信朋友圈风格 */
.editor-overlay {
  background: rgba(0,0,0,0.6);
  padding: 0;
}
.editor-modal {
  background: var(--card-bg);
  width: 100%;
  max-width: 500px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  margin: 0;
}
@media (min-width: 501px) {
  .editor-overlay {
    align-items: center;
    justify-content: center;
  }
  .editor-modal {
    height: 90vh;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  }
}
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.editor-cancel {
  border: none;
  background: none;
  font-size: calc(var(--font-size) * 0.9375);
  color: var(--text-secondary);
  cursor: pointer;
}
.editor-title {
  font-size: var(--font-size);
  font-weight: 600;
}
.editor-submit {
  border: none;
  background: #07c160;
  color: #fff;
  font-size: calc(var(--font-size) * 0.875);
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.editor-submit:hover {
  background: #06ad56;
}
.editor-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.editor-publishing {
  font-size: calc(var(--font-size) * 0.929);
  color: #07c160;
  font-weight: 600;
}
.editor-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
}
.editor-textarea {
  width: 100%;
  border: none;
  outline: none;
  font-size: var(--font-size);
  line-height: 1.6;
  resize: none;
  font-family: inherit;
  background: transparent;
  color: var(--text);
  min-height: 120px;
  flex: 1;
}
.editor-images {
  margin-top: 16px;
}
.image-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}
.image-grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.image-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
}
.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size);
  cursor: pointer;
}
.image-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.image-add:hover {
  border-color: #07c160;
  color: #07c160;
}
.image-add span {
  font-size: 32px;
  line-height: 1;
}
.image-add small {
  font-size: calc(var(--font-size) * 0.75);
  margin-top: 4px;
}
.editor-footer {
  display: flex;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.editor-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--comment-bg);
  border: 1px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.editor-option:hover {
  background: var(--border);
}
.editor-option-active:hover {
  background: #06ad56 !important;
  border-color: #06ad56;
}
.option-icon {
  font-size: var(--font-size);
}
.option-text {
  font-size: calc(var(--font-size) * 0.8125);
  color: var(--text);
}
.category-picker {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.category-item {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: calc(var(--font-size) * 0.8125);
  cursor: pointer;
  transition: all 0.2s;
}
.category-item.active {
  background: #07c160;
  color: #fff;
  border-color: #07c160;
}
.category-item:hover {
  border-color: #07c160;
}

/* 编辑器选项激活状态 */
.editor-option-active {
  background: #07c160 !important;
  border: 1px solid #07c160;
  color: #fff;
}

.editor-option-active .option-text {
  color: #fff;
  font-weight: 600;
}

.editor-option-active .option-icon {
  filter: brightness(1.2);
}

.dark .editor-option-active {
  background: #06ad56 !important;
  border-color: #06ad56;
  color: #fff;
}

.dark .editor-option-active .option-text {
  color: #fff;
}

/* 匿名标识 */
.memo-anonymous-tag {
  display: inline-block;
  font-size: 11px;
  color: #07c160;
  background: rgba(7,193,96,0.1);
  border: 1px solid rgba(7,193,96,0.3);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 500;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1.4;
}

/* 私有标识 */
.memo-private-tag {
  font-size: 12px;
  color: #fa8c16;
  font-weight: 500;
}
