/* ===== Discourse-style skin — layered over forum.css + modern.css ===== */

:root { --bg: #f5f7f9; }
[data-theme="dark"] { --bg: #0b1117; }

/* ---------- Topic list as a Discourse-style table ---------- */
.topic-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 64px 64px 96px;
  gap: 14px;
  align-items: center;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.topic-list-head .h-num { text-align: center; }
.topic-list-head .h-last { text-align: right; }

.topic-list.card .topic-row,
.board-section .topic-row {
  grid-template-columns: minmax(0, 1fr) 44px 64px 64px 96px;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
}

.topic-avatar { display: flex; justify-content: center; }
.topic-row .col-num { text-align: center; }
.topic-row .col-num b { display: inline; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.topic-row .col-last { text-align: right; font-size: 13px; color: var(--ink-3); }

.topic-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 5px; }
.topic-meta .by { color: var(--ink-3); font-size: 12.5px; }
.topic-meta .by a { color: var(--ink-2); font-weight: 600; }

/* Category badge — Discourse colored-square label */
a.cat-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 3px 9px; border-radius: 4px;
  background: var(--surface-3);
  color: var(--ink-2) !important;
  border: 1px solid var(--border);
}
a.cat-badge::before {
  content: ""; width: 9px; height: 9px; border-radius: 2px;
  background: var(--cat, var(--brand));
}
a.cat-badge:hover { text-decoration: none; border-color: var(--border-strong); }

/* ---------- Tabs: Discourse underline nav ---------- */
.tabs {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0;
  gap: 2px;
}
.tab { border-radius: 0; padding: 10px 16px; border-bottom: 2px solid transparent; }
.tab:hover { background: var(--surface-2); }
.tab.active {
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  border-bottom-color: var(--brand);
}

/* ---------- Responsive (collapse like Discourse) ---------- */
@media (max-width: 860px) {
  .topic-list-head { display: none; }
  .topic-list.card .topic-row,
  .board-section .topic-row { grid-template-columns: minmax(0, 1fr) auto; }
  .topic-row .topic-avatar,
  .topic-row .col-num.views,
  .topic-row .col-last { display: none; }
}

/* ---------- Account dropdown (declutters the header) ---------- */
.user-wrap { position: relative; display: inline-flex; }
.user-btn {
  display: inline-grid; place-items: center;
  padding: 0; border: 0; background: none; cursor: pointer; line-height: 0;
}
.user-btn .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .22); }
.user-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 214px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
}
.user-menu.open { display: block; }
.user-menu a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 8px;
  color: var(--ink-2) !important; font-weight: 600; font-size: 14px;
}
.user-menu a:hover { background: var(--surface-2); text-decoration: none; }
.user-menu .um-head {
  border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0;
  margin-bottom: 4px; padding: 9px 11px 11px;
}
.user-menu .um-head span { display: flex; flex-direction: column; line-height: 1.3; color: var(--ink); }
.user-menu .um-head small { color: var(--ink-3); font-weight: 500; font-size: 12px; }
.nav-new { white-space: nowrap; }
@media (max-width: 600px) { .nav-new { display: none; } }
