/* ---------- 板块 banner ---------- */
.board-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(120deg, var(--purple-soft), #fff);
  border: 1px solid var(--purple-border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 18px;
}
.board-hero.accent-fun { background: linear-gradient(120deg, var(--gold-soft), #fff); border-color: #efe3c2; }
.board-hero-icon { font-size: 34px; }
.board-title { font-size: 22px; font-weight: 800; }
.board-desc { color: var(--sub); font-size: 14px; }

/* 学习讨论分区（无背景无边框，竖分割线；选中为浅紫方框） */
.board-sections { display: flex; align-items: center; flex-wrap: wrap; row-gap: 4px; margin: 0 0 16px; }
.board-sec { display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 14px; border-radius: 8px; font-size: 15px; font-weight: 700; color: var(--text); transition: background 0.15s, color 0.15s; flex: none; white-space: nowrap; }
.board-sec:hover { color: var(--purple-dark); }
.board-sec.on { background: var(--purple-soft); color: var(--purple-dark); }
.board-sec-div { width: 1px; height: 18px; background: var(--border); margin: 0 12px; flex-shrink: 0; }
.board-sec-num { font-size: 13px; font-weight: 500; color: var(--sub); }
.board-sec.on .board-sec-num { color: var(--purple-dark); }
html[data-theme="dark"] .board-sec.on { background: #2a2340; color: #c9b6ff; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 10px; }
.field-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.field-hint { font-weight: 400; color: var(--sub); font-size: 12.5px; margin-left: 6px; }
.field input[type="text"], .field input[type="password"], .field select, .field textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 14.5px;
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-soft);
}
.field textarea { resize: vertical; line-height: 1.6; }
.pw-wrap { position: relative; }
.field .pw-wrap input { padding-right: 42px; }
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear { display: none; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.pw-toggle:hover { color: var(--purple); background: var(--purple-soft); }
.pw-wrap.is-shown .pw-toggle { color: var(--purple); }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--sub);
  cursor: pointer;
}
.check-label input { accent-color: var(--purple); width: 15px; height: 15px; cursor: pointer; }
.anon-check { display: flex; margin: 8px 0 10px; font-size: 13px; }
.form-note { color: var(--sub); font-size: 12.5px; margin: 8px 0 12px; line-height: 1.6; }
.login-tip { text-align: center; color: var(--sub); margin: 18px 0; }

/* ---------- 帖子列表 ---------- */
.post-item { transition: box-shadow 0.18s; padding-bottom: 14px; }
.post-item:hover { box-shadow: var(--shadow-hover); }
.post-item-main { display: block; color: var(--text); }
.post-item-title { font-size: 16.5px; font-weight: 700; margin-bottom: 4px; }
.post-item-excerpt { color: var(--sub); font-size: 13.5px; }
.post-item-meta {
  display: flex;
  align-items: center;
  gap: 4px 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--sub);
  font-size: 12.5px;
}
.post-author { color: var(--purple); font-weight: 600; }
.real-tag { font-size: 11.5px; color: var(--gold-dark); background: var(--gold-soft); padding: 1px 7px; border-radius: 6px; }
.op-tag { font-size: 11px; font-weight: 700; color: var(--gold-dark); background: var(--gold-soft); border: 1px solid #ecdca6; padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
.post-anon-hint { font-size: 12.5px; color: var(--sub); margin-left: 10px; }
.post-item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.post-new-row { margin: 14px 0 18px; }
.post-item-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.post-item-main { flex: 1; min-width: 0; }
.post-item-actions { display: flex; gap: 6px; flex: none; }
.post-item-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.post-foot-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-kind { color: var(--sub); font-size: 12.5px; }
.post-stats { display: flex; align-items: center; gap: 8px; }
.post-stats .stat-chip { text-decoration: none; }

/* ---------- 发帖编辑器 ---------- */
.pe-modes { display: flex; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.pe-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  background: var(--purple-soft);
  border: 1.5px solid var(--purple-border);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}
.pe-seg {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 7px 22px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--purple-dark);
  transition: color 0.2s;
  white-space: nowrap;
}
.pe-seg.on { color: #fff; }
.pe-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: var(--purple);
  transition: transform 0.2s;
}
.pe-switch.extended .pe-thumb { transform: translateX(100%); }
.pe-mode-hint { font-size: 12px; color: var(--sub); }
.pe-toolbar { border-radius: 10px 10px 0 0; }
.pe-content {
  width: 100%;
  min-height: 260px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.7;
  background: #fff;
  color: var(--text);
  resize: vertical;
  outline: none;
}
.pe-content:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.pe-preview {
  min-height: 260px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}
.pe-tags-field { margin-top: 12px; }
.pe-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.pe-actions .pe-submit { margin-left: auto; }
html[data-theme="dark"] .pe-content,
html[data-theme="dark"] .pe-preview { background: #221c33; }

/* ---------- 帖子详情 ---------- */
.back-link { display: inline-block; color: var(--sub); font-size: 14px; margin-bottom: 14px; }
.back-link:hover { color: var(--purple); }
.post-detail-head { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 6px; }
.post-detail-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; line-height: 1.4; }
.post-detail-meta {
  display: flex;
  align-items: center;
  gap: 4px 14px;
  flex-wrap: wrap;
  color: var(--sub);
  font-size: 13px;
}

/* ---------- Markdown 正文 ---------- */
.markdown-body { font-size: 15px; word-break: break-word; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  margin: 1.1em 0 0.5em;
  font-weight: 700;
  line-height: 1.4;
}
.markdown-body h1 { font-size: 1.5em; }
.markdown-body h2 { font-size: 1.3em; }
.markdown-body h3 { font-size: 1.15em; }
.markdown-body h4 { font-size: 1em; }
.markdown-body p { margin: 0.55em 0; }
.markdown-body ul, .markdown-body ol { margin: 0.55em 0; padding-left: 1.6em; }
.markdown-body li { margin: 0.2em 0; }
.markdown-body a { text-decoration: underline; }
.markdown-body blockquote {
  margin: 0.7em 0;
  padding: 6px 14px;
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 8px 8px 0;
  color: #7a6a3a;
}
.markdown-body img { max-width: 100%; border-radius: 10px; }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
.markdown-body code {
  background: var(--purple-soft);
  color: var(--purple-dark);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.88em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.markdown-body pre {
  background: #2b2440;
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0.8em 0;
  line-height: 1.55;
}
.markdown-body pre code {
  background: none;
  color: #e6e1f2;
  padding: 0;
  font-size: 13px;
}
.markdown-body table { border-collapse: collapse; margin: 0.8em 0; width: 100%; font-size: 14px; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 7px 12px; text-align: left; }
.markdown-body th { background: var(--purple-soft); }

.hljs-keyword, .hljs-selector-tag, .hljs-literal { color: #c792ea; }
.hljs-string, .hljs-attr, .hljs-template-tag { color: #e6c07b; }
.hljs-comment, .hljs-quote { color: #7a7294; font-style: italic; }
.hljs-number, .hljs-symbol { color: #f78c6c; }
.hljs-title, .hljs-function .hljs-title, .hljs-section { color: #82aaff; }
.hljs-built_in, .hljs-type { color: #ffcb6b; }
.hljs-variable, .hljs-params { color: #e6e1f2; }
.hljs-meta { color: #89ddff; }

/* ---------- 回复区 ---------- */
.reply-list { display: flex; flex-direction: column; gap: 12px; }
.reply-item { display: flex; gap: 12px; }
.reply-item.depth-2 { margin-left: 40px; }
.reply-item.depth-3 { margin-left: 80px; }
.reply-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), #b39ef0);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}
.reply-main {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}
.reply-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reply-author { font-weight: 700; font-size: 14px; color: var(--purple-dark); }
.reply-to { font-size: 12.5px; color: var(--sub); }
.reply-time { font-size: 12px; color: var(--sub); margin-left: auto; }
.reply-content { font-size: 14.5px; margin-top: 6px; }
.reply-actions { margin-top: 8px; display: flex; gap: 4px; }
.reply-form-card .field { margin-bottom: 10px; }
.reply-to-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: 13px;
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 10px;
}
.chip-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--purple-dark);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
}

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--sub); }
.empty.small { padding: 24px 10px; }
.empty-icon { font-size: 42px; margin-bottom: 8px; }
.empty h1 { color: var(--text); margin-bottom: 6px; }
.empty p { margin-bottom: 14px; }

/* ---------- 分页 ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 22px 0 4px; }
.pager-note { color: var(--sub); font-size: 13.5px; }

/* ---------- 通用页头 ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.page-title { font-size: 24px; font-weight: 800; }
.page-sub { color: var(--sub); font-size: 13.5px; margin-bottom: 16px; }

/* ---------- 私信 ---------- */
.msg-item {
  display: flex;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
  align-items: flex-start;
}
.msg-unread { border-color: var(--purple); background: var(--purple-soft); }
.msg-main { flex: 1; }
.msg-head { display: flex; align-items: center; gap: 10px; }
.msg-from { font-weight: 700; font-size: 14px; }
.msg-time { color: var(--sub); font-size: 12px; margin-left: auto; }
.msg-content { font-size: 14px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.msg-del { flex-shrink: 0; }
.del-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.del-item { position: relative; padding-right: 46px; min-height: 70px; }
.del-remove { position: absolute; top: 10px; right: 10px; margin: 0; }
.del-remove button { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid #f3c9c9; background: #fdecec; color: #c0392b; font-size: 16px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.del-remove button:hover { background: #f6cfcf; }
.del-restore { position: absolute; bottom: 10px; right: 10px; margin: 0; }

/* ---------- 登录/注册 ---------- */
.auth-card { max-width: 420px; margin: 16px auto; padding: 24px; }
.auth-title { font-size: 24px; font-weight: 800; text-align: center; }
.auth-sub { text-align: center; color: var(--sub); margin: 2px 0 16px; }
.auth-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; color: var(--sub); font-size: 13.5px; margin-top: 16px; }
.auth-left { display: inline-flex; align-items: baseline; gap: 4px; }
.auth-foot-text { color: var(--sub); }

/* ---------- 管理页 ---------- */
.admin-form { max-width: 420px; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--sub); font-weight: 600; font-size: 12.5px; }
.role-badge {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f1eff5;
  color: var(--sub);
}
.role-badge.role-owner { background: var(--gold-soft); color: var(--gold-dark); }
.role-badge.role-admin { background: var(--purple-soft); color: var(--purple-dark); }
.role-badge.role-mentor { background: #fdeaf4; color: #c24a86; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.stat-box { background: var(--purple-soft); border-radius: 12px; padding: 14px 8px; text-align: center; }
.stat-num { display: block; font-size: 22px; font-weight: 800; color: var(--purple-dark); }
.stat-label { font-size: 12px; color: var(--sub); }
.upload-progress { margin: 12px 0; }
.up-bar { height: 8px; background: var(--purple-soft); border-radius: 999px; overflow: hidden; }
.up-fill { height: 100%; width: 0; background: var(--purple); transition: width 0.15s; }
.up-text { font-size: 12px; color: var(--sub); text-align: center; margin-top: 4px; }
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--purple-soft); color: var(--purple-dark); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; flex: none; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-sub { color: var(--sub); font-size: 13px; }
.profile-activity { text-align: center; }
.profile-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--border); color: var(--text); }
.profile-item:last-child { border-bottom: none; }
.profile-item-title { font-weight: 600; word-break: break-all; }
.profile-item-meta { color: var(--sub); font-size: 12.5px; flex: none; }
.profile-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-topbar .back-link { margin-bottom: 14px; }
.user-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); transition: all 0.15s; }
.user-row:hover { border-color: var(--purple); background: var(--purple-soft); }
.user-row-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--purple-soft); color: var(--purple-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.user-row:hover .user-row-avatar { background: #fff; }
.user-row-name { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.user-row-meta { margin-left: auto; color: var(--sub); font-size: 12.5px; flex: none; }
.admin-actions { display: flex; gap: 6px; align-items: center; }
.admin-actions form { margin: 0; }
.login-ua { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sub); font-size: 12px; }

