/* 社区 community · 独立页面与上传组件
   板块页 / 发帖页 / 上传条 / 帖子资源块 / 回复里的图片 */

/* ---------- 板块页 ---------- */
.cm-board-wrap { padding: 22px 0 46px; }
.cm-board-in { display: block; }

.cm-board-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 18px;
}
.cm-board-hero h1 { font-size: 24px; line-height: 1.3; }
.cm-board-hero p { margin-top: 6px; font-size: 13px; color: var(--cm-text-3); }

.cm-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.cm-board-card {
  display: flex;
  min-width: 0;
  gap: 12px;
  padding: 16px;
  background: var(--cm-card);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.cm-board-card:hover {
  border-color: var(--cm-accent-line);
  box-shadow: var(--cm-shadow-hover);
  transform: translateY(-1px);
}
.cm-board-card.is-on { border-color: var(--cm-accent); }
.cm-board-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--cm-accent-soft);
  color: var(--cm-accent);
  font-size: 18px;
  font-weight: 600;
}
.cm-board-body { min-width: 0; }
.cm-board-body b {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  color: var(--cm-text);
}
.cm-board-body b em {
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
  color: var(--cm-text-3);
}
.cm-board-body p {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--cm-text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cm-board-last {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--cm-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 最新帖子列表 */
.cm-latest {
  background: var(--cm-card);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
  padding: 6px 18px 8px;
}
.cm-latest-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--cm-line);
}
.cm-latest-head h2 { font-size: 16px; }
.cm-latest-head span { font-size: 12px; color: var(--cm-text-3); }
.cm-latest-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--cm-line);
}
.cm-latest-list li:last-child { border-bottom: 0; }
.cm-latest-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cm-latest-cat {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  line-height: 1.7;
  background: var(--cm-accent-soft);
  color: var(--cm-accent);
}
.cm-latest-title {
  font-size: 14px;
  color: var(--cm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cm-latest-title:hover { color: var(--cm-accent); }
.cm-latest-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--cm-text-3);
}
.cm-latest-meta a { color: var(--cm-text-2); }

/* ---------- 发帖页 ---------- */
.cm-pub-wrap { padding: 22px 0 46px; }
.cm-pub { max-width: 860px; }

.cm-pub-head { margin: 10px 0 16px; }
.cm-pub-head h1 { font-size: 24px; }
.cm-pub-head p { margin-top: 6px; font-size: 13px; color: var(--cm-text-3); }

.cm-pub-err {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid #ffd8d8;
  border-radius: var(--cm-radius);
  background: #fff5f5;
  font-size: 13px;
  color: #c62828;
}
.cm-pub-err b { flex: 0 0 auto; }

.cm-pub-form {
  padding: 20px 22px 18px;
  background: var(--cm-card);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
}

.cm-field { display: block; margin-bottom: 16px; }
.cm-field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cm-text);
}
.cm-field-label i {
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: var(--cm-text-3);
}
.cm-field-label .cm-up-btn { margin-left: auto; }

.cm-input, .cm-select {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--cm-line);
  border-radius: 8px;
  font-size: 14px;
  color: var(--cm-text);
  outline: none;
  transition: border-color .16s, box-shadow .16s;
  -webkit-appearance: none;
  appearance: none;
}
.cm-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b9bb4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.cm-input:focus, .cm-select:focus, .cm-textarea:focus {
  border-color: var(--cm-accent);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}
.cm-input-lg { height: 42px; font-size: 15px; }
.cm-pub-content { min-height: 240px; padding: 12px; line-height: 1.75; resize: vertical; }

.cm-pub-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cm-pub-row .cm-field { margin-bottom: 16px; }

/* 资源区 */
.cm-res-box {
  margin: 4px 0 18px;
  padding: 14px;
  border: 1px dashed var(--cm-accent-line);
  border-radius: var(--cm-radius);
  background: #fafcff;
}
.cm-res-head { margin-bottom: 12px; }
.cm-res-head b { font-size: 13px; }
.cm-res-head span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.6; color: var(--cm-text-3); }
.cm-field-plain { margin-bottom: 0; }

/* 上传条 */
.cm-up-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cm-up-tip { font-style: normal; font-size: 12px; color: var(--cm-text-3); }
.cm-up-list { margin-top: 10px; }
.cm-up-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--cm-line);
  border-radius: 8px;
  font-size: 13px;
}
.cm-up-list li.is-loading { color: var(--cm-text-3); }
.cm-up-list li.is-error { border-color: #ffd8d8; background: #fff5f5; color: #c62828; }
.cm-up-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-up-size { flex: 0 0 auto; font-size: 12px; color: var(--cm-text-3); }
.cm-up-del {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cm-text-3);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.cm-up-del:hover { background: #f2f5fa; color: #c62828; }

/* 小按钮（回复框里的图片 / 表情同款） */
.cm-up-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--cm-line);
  border-radius: 7px;
  background: #fff;
  font-size: 12.5px;
  color: var(--cm-text-2);
  cursor: pointer;
}
.cm-up-btn:hover { border-color: var(--cm-accent-line); color: var(--cm-accent); }

.cm-pub-act {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.cm-btn-lg { height: 42px; padding: 0 28px; font-size: 15px; }
.cm-pub-note { font-size: 12px; color: var(--cm-text-3); }

/* 结果页 */
.cm-pub-done {
  margin-top: 24px;
  padding: 40px 24px;
  text-align: center;
  background: var(--cm-card);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-radius);
}
.cm-pub-done-ico {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--cm-accent-soft);
  color: var(--cm-accent);
  font-size: 24px;
  font-weight: 700;
}
.cm-pub-done h1 { font-size: 20px; }
.cm-pub-done p { margin: 8px auto 0; max-width: 460px; font-size: 13px; color: var(--cm-text-2); }
.cm-pub-done-act { display: flex; justify-content: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- 帖子资源块 ---------- */
.cm-attach {
  margin: 22px 0 6px;
  padding: 14px 16px;
  background: #fafcff;
  border: 1px solid var(--cm-accent-line);
  border-radius: var(--cm-radius);
}
.cm-attach-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.cm-attach-head b { font-size: 14px; }
.cm-attach-head span { font-size: 12px; color: var(--cm-text-3); }
.cm-attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--cm-line);
  font-size: 13px;
  color: var(--cm-text);
}
.cm-attach-list li + li { margin-top: 8px; }
.cm-attach-item:hover { border-color: var(--cm-accent); color: var(--cm-accent); }
.cm-attach-ext {
  flex: 0 0 auto;
  min-width: 38px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--cm-accent-soft);
  font-style: normal;
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
  color: var(--cm-accent);
  text-transform: uppercase;
}
.cm-attach-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-attach-size { flex: 0 0 auto; font-size: 12px; color: var(--cm-text-3); }
.cm-attach-act { flex: 0 0 auto; font-style: normal; font-size: 12.5px; color: var(--cm-accent); }

/* ---------- 回复里的图片 ---------- */
.cm-floor-content img.cm-cmt-img {
  display: block;
  max-width: 260px;
  max-height: 260px;
  margin: 6px 0 2px;
  border-radius: 8px;
  border: 1px solid var(--cm-line);
}

/* ---------- 窄屏 ---------- */
@media (max-width: 768px) {
  .cm-board-wrap, .cm-pub-wrap { padding: 14px 0 28px; }
  .cm-board-hero { align-items: center; }
  .cm-board-hero h1 { font-size: 19px; }
  .cm-board-hero p { font-size: 12px; }
  .cm-board-grid { grid-template-columns: 1fr; gap: 10px; }
  .cm-latest { padding: 4px 14px 6px; }
  .cm-latest-list li { flex-direction: column; align-items: flex-start; gap: 6px; }
  .cm-latest-top { width: 100%; }
  .cm-latest-title { white-space: normal; line-height: 1.5; }
  .cm-latest-meta { gap: 10px; font-size: 11.5px; }
  .cm-pub-form { padding: 16px 14px 14px; }
  .cm-pub-head h1 { font-size: 19px; }
  .cm-pub-row { grid-template-columns: 1fr; gap: 0; }
  .cm-pub-content { min-height: 200px; }
  .cm-pub-act .cm-pub-note { width: 100%; }
  .cm-attach { padding: 12px; }
  .cm-attach-item { flex-wrap: wrap; }
}
