/* 搜狐号风格 · 文章发布编辑器 v55 */

.sohu-editor-overlay {
  z-index: 500;
  padding: 0;
  background: #eef0f3;
  backdrop-filter: none;
  align-items: stretch;
  justify-content: stretch;
}
.sohu-editor-overlay.show { display: flex; }

.sohu-editor {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #eef0f3;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ── 顶栏 ── */
.sohu-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.sohu-topbar-left, .sohu-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sohu-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: #666;
  font-size: .875rem;
  cursor: pointer;
  border-radius: 4px;
}
.sohu-back:hover { background: #f5f5f5; color: #333; }
.sohu-autosave {
  font-size: .78rem;
  color: #999;
}
.sohu-autosave.saved { color: #52c41a; }
.sohu-autosave.saving { color: #fa8c16; }
.sohu-wordcount {
  font-size: .78rem;
  color: #999;
  padding: 0 8px;
  border-right: 1px solid #eee;
  margin-right: 4px;
}

.sohu-btn-ghost {
  padding: 7px 16px;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #333;
  font-size: .875rem;
  cursor: pointer;
}
.sohu-btn-ghost:hover { border-color: #ff6600; color: #ff6600; }
.sohu-btn-draft {
  padding: 7px 18px;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #333;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}
.sohu-btn-draft:hover { border-color: #999; }
.sohu-publish-group {
  display: flex;
  align-items: stretch;
  border-radius: 4px;
  overflow: hidden;
}
.sohu-btn-publish {
  padding: 7px 20px;
  border: none;
  background: #ff6600;
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
}
.sohu-btn-publish:hover { background: #e55a00; }
.sohu-btn-schedule-toggle {
  width: 32px;
  border: none;
  border-left: 1px solid rgba(255,255,255,.25);
  background: #ff6600;
  color: #fff;
  font-size: .7rem;
  cursor: pointer;
}
.sohu-btn-schedule-toggle:hover { background: #e55a00; }

/* ── 主体 ── */
.sohu-main {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.sohu-canvas-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 40px;
  display: flex;
  justify-content: center;
}
.sohu-canvas {
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

.sohu-title-input {
  width: 100%;
  border: none;
  outline: none;
  padding: 28px 32px 12px;
  font-size: 1.65rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.4;
  background: transparent;
}
.sohu-title-input::placeholder { color: #bbb; font-weight: 500; }
.sohu-title-hint {
  padding: 0 32px 8px;
  font-size: .72rem;
  color: #bbb;
  text-align: right;
}

/* 工具栏 */
.sohu-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px 16px;
  margin: 0 16px;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fafafa;
  position: sticky;
  top: 0;
  z-index: 2;
}
.sohu-tb-group { display: flex; align-items: center; gap: 1px; }
.sohu-tb-divider { width: 1px; height: 20px; background: #e0e0e0; margin: 0 6px; }
.sohu-tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #555;
  font-size: .82rem;
  cursor: pointer;
}
.sohu-tb-btn:hover { background: #eee; color: #222; }
.sohu-tb-btn.active { background: #fff3eb; color: #ff6600; }
.sohu-tb-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.sohu-tb-btn b, .sohu-tb-btn i, .sohu-tb-btn s { font-size: .85rem; }
.sohu-tpl-sel {
  height: 32px;
  padding: 0 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: .78rem;
  color: #555;
  cursor: pointer;
}

/* 正文区 */
.sohu-content {
  flex: 1;
  min-height: 420px;
  padding: 20px 32px 40px;
  outline: none;
  font-size: 1rem;
  line-height: 1.85;
  color: #333;
  word-break: break-word;
}
.sohu-content:empty:before {
  content: attr(data-placeholder);
  color: #bbb;
  pointer-events: none;
}
.sohu-content h1 { font-size: 1.5rem; font-weight: 700; margin: 1.2em 0 .6em; color: #1a1a1a; }
.sohu-content h2 { font-size: 1.25rem; font-weight: 700; margin: 1.1em 0 .5em; color: #1a1a1a; }
.sohu-content h3 { font-size: 1.08rem; font-weight: 700; margin: 1em 0 .4em; color: #1a1a1a; }
.sohu-content p { margin-bottom: .85em; }
.sohu-content blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  border-left: 3px solid #ff6600;
  background: #fff8f3;
  color: #666;
  border-radius: 0 4px 4px 0;
}
.sohu-content ul, .sohu-content ol { padding-left: 1.5em; margin-bottom: .85em; }
.sohu-content img { max-width: 100%; border-radius: 4px; margin: 8px 0; }
.sohu-content a { color: #ff6600; }
.sohu-content video { max-width: 100%; border-radius: 4px; margin: 8px 0; }

/* ── 右侧设置栏 ── */
.sohu-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid #e8e8e8;
  overflow-y: auto;
  padding: 16px 0 32px;
}
.sohu-panel {
  padding: 0 16px 18px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 16px;
}
.sohu-panel:last-child { border-bottom: none; }
.sohu-panel-title {
  font-size: .82rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sohu-panel-title .sohu-link-btn {
  font-size: .72rem;
  font-weight: 500;
  color: #ff6600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.sohu-panel-title .sohu-link-btn:hover { text-decoration: underline; }

.sohu-cover-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #fafafa;
  transition: border-color .2s;
}
.sohu-cover-box:hover { border-color: #ff6600; }
.sohu-cover-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #999;
  font-size: .82rem;
}
.sohu-cover-empty svg { width: 28px; height: 28px; stroke: #ccc; }
.sohu-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.sohu-cover-box.has-cover .sohu-cover-img { display: block; }
.sohu-cover-box.has-cover .sohu-cover-empty { display: none; }
.sohu-cover-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.sohu-cover-actions button {
  flex: 1;
  padding: 6px;
  font-size: .75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: #666;
}
.sohu-cover-actions button:hover { border-color: #ff6600; color: #ff6600; }

.sohu-field textarea,
.sohu-field input,
.sohu-field select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: .82rem;
  color: #333;
  background: #fff;
  font-family: inherit;
}
.sohu-field textarea { resize: vertical; min-height: 72px; line-height: 1.6; }
.sohu-field textarea:focus,
.sohu-field input:focus,
.sohu-field select:focus {
  outline: none;
  border-color: #ff6600;
  box-shadow: 0 0 0 2px rgba(255,102,0,.12);
}
.sohu-field-hint { font-size: .7rem; color: #bbb; margin-top: 4px; text-align: right; }

.sohu-check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .82rem;
  color: #555;
  cursor: pointer;
}
.sohu-check-row input { margin-top: 3px; accent-color: #ff6600; }
.sohu-check-desc { font-size: .72rem; color: #999; margin-top: 4px; line-height: 1.5; }

/* 预览弹层 */
.sohu-preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,.45);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.sohu-preview-overlay.show { display: flex; }
.sohu-preview-dialog {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  background: #fff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.sohu-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #eee;
  font-weight: 700;
  font-size: .92rem;
}
.sohu-preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 32px;
}
.sohu-preview-body .pv-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 12px;
  line-height: 1.4;
}
.sohu-preview-body .pv-meta {
  font-size: .78rem;
  color: #999;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}
.sohu-preview-body .pv-summary {
  font-size: .92rem;
  color: #666;
  background: #f9f9f9;
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
  line-height: 1.7;
}
.sohu-preview-body .pv-content {
  font-size: 1rem;
  line-height: 1.85;
  color: #333;
}
.sohu-preview-body .pv-content h2 { font-size: 1.2rem; font-weight: 800; margin: 1.2em 0 .5em; }
.sohu-preview-body .pv-content h3 { font-size: 1.05rem; font-weight: 700; margin: 1em 0 .4em; }
.sohu-preview-body .pv-cover {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 20px;
}

/* 定时发布弹层 */
.sohu-schedule-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 610;
  background: rgba(0,0,0,.4);
  align-items: center;
  justify-content: center;
}
.sohu-schedule-overlay.show { display: flex; }
.sohu-schedule-dialog {
  width: 360px;
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.sohu-schedule-dialog h3 { font-size: 1rem; margin-bottom: 16px; color: #333; }
.sohu-schedule-dialog input[type="datetime-local"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: .875rem;
  margin-bottom: 16px;
}
.sohu-schedule-actions { display: flex; gap: 10px; justify-content: flex-end; }
.sohu-schedule-actions button {
  padding: 8px 18px;
  border-radius: 4px;
  font-size: .875rem;
  cursor: pointer;
}
.sohu-sched-cancel { border: 1px solid #ddd; background: #fff; color: #666; }
.sohu-sched-confirm { border: none; background: #ff6600; color: #fff; font-weight: 600; }

/* 文章链接选择 */
.sohu-link-picker {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 620;
  background: rgba(0,0,0,.4);
  align-items: center;
  justify-content: center;
}
.sohu-link-picker.show { display: flex; }
.sohu-link-dialog {
  width: 480px;
  max-height: 70vh;
  background: #fff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sohu-link-list { overflow-y: auto; padding: 8px; flex: 1; }
.sohu-link-item {
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: .875rem;
  color: #333;
  border-bottom: 1px solid #f5f5f5;
}
.sohu-link-item:hover { background: #fff3eb; color: #ff6600; }

@media (max-width: 960px) {
  .sohu-sidebar { width: 260px; }
  .sohu-title-input { font-size: 1.35rem; padding: 20px 20px 10px; }
  .sohu-content { padding: 16px 20px 32px; }
}
@media (max-width: 720px) {
  .sohu-main { flex-direction: column; }
  .sohu-sidebar { width: 100%; border-left: none; border-top: 1px solid #e8e8e8; max-height: 40vh; }
  .sohu-canvas { min-height: 50vh; }
}
