/* ══════════════════════════════════════════════════════════════════════
   PAAN · Diễn đàn hỗ trợ (/support)
   Dùng lại toàn bộ biến màu và các lớp .btn / .card / .chip / .input của
   theme.css — ở đây chỉ thêm phần bố cục riêng của diễn đàn.
   ══════════════════════════════════════════════════════════════════════ */

/* Thuộc tính hidden phải thắng MỌI khai báo display của lớp.
   Trình duyệt chỉ đặt [hidden]{display:none} ở mức mặc định, nên bất kỳ lớp nào
   của mình có display cũng đè lên được. #viewList mang lớp .sp-grid (display:grid)
   nên nếu thiếu dòng này thì gán hidden vào nó hoàn toàn vô tác dụng — trang một
   câu hỏi sẽ chồng lên trang danh sách. */
[hidden] { display: none !important; }

.sp { background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
.sp-wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 22px; }
@media (max-width: 640px) { .sp-wrap { padding-inline: 16px; } }

/* ── Thanh trên cùng ─────────────────────────────────────────────── */
.sp-nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.sp-nav-in { display: flex; align-items: center; gap: 22px; height: 62px; }
.sp-nav-links { display: flex; gap: 20px; margin-left: 8px; flex: 1; }
.sp-nav-links a { color: var(--text-2); text-decoration: none; font-size: .94rem; font-weight: 500; }
.sp-nav-links a:hover, .sp-nav-links a.on { color: var(--text); }
.sp-nav-act { display: flex; align-items: center; gap: 10px; }
@media (max-width: 620px) {
  .sp-nav-links { gap: 14px; font-size: .88rem; }
  .sp-nav-in { gap: 12px; }
  .sp-nav-act .btn { display: none; }
}

/* ── Phần mở đầu ─────────────────────────────────────────────────── */
.sp-main { flex: 1; padding: 40px 22px 70px; }
.sp-head { margin-bottom: 34px; }
.sp-head h1 { font-size: clamp(1.9rem, 4.6vw, 2.7rem); margin: 0 0 10px; }
.sp-head p { color: var(--text-2); max-width: 660px; margin: 0 0 22px; line-height: 1.65; }
.sp-head-act { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.sp-search { position: relative; flex: 1; min-width: 240px; max-width: 420px; }
.sp-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.sp-search .input { padding-left: 38px; }

/* ── Bố cục: chủ đề bên trái, danh sách bên phải ─────────────────── */
.sp-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; align-items: start; }
@media (max-width: 900px) { .sp-grid { grid-template-columns: 1fr; gap: 26px; } }

.sp-side-title, .sp-list-head h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 0 0 12px; }
.sp-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

.sp-topic {
  display: block; width: 100%; text-align: left;
  padding: 11px 13px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: none;
  color: var(--text-2); cursor: pointer; margin-bottom: 3px;
  font: inherit; text-decoration: none;
}
.sp-topic:hover { background: var(--surface-2); color: var(--text); }
.sp-topic.on { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.sp-topic b { display: block; font-size: .93rem; font-weight: 600; }
.sp-topic span { font-size: .78rem; color: var(--text-3); }

/* ── Một dòng câu hỏi ────────────────────────────────────────────── */
.sp-thread {
  display: block; text-decoration: none; color: inherit;
  padding: 16px 18px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--surface);
  margin-bottom: 10px; transition: border-color .18s ease, transform .18s ease;
}
.sp-thread:hover { border-color: var(--brand); transform: translateY(-2px); }
.sp-thread h3 { margin: 0 0 6px; font-size: 1.02rem; line-height: 1.4; }
.sp-thread p { margin: 0 0 10px; color: var(--text-2); font-size: .9rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: .8rem; color: var(--text-3); }
.sp-meta .chip { font-size: .72rem; }
[data-motion='off'] .sp-thread { transition: border-color .18s ease; }
[data-motion='off'] .sp-thread:hover { transform: none; }

/* ── Trang một câu hỏi ───────────────────────────────────────────── */
.sp-back { display: inline-flex; align-items: center; gap: 7px; color: var(--text-3); text-decoration: none; font-size: .9rem; margin-bottom: 18px; }
.sp-back:hover { color: var(--text); }
.sp-q { padding: 24px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); margin-bottom: 26px; }
.sp-q h1 { font-size: clamp(1.3rem, 3.2vw, 1.75rem); margin: 10px 0 14px; line-height: 1.35; }
.sp-body { color: var(--text); line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }

.sp-replies-title { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 0 0 14px; }
.sp-reply { padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); margin-bottom: 12px; }
/* Trả lời của Paan nổi bật hẳn lên để người đọc biết đâu là câu trả lời chính thức */
.sp-reply.staff { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.sp-reply-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; flex-wrap: wrap; }
.sp-who { font-weight: 600; font-size: .93rem; }

.sp-form { padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); margin-top: 26px; }
.sp-form h3 { margin: 0 0 16px; font-size: 1.02rem; }
.sp-form .field { margin-bottom: 14px; }
.sp-note { font-size: .84rem; color: var(--text-3); line-height: 1.6; margin-top: 12px; }

.sp-pager { display: flex; gap: 8px; justify-content: center; margin-top: 22px; }

/* ── Khối công cụ kiểm duyệt (chỉ nhân viên đăng nhập mới thấy) ──── */
.sp-mod { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.sp-pending { border-style: dashed; border-color: var(--warn, #f59f00); }

/* ── Chân trang ──────────────────────────────────────────────────── */
.sp-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0; font-size: .88rem; color: var(--text-3); }
.sp-foot .sp-wrap { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.sp-foot a { color: var(--text-2); text-decoration: none; }
.sp-foot a:hover { color: var(--brand); }

.spinner { width: 22px; height: 22px; border: 2px solid var(--line-2); border-top-color: var(--brand); border-radius: 50%; animation: spSpin .7s linear infinite; margin: 0 auto 10px; }
@keyframes spSpin { to { transform: rotate(360deg); } }
