/* ============================================================
   DaiWAF 企业站 · 发帖页
   结构：渐变页头 → 两栏布局（主表单 + 侧栏三卡） → 板块卡片 / 类型分段 / Bug 结构化字段
   富文本编辑器样式见 post.css（rte 公共组件）
   ============================================================ */

/* ---------------- 渐变页头 ---------------- */
.page-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 34px 0; }
.page-head h1 { font-size: 26px; font-weight: 800; }
.page-head .ph-sub { font-size: 13px; color: var(--text-sub); margin-top: 6px; }
.page-head--sub { padding-top: 108px; }
.breadcrumb { font-size: 13px; color: var(--text-light); }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 6px; }
.pub-head { background: linear-gradient(135deg, #F4F8FF 0%, #EDF3FF 55%, #E8FBFF 100%); border-bottom: 1px solid var(--line); }
.pub-head-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.pub-head-sub { margin-top: 10px; font-size: 13.5px; color: var(--text-sub); }
.pub-head-ico svg { width: 84px; height: 84px; display: block; opacity: .95; }

/* ---------------- 两栏布局 ---------------- */
.pub-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.pub-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; margin-bottom: 24px; }
.pub-card h2 { font-size: 18px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pub-main .pub-card:last-child { margin-bottom: 0; }
.pub-side .pub-card { padding: 20px; margin-bottom: 24px; }
.pub-side .pub-card:last-child { margin-bottom: 0; }

/* 侧栏三卡 */
.side-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.side-title svg { width: 17px; height: 17px; color: var(--primary); flex: none; }
.side-list { list-style: none; }
.side-list li { position: relative; padding-left: 24px; font-size: 13px; color: var(--text-sub); line-height: 1.55; margin-bottom: 9px; }
.side-list li:last-child { margin-bottom: 0; }
.side-list li svg { position: absolute; left: 0; top: 2.5px; width: 14px; height: 14px; color: #10B981; }
.ask-list { list-style: none; counter-reset: ask; }
.ask-list li { counter-increment: ask; position: relative; padding-left: 30px; font-size: 13px; color: var(--text-sub); line-height: 1.55; margin-bottom: 10px; }
.ask-list li:last-child { margin-bottom: 0; }
.ask-list li::before { content: counter(ask); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 6px; background: #EAF1FF; color: var(--primary); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.side-pro { background: linear-gradient(135deg, #16223F 0%, #1E3A8A 100%); border: none; }
.side-pro .side-title { color: #fff; }
.side-pro .side-title svg { color: #FBBF24; }
.side-pro p { font-size: 13px; color: rgba(255, 255, 255, .72); line-height: 1.7; margin-bottom: 14px; }
.side-pro .btn { width: 100%; }

/* ---------------- 表单字段 ---------------- */
.pub-field { margin-bottom: 16px; }
.pub-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.pub-field label em { color: #B91C1C; font-style: normal; margin-left: 2px; }
.pub-field select,
.pub-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fff;
  font-family: inherit;
}
.pub-field select:focus,
.pub-field input:focus { border-color: var(--primary); }
.field-count { float: right; font-size: 12px; font-weight: 400; color: var(--text-light); }

/* 板块卡片单选（icon 由 icons.js 按 board.icon 渲染，禁写死） */
.board-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.board-pick button { border: 1px solid var(--line); background: #F8FAFD; border-radius: 10px; padding: 13px 8px; font-size: 13px; color: var(--text-sub); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 7px; transition: all .15s ease; }
.board-pick button .bp-ico { display: inline-flex; color: var(--text-light); transition: all .15s ease; }
.board-pick button:hover { border-color: var(--primary); color: var(--text); }
.board-pick button.on { border-color: var(--primary); background: #EEF4FF; color: var(--primary); font-weight: 600; box-shadow: 0 0 0 3px rgba(43, 107, 255, .1); }
.board-pick button.on .bp-ico { color: var(--primary); }

/* 类型分段 */
.type-seg { display: flex; gap: 8px; }
.type-seg button {
  flex: 1;
  padding: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--text-sub);
}
.type-seg button .ico { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -3px; margin-right: 4px; }
.type-seg button.on { border-color: var(--primary); color: var(--primary); background: #F0F5FF; font-weight: 600; }

/* Bug 帖强制结构化字段（extra_fields） */
.extra-fields { display: none; margin: 16px 0; padding: 16px; background: #FFF9EC; border: 1px solid #F1E3BC; border-radius: 10px; }
.extra-fields.show { display: block; }
.extra-fields h4 { font-size: 13px; color: #8A6D1F; margin-bottom: 12px; }
.extra-fields h4 .ico { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; color: #8A6D1F; }
.extra-fields .pub-field { margin-bottom: 12px; }
.extra-fields .pub-field:last-child { margin-bottom: 0; }
.extra-fields textarea,
.extra-fields input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #E4D5A1;
  border-radius: 8px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  resize: vertical;
}

/* 提交行 */
.pub-foot { display: flex; align-items: center; gap: 14px; justify-content: flex-end; margin-top: 4px; }
.pub-foot .tip { font-size: 12.5px; color: var(--text-light); margin-right: auto; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .page-head--sub { padding-top: 92px; }
  .pub-layout { grid-template-columns: 1fr; }
  .pub-head-ico { display: none; }
}
@media (max-width: 640px) {
  .page-head--sub { padding-top: 84px; }
  .page-head h1 { font-size: 22px; }
  .board-pick { grid-template-columns: repeat(2, 1fr); }
  .pub-card { padding: 20px 16px; }
  .pub-foot { flex-wrap: wrap; }
  .pub-foot .tip { width: 100%; margin-right: 0; order: 9; }
  .pub-foot .btn { flex: 1; justify-content: center; }
  /* 单列后侧栏卡片落到页面前，最后一张卡补回下边距，避免贴住页脚 */
  .pub-side .pub-card:last-child { margin-bottom: 24px; }
}
