/* Trạm Kết Nối Tri Thức – bố cục theo diễn đàn mẫu (tve-4u.org / XenForo), màu và phông của Cây Tri Thức FTEL 30 */
.forum-page { --panel: rgba(13, 28, 58, 0.78); --panel2: rgba(255, 255, 255, 0.035); --bar: linear-gradient(90deg, #0b6fd0, #1aa3e8); --row-line: rgba(147, 164, 200, 0.14); }
.forum-page a { color: var(--sky); text-decoration: none; }
.forum-page a:hover { text-decoration: underline; }
.forum-page .brand { color: inherit; text-decoration: none; }
.forum-page .brand:hover { text-decoration: none; }
.forum-page .btn-write, .forum-page a.btn-tree, .forum-page a.btn-ghost { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.forum-page a.btn-tree, html.light .forum-page a.btn-tree { color: #fff; } /* nút cam: chữ trắng, không lấy màu liên kết */
.forum-page a.btn-ghost, .forum-page a.btn-write { color: var(--text); }
html.light .forum-page a.btn-ghost, html.light .forum-page a.btn-write { color: #0f1b33; }
.muted { color: var(--muted); }
.hl { color: var(--orange); font-weight: 600; }

.fm { max-width: 1280px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; margin: 4px 0 14px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }
.crumbs i { color: var(--muted); font-style: normal; }
.crumbs span { color: var(--text); font-weight: 600; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs:empty { display: none; }
.fm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.fm-loading, .empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty-row { padding: 18px 16px; color: var(--muted); font-size: 14px; }

/* Khối / bảng như diễn đàn mẫu: thanh tiêu đề màu, viền mảnh */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 18px; }
.panel-h { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--bar); color: #fff; font-weight: 700; font-size: 14px; letter-spacing: 0.3px; text-transform: uppercase; }
.panel-more { margin-left: auto; color: #fff !important; font-size: 12px; text-transform: none; font-weight: 600; opacity: 0.9; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.box-h { margin: 0 0 10px; font-size: 15px; color: var(--sky); font-weight: 700; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 600; }
.mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 14px; }
.rules ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }

.btn-ghost { font: inherit; font-weight: 600; font-size: 14px; color: var(--text); cursor: pointer; border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; background: transparent; white-space: nowrap; }
.btn-ghost:hover { border-color: var(--orange); }
.btn-sm { font: inherit; font-size: 13px; font-weight: 700; color: #fff; cursor: pointer; border: 0; border-radius: 999px; padding: 6px 14px; background: linear-gradient(135deg, var(--blue), #1aa3e8); white-space: nowrap; }
.btn-sm:disabled, .btn-tree:disabled { opacity: 0.6; cursor: wait; }
.link-btn { font: inherit; font-size: 13px; background: none; border: 0; padding: 0; color: var(--sky); cursor: pointer; }
.link-btn.danger { color: #ff8a65; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(243, 112, 33, 0.18); color: #ffb37d; vertical-align: middle; }
.pill.ok { background: rgba(69, 182, 73, 0.18); color: #9be29e; }
.pill.warn { background: rgba(255, 193, 7, 0.16); color: #ffd666; }
.note-bar { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }

/* Ảnh đại diện chữ cái */
.av { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-weight: 800; font-size: 14px; color: #fff; letter-spacing: 0.5px; }
.av.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 10.5px; }
.av.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 22px; }
.av0 { background: linear-gradient(135deg, #f37021, #ff9a4d); } .av1 { background: linear-gradient(135deg, #0b6fd0, #4fc3ff); }
.av2 { background: linear-gradient(135deg, #45b649, #8fd14f); } .av3 { background: linear-gradient(135deg, #7c4dff, #b388ff); }
.av4 { background: linear-gradient(135deg, #e91e63, #ff6f91); } .av5 { background: linear-gradient(135deg, #00897b, #4db6ac); }

/* Nhãn chủ đề (như "Sách scan", "Kinh điển" ở diễn đàn mẫu) */
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 6px; white-space: nowrap; vertical-align: 1px; color: #fff; }
.tag.t1 { background: #f37021; } .tag.t2 { background: #0b6fd0; } .tag.t3 { background: #2e9d43; } .tag.t4 { background: #8e44ad; } .tag.t5 { background: #00838f; }

/* Mở đầu */
.fm-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 6px 0 18px; }
.fm-hero h1 { margin: 0 0 6px; font-size: clamp(26px, 3.6vw, 38px); line-height: 1.15; font-weight: 800; }
.fm-hero .lead { margin: 0; color: var(--muted); max-width: 60ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-h h1 { margin: 0 0 6px; font-size: clamp(22px, 3vw, 30px); }

/* Thống kê diễn đàn: cột thành viên + cột bài viết có thẻ */
.stats-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 0; }
.col-members .tab { padding: 7px 8px; font-size: 12.5px; }
.col-members { border-right: 1px solid var(--row-line); }
.tabs { display: flex; gap: 4px; padding: 10px 10px 0; border-bottom: 1px solid var(--row-line); overflow-x: auto; }
.tab { font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: transparent; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; padding: 7px 10px; cursor: pointer; white-space: nowrap; }
.tab.on { color: var(--text); background: var(--panel2); border-color: var(--row-line); }
.members, .latest { list-style: none; margin: 0; padding: 6px 12px 12px; }
.members li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dotted var(--row-line); font-size: 13.5px; }
.members .rank { width: 18px; color: var(--muted); font-size: 12px; text-align: right; }
.members .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sky); }
.members .val { color: var(--muted); font-size: 12px; white-space: nowrap; }
.latest li { display: flex; align-items: baseline; gap: 6px; padding: 7px 0; border-bottom: 1px dotted var(--row-line); font-size: 14px; }
.latest li > a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest .arr { color: var(--sky); font-weight: 800; }
.latest .by { color: var(--orange); font-size: 12.5px; white-space: nowrap; }

/* Dòng "hội" như một mục diễn đàn */
.node { display: grid; grid-template-columns: 48px minmax(0, 1fr) 260px; gap: 14px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--row-line); }
.panel-h + .node { border-top: 0; }
.node-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 22px; background: radial-gradient(circle at 30% 30%, rgba(79, 195, 255, 0.35), rgba(11, 111, 208, 0.25)); border: 1px solid rgba(79, 195, 255, 0.4); }
.node-ic.gen { background: radial-gradient(circle at 30% 30%, rgba(243, 112, 33, 0.4), rgba(243, 112, 33, 0.15)); border-color: rgba(243, 112, 33, 0.5); }
.node-ic.sm { width: 36px; height: 36px; font-size: 18px; }
.node-ic.lg { width: 64px; height: 64px; font-size: 32px; }
.node h3 { margin: 0; font-size: 17px; }
.node-desc { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.node-meta { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.node-meta b { color: var(--text); }
.node-last { font-size: 13px; padding: 8px 10px; border: 1px solid var(--row-line); border-radius: 10px; background: var(--panel2); overflow: hidden; }
.node-last a { display: inline; overflow-wrap: anywhere; }

/* Bộ lọc, danh sách hội */
.filters { display: grid; gap: 10px; margin: 12px 0 16px; }
.filters .search { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.forum-page .chip { text-decoration: none !important; }
.chip.tagpick { padding: 4px 6px; }
.chip.tagpick.active { outline: 2px solid var(--orange); outline-offset: 1px; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.gcard { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.gcard-h { display: flex; gap: 10px; align-items: center; }
.gcard h3 { margin: 0; font-size: 16px; }
.gcard p { margin: 0; font-size: 13.5px; color: var(--muted); flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.gcard-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; }

/* Đầu trang hội */
.ghead { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 16px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(11, 111, 208, 0.18), rgba(243, 112, 33, 0.08)); }
.ghead-main { display: flex; gap: 14px; min-width: 0; flex: 1; }
.ghead h1 { margin: 0 0 4px; font-size: clamp(22px, 3vw, 30px); }
.ghead .lead { margin: 0; color: var(--muted); }
.ghead-act { display: flex; flex-wrap: wrap; gap: 8px; }
.manage-body { padding: 14px 16px; display: grid; gap: 10px; }
.manage-body h4 { margin: 8px 0 0; }
.mlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mlist li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mlist li span:nth-child(2) { flex: 1; }

/* Bảng chủ đề */
.thread-head, .thread { display: grid; grid-template-columns: minmax(0, 1fr) 130px 170px; gap: 12px; align-items: center; }
.thread-head { padding: 9px 16px; background: var(--bar); color: #fff; font-size: 12.5px; font-weight: 700; }
.thread { padding: 10px 16px; border-top: 1px solid var(--row-line); }
.thread:hover { background: var(--panel2); }
.t-main { display: flex; gap: 10px; align-items: center; min-width: 0; }
.t-title { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.t-by { font-size: 12.5px; color: var(--muted); }
.t-stats { display: grid; font-size: 12.5px; color: var(--muted); }
.t-stats b { color: var(--text); }
.t-last { display: grid; justify-items: end; font-size: 12.5px; text-align: right; }
.t-last > span:first-child { color: var(--sky); }
.pin { margin-right: 4px; }

/* Trang bài viết: khung tác giả bên trái như diễn đàn mẫu */
.post-h h1 { margin: 0 0 4px; font-size: clamp(22px, 3vw, 30px); line-height: 1.25; overflow-wrap: anywhere; }
.post-h p { margin: 0 0 16px; font-size: 13px; }
.msg { display: grid; grid-template-columns: 140px minmax(0, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.msg-author { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 16px 10px; background: var(--panel2); border-right: 1px solid var(--row-line); text-align: center; }
.msg-author .nm { font-weight: 700; color: var(--sky); font-size: 14px; overflow-wrap: anywhere; }
.msg-author .rank { font-size: 11.5px; color: var(--muted); }
.msg-body { padding: 14px 18px 10px; display: flex; flex-direction: column; min-width: 0; }
.msg-text { font-size: 15.5px; line-height: 1.7; overflow-wrap: anywhere; flex: 1; }
.msg-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--row-line); font-size: 12.5px; }
.msg-act { display: flex; align-items: center; gap: 12px; }
.msg-act .num { color: var(--muted); }
.replies { margin-left: 56px; }
.msg.reply { grid-template-columns: 96px minmax(0, 1fr); }
.msg.reply .av.lg { width: 44px; height: 44px; font-size: 15px; border-radius: 12px; }
.reply-to { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.heart { font: inherit; font-size: 13px; cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 999px; padding: 3px 10px; }
.heart.on { border-color: rgba(233, 30, 99, 0.6); background: rgba(233, 30, 99, 0.12); }
.heart:disabled { cursor: default; opacity: 0.7; }
.imgs { display: grid; gap: 6px; margin-top: 12px; }
.imgs.n1 { grid-template-columns: minmax(0, 520px); }
.imgs.n2, .imgs.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.imgs.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.imgs img { width: 100%; height: auto; max-height: 420px; object-fit: cover; border-radius: 10px; cursor: zoom-in; background: var(--panel2); }
.imgs.n2 img, .imgs.n3 img, .imgs.n4 img { aspect-ratio: 4 / 3; }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.85); }
.lightbox img { display: block; max-width: 96vw; max-height: 94vh; border-radius: 8px; }
.lightbox .qd-x { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, 0.6); color: #fff; }

/* Ô bình luận / viết bài */
.cform { display: grid; gap: 8px; padding: 14px 16px; }
.cform textarea, .form textarea, .form input, .form select, .manage-body textarea, .filters .search {
  font: inherit; color: var(--text); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; resize: vertical; }
.form select option { color: #0f1b33; }
.cform-who { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cform-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rform { margin: -4px 0 12px 56px; background: var(--panel); border: 1px dashed var(--line); border-radius: 14px; }
.form { padding: 18px; display: grid; gap: 4px; }
.form .qd-field { margin-top: 8px; }
.pick { display: flex; flex-wrap: wrap; gap: 10px; }
.pick figure { position: relative; margin: 0; width: 110px; height: 110px; }
.pick figure img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.pick figure .qd-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; font-size: 13px; background: rgba(0, 0, 0, 0.6); color: #fff; }
.pick-add { width: 110px; height: 110px; display: grid; place-items: center; text-align: center; border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; color: var(--muted); font-size: 13px; }
.pick-add:hover { border-color: var(--orange); color: var(--text); }
.qd-msg.ok { color: #9be29e; }

/* Cột bên */
.me-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.me-name { font-weight: 700; }
.me-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.me-actions a { flex: 1; justify-content: center; }
.me p { margin: 0 0 8px; font-size: 13.5px; }
.search-box { display: flex; gap: 6px; padding: 8px; }
.search-box input { flex: 1; min-width: 0; font: inherit; font-size: 14px; color: var(--text); background: transparent; border: 0; outline: 0; padding: 6px 8px; }
.search-box button { border: 0; background: transparent; cursor: pointer; font-size: 16px; }

/* Thanh điều hướng chính (dùng chung với Vườn Tri Thức – khai báo trong style.css) */

/* Giao diện sáng */
html.light .forum-page { --panel: #ffffff; --panel2: #f4f7fc; --row-line: rgba(15, 27, 51, 0.1); }
html.light .forum-page a { color: #0b5cad; }
html.light .panel-h a, html.light .panel-more { color: #fff !important; }
html.light .crumbs span, html.light .tab.on, html.light .node-meta b, html.light .t-stats b { color: #0f1b33; }
html.light .members .nm, html.light .msg-author .nm, html.light .t-last > span:first-child { color: #0b5cad; }
html.light .box-h { color: #0b5cad; }
html.light .heart, html.light .btn-ghost { color: #0f1b33; }
html.light .cform textarea, html.light .form textarea, html.light .form input, html.light .form select, html.light .manage-body textarea, html.light .filters .search { background: #f6f8fc; color: #0f1b33; }
html.light .ghead { background: linear-gradient(135deg, rgba(11, 111, 208, 0.08), rgba(243, 112, 33, 0.06)); }
html.light .pill { color: #b4480f; } html.light .pill.ok { color: #2e7d32; } html.light .pill.warn { color: #8a6100; }
html.light .panel, html.light .box, html.light .msg, html.light .gcard { box-shadow: 0 4px 14px rgba(15, 27, 51, 0.05); }
html.light .search-box input { color: #0f1b33; }

/* Điện thoại / máy tính bảng */
@media (max-width: 1020px) {
  .fm-layout { grid-template-columns: minmax(0, 1fr); }
  .fm-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 14px; }
  .node { grid-template-columns: 44px minmax(0, 1fr); }
  .node-last { grid-column: 2; }
}
@media (max-width: 680px) {
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .col-members { border-right: 0; border-bottom: 1px solid var(--row-line); }
  .thread-head { display: none; }
  .thread { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .t-stats { display: flex; gap: 12px; padding-left: 50px; }
  .t-last { display: flex; justify-content: flex-start; gap: 8px; padding-left: 50px; text-align: left; }
  .msg, .msg.reply { grid-template-columns: minmax(0, 1fr); }
  .msg-author { grid-template-columns: auto 1fr; justify-items: start; align-items: center; text-align: left; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--row-line); gap: 2px 10px; }
  .msg-author .av { grid-row: span 2; }
  .msg-author .av.lg { width: 40px; height: 40px; font-size: 14px; border-radius: 12px; }
  .replies, .rform { margin-left: 18px; }
  .msg-body { padding: 12px 14px 8px; }
  .ghead-act { width: 100%; }
  .ghead-act > * { flex: 1; justify-content: center; }
  .fm-side { grid-template-columns: minmax(0, 1fr); }
  .crumbs span { max-width: 22ch; }
}
@media (max-width: 430px) {
  .forum-page .brand-title { font-size: 15px; }
  .forum-page .top-actions { margin-left: auto; gap: 6px; }
  .forum-page .btn-theme { width: 38px; height: 38px; }
}
