/* ============================================================
   集市推送 styles.css
   基底：cover3 的布局 / 配色 / 按钮 / 输入 / 弹窗（整体搬）
   叠加：submit 的排版预览（#wemd-wrapper / #wemd）、Quill 编辑器、
         公众号账号卡片 / 推送记录；本项目新增侧栏账号列表、热帖列表。
   ============================================================ */

:root {
  --color-brown-900: #3f342a;
  --color-brown-700: #5c4a3d;
  --color-brown-600: #6d5b4c;
  --color-brown-500: #776455;
  --color-brown-400: #8b7c69;
  --color-brown-300: #a09586;
  --color-brown-200: #b0a79b;
  --color-brown-100: #dfd5c5;
  --color-brown-50:  #f3ede4;

  --color-primary:       #776455;
  --color-primary-hover:  #826f60;
  --color-primary-text:   #fff8f0;
  --color-accent:        #a16d36;
  --ink:                 #3e2f22;
  --color-surface:       rgba(255, 255, 255, 0.92);
  --color-surface-alt:   #fcfaf6;
  --color-border:        #dfd5c5;
  --color-border-focus:  #a16d36;
  --color-text:          #333;
  --color-text-secondary: #8b7c69;
  --color-text-muted:    #a09586;
  --color-error:         #c0392b;
  --color-success:       #2e7d32;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Quill 稿纸（submit） */
  --editor-line-height: 32px;
  --editor-gutter-width: 20px;
  --editor-rule-line: #e0d7cc;
  --editor-margin-line: #d5cbc0;
  --editor-margin-band: #f3ede4;
  --editor-paper-base: #faf8f5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  background: #f3ede4;
  color: #333;
}

body {
  min-height: 100vh;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ── 头部（cover3） ── */
.app-header {
  background: linear-gradient(180deg, rgba(116, 103, 95, 0.96), rgba(90, 80, 74, 0.98));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 16px rgba(26, 18, 12, 0.16);
  margin-bottom: 0;
}

.header-wrapper {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 0 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.app-logo {
  width: 36px;
  height: 36px;
  margin-right: 12px;
  flex-shrink: 0;
}

.app-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.96);
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 0;
}

.app-header h1 .brand {
  color: #fff;
  font-weight: 700;
}

.app-header h1 .subtitle-part {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  font-size: 15px;
}

.version-badge {
  position: relative;
  top: -1px;
  margin-left: 10px;
  padding: 0 6px;
  font-size: 10px;
  line-height: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  background: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-nav-btn {
  margin-left: auto;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.header-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ── 主布局（cover3 两栏网格） ── */
.app-main {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 20px;
  background: rgba(255, 250, 243, 0.88);
  border: 1px solid rgba(102, 78, 49, 0.12);
  border-radius: 0;
  box-shadow: 0 24px 60px rgba(82, 60, 34, 0.08);
}

.layout-sidebar,
.layout-main {
  background: rgba(255, 254, 250, 0.95);
  border-radius: 8px;
  border: 1px solid rgba(102, 78, 49, 0.08);
  padding: 16px 18px 18px;
  box-shadow: 0 2px 8px rgba(82, 60, 34, 0.04);
  min-width: 0;
}

.layout-sidebar {
  position: sticky;
  top: 16px;
}

.layout-main {
  padding: 14px 18px 16px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.sub-title {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-brown-500);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head .section-title {
  margin-bottom: 0;
}

.section-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.sidebar-head .section-title {
  margin-bottom: 0;
}

.sidebar-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}

.sidebar-hint.error {
  color: var(--color-error);
}

.login-section {
  margin-bottom: 20px;
}

.divider {
  margin: 16px 0;
  border: 0;
  border-top: 1px dashed var(--color-border);
}

.block-divider {
  margin: 22px 0 18px;
}

.user-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #666;
  gap: 8px;
}

.main-guard {
  padding: 40px 0;
  text-align: center;
  font-size: 14px;
}

/* ── 输入（cover3） ── */
.text-input,
.text-area {
  width: 100%;
  min-width: 0;
  border-radius: 6px;
  border: 1px solid rgba(125, 78, 32, 0.14);
  background: linear-gradient(180deg, rgba(255, 254, 250, 0.98), rgba(249, 242, 231, 0.96));
  color: var(--ink, #3e2f22);
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-sizing: border-box;
  font-family: inherit;
}

input.text-input,
select.text-input {
  height: 42px;
}

select.text-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  width: 100%;
  min-width: 0;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238b7c69' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.text-input::placeholder,
.text-area::placeholder {
  color: #b0a79b;
}

.text-input:focus,
.text-area:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(161, 109, 54, 0.1);
  background: #fffdf8;
}

.text-area {
  resize: vertical;
  min-height: 80px;
  height: auto;
}

/* ── 按钮（cover3） ── */
.btn {
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--color-surface-alt);
  color: var(--color-brown-700);
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.btn:hover {
  background: #f0e8dc;
  border-color: #c8b8a4;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: linear-gradient(135deg, #b27d47, #8f5d2d);
  color: var(--color-primary-text);
  border-color: transparent;
}

.btn.primary:hover {
  background: linear-gradient(135deg, #c08a52, #9a6835);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(82, 60, 34, 0.2);
}

.btn.primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn.ghost {
  background: transparent;
  color: var(--color-brown-600);
  border-color: var(--color-border);
}

.btn.ghost:hover {
  background: rgba(119, 100, 85, 0.08);
  border-color: #c8b8a4;
}

.btn.danger {
  background: #78706a;
  color: #fff;
  border-color: transparent;
}

.btn.danger:active {
  background: #665e58;
}

.btn.small {
  padding: 6px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.btn.large {
  padding: 9px 18px;
  font-size: 14px;
}

.btn.full-width {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn:focus-visible {
  outline: 2px solid #a16d36;
  outline-offset: 2px;
}

/* ── 侧栏公众号列表（本项目；沿用 cover3 .project-item 的手感） ── */
.account-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: calc(100vh - 320px);
  min-height: 60px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #d0c4b4 transparent;
}

.account-list::-webkit-scrollbar { width: 5px; }
.account-list::-webkit-scrollbar-track { background: transparent; }
.account-list::-webkit-scrollbar-thumb { background: #d0c4b4; border-radius: 3px; }

.account-item {
  list-style: none !important;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  color: #4a3d33;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(224, 215, 200, 0.5);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: fadeSlideIn 0.25s ease both;
}

.account-item:focus-visible {
  outline: 2px solid #a16d36;
  outline-offset: -2px;
}

.account-item:hover {
  background: rgba(241, 224, 203, 0.9);
  border-color: rgba(200, 180, 160, 0.6);
  box-shadow: 0 2px 8px rgba(180, 150, 120, 0.15);
}

.account-item.active {
  background: linear-gradient(135deg, #f7dec0, #f0c9a5);
  color: #5c3f2e;
  border-color: rgba(220, 180, 140, 0.8);
  box-shadow: inset 3px 0 0 #c8956a, 0 2px 8px rgba(200, 160, 120, 0.25);
}

.account-item.unusable {
  opacity: 0.6;
}

.account-item.placeholder {
  cursor: default;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.6;
}

.account-item.placeholder:hover {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: none;
}

.mp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #f3ede4;
  display: inline-block;
  object-fit: cover;
}

.account-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.perm-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: #f3ede4;
  border-radius: 10px;
  color: #8b7c69;
  white-space: nowrap;
}

.perm-tag.on { background: #eaf6ee; color: #27ae60; }
.perm-tag.ok { background: #e0f2e5; color: #27ae60; }
.perm-tag.warn { background: #fdecea; color: #c0392b; }
.perm-tag.muted { background: #f3ede4; color: #8b7c69; }

.mp-error {
  font-size: 12px;
  color: #c0392b;
  margin-top: 4px;
  line-height: 1.5;
}

.account-actions {
  flex-shrink: 0;
}

.account-actions .btn {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
  opacity: 0.7;
}

.account-item:hover .account-actions .btn {
  opacity: 1;
}

.reviewer-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* ── 用户管理列表（cover3 .project-item） ── */
.project-item {
  list-style: none !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: #4a3d33;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(224, 215, 200, 0.5);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  animation: fadeSlideIn 0.25s ease both;
  gap: 10px;
}

.project-item:hover {
  background: rgba(241, 224, 203, 0.9);
  border-color: rgba(200, 180, 160, 0.6);
}

.project-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  text-align: left;
}

.user-row-info {
  flex: 1;
  min-width: 0;
}

.project-item-actions {
  display: flex;
  gap: 6px;
  margin-left: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-item-actions .btn {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
  opacity: 0.75;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.project-item:hover .project-item-actions .btn {
  opacity: 1;
}

/* ── 表单（cover3） ── */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field-label {
  font-size: 13px;
  color: #4a3d33;
}

.field-hint {
  font-size: 12px;
  color: #a09586;
  margin-left: 4px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.actions .status-text {
  flex: 1;
  min-width: 120px;
}

.status-text {
  font-size: 12px;
  color: #9a8b79;
  transition: opacity 0.3s ease;
  line-height: 1.5;
}

.status-text.fade-out { opacity: 0; }
.status-text.error { color: #c0392b; }
.status-text.success { color: #2e7d32; }

.modal-hint {
  font-size: 12px;
  color: #a09586;
  margin: 6px 0 0;
  line-height: 1.6;
}

.result-section {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px dashed #e0d7c8;
}

.result-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.result-content {
  font-size: 13px;
  color: var(--color-brown-900);
  min-height: 60px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border);
  background: #fdfbf7;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: #a09586;
  font-size: 14px;
  line-height: 1.6;
}

/* ── 热帖列表（本项目） ── */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.filter-bar #filter-q {
  grid-column: span 3;
}

.filter-bar .btn {
  height: 42px;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 80px;
}

.post-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(224, 215, 200, 0.5);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  animation: fadeSlideIn 0.25s ease both;
}

.post-row:hover {
  background: rgba(241, 224, 203, 0.8);
  border-color: rgba(200, 180, 160, 0.6);
  box-shadow: 0 2px 8px rgba(180, 150, 120, 0.15);
}

.post-row.active {
  background: linear-gradient(135deg, #f7dec0, #f0c9a5);
  border-color: rgba(220, 180, 140, 0.8);
  box-shadow: inset 3px 0 0 #c8956a;
}

.post-row.unavailable {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.post-row.unavailable:hover {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

.post-title {
  font-size: 14px;
  font-weight: 600;
  color: #3f342a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.post-title > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-badges {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.post-meta {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #8b7c69;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.post-meta .dot::before {
  content: "·";
  margin-right: 12px;
  color: #c8b8a4;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.pager-info {
  font-size: 12px;
  color: #8b7c69;
}

/* ── 工作台（submit 的 #wb-*） ── */
.wb-meta {
  font-size: 12px;
  color: #8b7c69;
  line-height: 1.7;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: #faf7f2;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
}

.wb-meta a {
  color: #8e44ad;
}

.wb-meta .warn {
  color: #c0392b;
}

/* ── Quill 编辑器（submit） ── */
.rich-editor-wrap .ql-toolbar.ql-snow {
  border: 1px solid #e0d7cc;
  border-bottom: 1px solid #e0d7cc;
  border-radius: 10px 10px 0 0;
  background: #faf8f5;
  padding: 4px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
}

.rich-editor-wrap .ql-toolbar.ql-snow .ql-formats {
  margin-right: 6px;
  display: flex;
  align-items: center;
}

.rich-editor-wrap .ql-toolbar.ql-snow .ql-formats:last-child {
  margin-right: 0;
}

.rich-editor-wrap .ql-snow.ql-toolbar button,
.rich-editor-wrap .ql-snow .ql-toolbar button {
  width: 26px;
  height: 24px;
  padding: 2px 3px;
  touch-action: manipulation;
}

.rich-editor-wrap .ql-snow .ql-picker.ql-size {
  width: 56px;
}

.rich-editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-label::before,
.rich-editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-item::before {
  content: '默认' !important;
}

.rich-editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="14px"]::before,
.rich-editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14px"]::before {
  content: '小' !important;
}

.rich-editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="20px"]::before,
.rich-editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="20px"]::before {
  content: '大' !important;
}

.rich-editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="24px"]::before,
.rich-editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24px"]::before {
  content: '特大' !important;
}

.rich-editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14px"]::before { font-size: 14px !important; }
.rich-editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-item::before { font-size: 16px !important; }
.rich-editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="20px"]::before { font-size: 20px !important; }
.rich-editor-wrap .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24px"]::before { font-size: 24px !important; }

.rich-editor-wrap .ql-container.ql-snow {
  border: 1px solid #e0d7cc;
  border-radius: 0 0 10px 10px;
  background: #faf8f5;
  min-height: 168px;
  font-size: 16px;
  line-height: 1.5;
  font-family: inherit;
  overflow: hidden;
}

.rich-editor-wrap .ql-editor {
  padding: 0 14px 8px calc(var(--editor-gutter-width) + 8px);
  color: #333;
  min-height: 168px;
  max-height: 60vh;
  line-height: var(--editor-line-height);
  background:
    linear-gradient(90deg,
      transparent 0,
      transparent calc(var(--editor-gutter-width) - 1px),
      var(--editor-margin-line) calc(var(--editor-gutter-width) - 1px),
      var(--editor-margin-line) var(--editor-gutter-width),
      transparent var(--editor-gutter-width)
    ),
    linear-gradient(to bottom,
      var(--editor-rule-line) 0,
      var(--editor-rule-line) 1px,
      transparent 1px,
      transparent var(--editor-line-height)
    ),
    linear-gradient(90deg,
      color-mix(in srgb, var(--editor-margin-band) 88%, transparent) 0,
      color-mix(in srgb, var(--editor-margin-band) 88%, transparent) calc(var(--editor-gutter-width) - 1px),
      transparent calc(var(--editor-gutter-width) - 1px)
    ),
    var(--editor-paper-base);
  background-attachment: local;
  background-size: auto, 100% var(--editor-line-height), auto, auto;
  background-position: 0 0, 0 -1px, 0 0, 0 0;
}

.rich-editor-wrap .ql-editor img {
  max-width: 100%;
  display: block;
  margin: 6px 0;
  border-radius: 4px;
}

.rich-editor-wrap .ql-editor.ql-blank::before {
  color: #b5aa9e;
  font-style: normal;
  left: calc(var(--editor-gutter-width) + 8px);
  right: 14px;
}

.rich-editor-composing .ql-editor.ql-blank::before {
  opacity: 0;
}

.rich-editor-wrap .ql-snow.ql-toolbar button.ql-divider,
.rich-editor-wrap .ql-snow .ql-toolbar button.ql-divider {
  width: auto;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
}

.rich-editor-wrap .ql-snow .ql-stroke { stroke: #6b5546; }
.rich-editor-wrap .ql-snow .ql-fill { fill: #6b5546; }
.rich-editor-wrap .ql-snow .ql-picker { color: #6b5546; }
.rich-editor-wrap .ql-snow .ql-color-picker .ql-picker-options { right: 0; left: auto; }

.rich-editor-wrap .ql-container.ql-snow:focus-within {
  border-color: #c4956e;
  box-shadow: 0 0 0 3px rgba(196, 149, 110, 0.15);
  background: #fff;
}

.rich-editor-disabled .ql-toolbar.ql-snow {
  display: none;
}

.rich-editor-wrap .ql-editor hr {
  border: none;
  margin: 0;
  height: var(--editor-line-height);
  background: linear-gradient(to bottom,
    transparent calc(50% - 0.5px),
    #d5cec5 50%,
    transparent calc(50% + 0.5px)
  );
}

/* ── 排版预览（submit 原样） ── */
#wemd-wrapper.theme-beige {
  --preview-bg: #fdfdf3; --preview-text: #4c453c; --preview-border: #e2e0d3;
  --preview-footer: #bcbbb2; --preview-disclaimer: #c8c3b8; --preview-title: #4c453c;
}
#wemd-wrapper.theme-white {
  --preview-bg: #ffffff; --preview-text: #3c3c3c; --preview-border: #c8c8c8;
  --preview-footer: #787878; --preview-disclaimer: #787878; --preview-title: #282828;
}

#wemd-wrapper {
  background: var(--preview-bg, #fdfdf3);
  padding: 10px;
  border-radius: 8px;
  overflow: hidden;
  max-width: 420px;
  margin: 0 auto;
  border: 1px solid rgba(102, 78, 49, 0.08);
}

#wemd {
  background-color: var(--preview-bg, #fdfdf3);
  color: var(--preview-text, #4c453c);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 18px;
  line-height: 2;
  letter-spacing: 0.544px;
  text-align: justify;
  word-break: break-word;
  padding: 26px 19px;
  border: 1px solid var(--preview-border, #e2e0d3);
  outline: 1px solid var(--preview-border, #e2e0d3);
  outline-offset: 3px;
  box-sizing: border-box;
  box-shadow: 0 0 0 10px var(--preview-bg, #fdfdf3);
  margin: 10px;
}
#wemd p {
  margin: 0 0 12px 0;
  color: var(--preview-text, #4c453c);
  font-size: 18px;
  line-height: 2;
  padding: 0 6px;
  background-color: var(--preview-bg, #fdfdf3);
}
#wemd p:last-child { margin-bottom: 0; }
#wemd .rich-content p:has(> br:only-child) {
  line-height: 0.67;
}
#wemd .rich-content img {
  max-width: 100%;
  display: block;
  margin: 12px auto;
}
#wemd h1, #wemd h2, #wemd h3, #wemd h4, #wemd h5, #wemd h6 {
  margin: 0 0 36px 0;
  padding: 0 6px;
  font-weight: bold;
  color: var(--preview-title, #4c453c);
  background-color: var(--preview-bg, #fdfdf3);
}
#wemd h1 { font-size: 22px; }
#wemd h2 { font-size: 18px; }
#wemd h3 { font-size: 18px; }
#wemd h4 { font-size: 17px; }
#wemd h5, #wemd h6 { font-size: 16px; }
#wemd strong { font-weight: bold; color: var(--preview-text, #4c453c); }
#wemd ul, #wemd ol {
  margin: 12px 0;
  padding-left: 25px;
  color: var(--preview-text, #4c453c);
  background-color: var(--preview-bg, #fdfdf3);
}
#wemd li { margin: 6px 0; background-color: var(--preview-bg, #fdfdf3); }
#wemd blockquote {
  margin: 15px 0;
  padding: 15px;
  border-left: 3px solid var(--preview-border, #e2e0d3);
  background-color: var(--preview-bg, #fdfdf3);
}
#wemd a { color: var(--preview-text, #4c453c); text-decoration: underline; }
#wemd hr {
  margin: 20px 0;
  border: none;
  border-top: 1px solid var(--preview-border, #e2e0d3);
}
#wemd .campus-author-info {
  font-size: 12px;
  color: var(--preview-footer, #bcbbb2);
  letter-spacing: 1px;
  margin: 28px 0 0 0;
  padding: 0 6px;
  line-height: 1;
}
#wemd .campus-author-info p {
  margin: 0 0 5px 0;
  font-size: 12px;
  color: var(--preview-footer, #bcbbb2);
  line-height: 1;
}
#wemd .campus-author-info p:last-child {
  margin-bottom: 0;
}
#wemd .campus-promo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 26px 0 0 0;
  padding: 0;
}
#wemd .campus-promo-text {
  flex: 0 0 auto;
  margin-right: 16px;
  text-align: center;
}
#wemd .campus-promo-text:last-child {
  margin-right: 0;
}
#wemd .campus-promo-text p {
  margin: 0;
  font-size: 25px;
  color: var(--preview-footer, #bcbbb2);
  line-height: 1.6;
  text-align: center;
}
#wemd .campus-promo-qr {
  flex: 0 0 auto;
  width: 30%;
  height: auto;
}
.campus-footer-disclaimer {
  font-size: 12px;
  color: var(--preview-disclaimer, #c8c3b8);
  line-height: 1.8;
  letter-spacing: 1px;
  margin: 12px 0 0 0;
  padding: 0 16px;
  text-align: left;
  background-color: var(--preview-bg, #fdfdf3);
}
.campus-footer-disclaimer p {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: var(--preview-disclaimer, #c8c3b8);
  line-height: 1.8;
  background-color: var(--preview-bg, #fdfdf3);
}
.campus-footer-disclaimer p:last-child { margin-bottom: 0; }
.campus-footer-disclaimer .disclaimer-empty-line {
  margin: 0;
  color: #6b5546;
}
#wemd .rich-content span[style] {
  font-size: inherit !important;
  color: inherit !important;
  background-color: inherit !important;
  font-family: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
}

/* ── 封面预览 ── */
.cover-preview {
  max-width: 420px;
  margin: 14px auto 0;
  text-align: center;
}

.cover-preview img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  display: block;
}

/* ── 推送区（submit .mp-*） ── */
.push-section {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed #e0d7c8;
}

.push-target {
  font-size: 13px;
  color: #5f574c;
  padding: 10px 12px;
  border: 1.5px solid #e0d7c8;
  border-radius: 8px;
  background: #faf7f2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.push-target.none {
  color: #a09586;
}

.push-target .mp-avatar {
  width: 28px;
  height: 28px;
}

.mp-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #5f574c;
  margin-top: 10px;
}

.mp-check input { accent-color: #8e44ad; }
.mp-check:has(input:disabled) { opacity: .5; }

.mp-posts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mp-posts:empty::after {
  content: "还没有推送记录";
  font-size: 12px;
  color: #a09586;
}

.mp-post {
  font-size: 12px;
  color: #8b7c69;
  padding: 8px 10px;
  background: #faf7f2;
  border-radius: 6px;
  line-height: 1.6;
  word-break: break-all;
}

.mp-post a { color: #8e44ad; }
.mp-post .err { color: #c0392b; }
.mp-post .mp-status-published { color: #27ae60; font-weight: 600; }
.mp-post .mp-status-failed { color: #c0392b; font-weight: 600; }
.mp-post .mp-status-publishing { color: #2980b9; }

.mp-post .link-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}

.mp-post .link-row input.text-input {
  height: 32px;
  font-size: 12px;
  padding: 4px 8px;
}

/* ── 动画 / spinner / 骨架（cover3） ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn .spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 248, 240, 0.3);
  border-top-color: #fff8f0;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn.loading .spinner { display: inline-block; }
.btn.loading { pointer-events: none; opacity: 0.75; }

.btn.ghost .spinner {
  border-color: rgba(109, 91, 76, 0.2);
  border-top-color: var(--color-brown-600);
}

@keyframes shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

.account-item.skeleton,
.post-row.skeleton {
  pointer-events: none;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #f0e8dc 25%, #e8ddd0 50%, #f0e8dc 75%);
  background-size: 400px 100%;
  animation: shimmer 1.5s infinite;
  border: 1px solid rgba(224, 215, 200, 0.3);
}

/* ── 弹窗（cover3） ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.visible { opacity: 1; }

.modal-dialog {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius-lg);
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.visible .modal-dialog { transform: scale(1); }

.modal-dialog p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.6;
  white-space: pre-line;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

.app-footer {
  margin-top: 16px;
  padding-bottom: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  color: rgba(143, 123, 103, 0.7);
  text-align: center;
}

.inner-footer {
  margin-top: 20px;
  padding-top: 16px;
  padding-bottom: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  color: #8b7c69;
  text-align: center;
  border-top: 1px dashed #e0d7c8;
}

/* ── 响应式（cover3） ── */
@media (max-width: 900px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .app {
    max-width: 100%;
  }

  .layout-sidebar {
    position: static;
    padding: 14px 14px 16px;
  }

  .layout-main {
    padding: 12px 14px 14px;
  }

  .account-list {
    max-height: 260px;
  }

  .header-wrapper {
    padding: 0 16px;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar #filter-q {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .field-group {
    grid-template-columns: 1fr;
  }

  .post-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .app {
    padding-inline: 6px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .app-footer {
    flex-direction: column;
    gap: 4px;
  }

  .app-header h1 {
    font-size: 17px;
  }

  .app-header h1 .subtitle-part {
    display: none;
  }

  .header-wrapper {
    padding: 0 12px;
    min-height: 48px;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  #wemd-wrapper {
    max-width: none;
  }
}
