/* ============ 发布页样式 ============ */
.pub-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
  margin: 14px 0 30px;
}
@media (max-width: 1024px) { .pub-layout { grid-template-columns: 1fr; } .pub-help { display: none; } }

.pub-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.pub-card-title { font-weight: 700; font-size: 16px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.field-row { display: flex; gap: 16px; }
@media (max-width: 700px) { .field-row { flex-direction: column; gap: 0; } }

.cover-row { display: flex; gap: 16px; align-items: flex-start; }
.cover-preview {
  width: 200px; aspect-ratio: 16/9;
  border: 2px dashed var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: #fafbfc; flex-shrink: 0;
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-preview .cp-empty { color: var(--text-3); font-size: 13px; text-align: center; }
.cover-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }

/* 编辑器 */
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.editor-toolbar button {
  border: 1px solid var(--border); background: #fff;
  height: 30px; padding: 0 11px; border-radius: 6px;
  font-size: 13px; color: var(--text-2);
}
.editor-toolbar button:hover { border-color: var(--primary); color: var(--primary); }
.editor-toolbar .tb-sep { width: 1px; background: var(--border); margin: 4px 6px; }
.editor-toolbar .box-cmd.hg { color: #0d6efd; }
.editor-toolbar .box-cmd.wn { color: #b8860b; }
.editor-toolbar .box-cmd.sc { color: var(--success); }
.editor-toolbar .box-cmd.dg { color: var(--danger); }

.editor-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 900px) { .editor-body { grid-template-columns: 1fr; } }

.editor-body textarea {
  width: 100%; height: 520px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px;
  resize: vertical;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px; line-height: 1.7;
  outline: none;
}
.editor-body textarea:focus { border-color: var(--primary); }

.preview-pane {
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; height: 520px;
  display: flex; flex-direction: column;
}
.pv-head {
  padding: 9px 14px; font-size: 13px; font-weight: 600;
  background: #fafbfc; border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.pv-body {
  flex: 1; overflow-y: auto; padding: 14px 16px;
}
.pv-body .art-content { margin: 0; font-size: 15px; }

.pub-submit {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  margin: 4px 0 30px;
}
.pub-submit .btn { height: 42px; padding: 0 34px; font-size: 15px; }

/* 语法帮助 */
.help-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 9px 0; border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.help-item:last-child { border-bottom: none; }
.help-item code { color: var(--primary); font-size: 12px; }
.help-item span { color: var(--text-3); font-size: 12px; }

/* ============ 移动端适配 ============ */
@media (max-width: 540px) {
  .pub-layout { gap: 12px; margin: 8px 0 20px; }
  .pub-card { padding: 16px; border-radius: 10px; }
  .pub-card-title { font-size: 15px; margin-bottom: 12px; padding-bottom: 10px; }
  .cover-row { flex-direction: column; align-items: stretch; }
  .cover-preview { width: 100%; max-width: 200px; }
  .editor-toolbar { gap: 2px; }
  .editor-toolbar button { height: 28px; padding: 0 8px; font-size: 12px; }
  .editor-body textarea, .preview-pane { height: 400px; font-size: 13px; }
  .pub-submit .btn { height: 40px; padding: 0 24px; font-size: 14px; width: 100%; }
  .field-row { gap: 0; }
}
@media (max-width: 400px) {
  .editor-body textarea, .preview-pane { height: 340px; }
  .cover-btns { flex-direction: column; align-items: stretch; }
  .cover-btns input[type="url"] { min-width: 0; }
}
