/* ============================================================
   bbs.aropla.com 公告板专属样式
   复用主站 theme.css 变量与 site.css 布局（.docs-layout / .doc-*）
   ============================================================ */

.bbs-layout { grid-template-columns: 280px 1fr; }

/* ---------- 侧栏：搜索 / 标签 / 索引 ---------- */

.bbs-sidebar h4 { display: flex; align-items: center; gap: 6px; }
.bbs-sidebar h4 + .bbs-tags { margin-bottom: 20px; }
.bbs-count { letter-spacing: 0; text-transform: none; font-weight: 400; opacity: .75; }

.bbs-search { position: relative; margin-bottom: 20px; }
.bbs-search input {
  width: 100%;
  padding: 9px 30px 9px 12px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  -webkit-appearance: none;
  appearance: none;
}
.bbs-search input::placeholder { color: var(--text-muted); opacity: .8; }
.bbs-search input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.bbs-search input::-webkit-search-cancel-button { display: none; }
.bbs-search button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.bbs-search button:hover { background: var(--surface-2); color: var(--text); }

.bbs-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.bbs-chip {
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  padding: 6px 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}
.bbs-chip:hover { color: var(--text); border-color: var(--accent); }
.bbs-chip.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
  font-weight: 600;
}

/* 侧栏索引里的地址过长时省略 */
.bbs-sidebar #bbsIndex a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 列表视图 ---------- */

.bbs-list-head { margin: 4px 0 22px; }
.bbs-list-head h1 {
  margin: 0 0 6px;
  font-size: 1.9rem;
  letter-spacing: -0.01em;
}
.bbs-sub { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

.bbs-list { display: flex; flex-direction: column; gap: 14px; }
.bbs-empty { padding: 4px 2px; }

.bbs-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px 18px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  outline: none;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.bbs-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity .22s ease;
}
.bbs-card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (hover: hover) and (pointer: fine) {
  .bbs-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--accent);
  }
  .bbs-card:hover::before { opacity: 1; }
}

.bbs-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}
.bbs-card-head h3 {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.4;
  min-width: 0;
}
.bbs-pin {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 9px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
}
.bbs-date { flex: none; color: var(--text-muted); font-size: 0.85rem; }
.bbs-summary {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.72;
}
.bbs-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.bbs-tagrow { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.bbs-tag {
  font-size: 0.76rem;
  line-height: 1;
  padding: 5px 10px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none !important;
  transition: color .16s, border-color .16s, background .16s;
}
.bbs-tag:hover { color: var(--accent); border-color: var(--accent); }
.bbs-more { flex: none; color: var(--accent); font-size: 0.88rem; font-weight: 600; }

/* ---------- 详情视图 ---------- */

.bbs-post { max-width: 820px; }
.bbs-back {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none !important;
  transition: color .16s, transform .16s;
}
.bbs-back:hover { color: var(--accent); transform: translateX(-2px); }

.bbs-head {
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.bbs-head h1 { margin: 0 0 12px; }
.bbs-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.86rem;
}
.bbs-meta .bbs-tag { font-size: 0.74rem; }

.bbs-body { animation: none; }
.bbs-body.bbs-in { animation: bbs-fade-in .32s ease both; }
@keyframes bbs-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bbs-body.bbs-in { animation: none; }
  .bbs-card { transition: none; }
}

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
  .bbs-layout { grid-template-columns: 1fr; }
  /* 侧栏索引在窄屏恢复纵向列表并限高，避免长列表撑满屏幕 */
  .bbs-sidebar #bbsIndex ul,
  .bbs-sidebar ul {
    display: block;
    flex-wrap: nowrap;
    max-height: 30vh;
    overflow-y: auto;
    margin-bottom: 4px;
  }
  .bbs-tags { margin-bottom: 16px; }
  .bbs-list-head h1 { font-size: 1.6rem; }
}

@media (max-width: 520px) {
  .bbs-card { padding: 18px 18px 16px; }
  .bbs-card-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .bbs-card-head h3 { font-size: 1.1rem; }
  .bbs-summary { font-size: 0.92rem; }
  .bbs-card-foot { justify-content: flex-start; }
  .bbs-more { display: none; }
  .bbs-post { padding: 22px 18px; }
}
