@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
  background: #f1f5f9;
  color: #1e293b;
  line-height: 1.6;
}

a {
  color: #4f46e5;
  text-decoration: none;
}
a:hover {
  color: #4338ca;
}

/* ── Header ────────────────────────────── */
.qa-header {
  background: #1e1b4b;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.qa-header-inner {
  max-width: 1260px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 52px;
}
.qa-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.3px;
}
.qa-logo:hover {
  color: #c7d2fe;
  text-decoration: none;
}
.qa-search-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 520px;
}
.qa-search {
  width: 100%;
  padding: 7px 14px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  font-size: 0.82rem;
  background: rgba(255,255,255,0.1);
  color: #e2e8f0;
  font-family: inherit;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}
.qa-search::placeholder {
  color: rgba(255,255,255,0.4);
}
.qa-search:focus {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.3);
}
.qa-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ── Buttons ───────────────────────────── */
.qa-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.qa-btn:hover {
  background: #4338ca;
  color: #fff;
  text-decoration: none;
}
.qa-btn-ghost {
  background: transparent;
  color: #c7d2fe;
  border: 1px solid rgba(255,255,255,0.2);
}
.qa-btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.qa-btn-sm {
  padding: 4px 10px;
  font-size: 0.76rem;
  border-radius: 5px;
}

/* ── Layout: sidebar + main ────────────── */
.qa-layout {
  max-width: 1260px;
  margin: 0 auto;
  display: flex;
  min-height: calc(100vh - 52px - 52px);
}
.qa-sidebar {
  width: 220px;
  min-width: 220px;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  padding: 20px 0;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
}
.qa-main {
  flex: 1;
  min-width: 0;
  padding: 24px;
}

/* ── Sidebar nav ───────────────────────── */
.qa-sidebar-section {
  padding: 0 0 12px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.qa-sidebar-section:last-child {
  border-bottom: none;
}
.qa-sidebar-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 20px 8px;
}
.qa-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  font-size: 0.84rem;
  color: #475569;
  font-weight: 500;
  transition: all 0.12s;
  border-left: 3px solid transparent;
}
.qa-sidebar-link:hover {
  background: #f8fafc;
  color: #1e293b;
  text-decoration: none;
}
.qa-sidebar-link.active {
  color: #4f46e5;
  background: #eef2ff;
  border-left-color: #4f46e5;
  font-weight: 600;
}
.qa-sidebar-link-icon {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.qa-sidebar-count {
  margin-left: auto;
  font-size: 0.7rem;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 500;
}

/* ── Tag list in sidebar ───────────────── */
.qa-sidebar-tags {
  list-style: none;
  margin: 0;
  padding: 0;
}
.qa-sidebar-tags li {
  padding: 0 20px;
}
.qa-sidebar-tag {
  display: block;
  padding: 5px 0;
  font-size: 0.8rem;
  color: #64748b;
  transition: color 0.12s;
}
.qa-sidebar-tag:hover {
  color: #4f46e5;
}

/* ── Breadcrumb ────────────────────────── */
.qa-breadcrumb {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 12px;
}
.qa-breadcrumb a {
  color: #64748b;
}
.qa-breadcrumb a:hover {
  color: #4f46e5;
}
.qa-breadcrumb span {
  color: #1e293b;
  font-weight: 500;
}

/* ── Page title ────────────────────────── */
.qa-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}
.qa-page-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 20px;
}

/* ── Cards ─────────────────────────────── */
.qa-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.qa-card:hover {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ── Hero stats (homepage) ─────────────── */
.qa-hero {
  margin-bottom: 28px;
}
.qa-hero-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
.qa-hero-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  flex: 1;
  text-align: center;
}
.qa-hero-stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4f46e5;
}
.qa-hero-stat-label {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Question card (list) ──────────────── */
.qa-question {
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.qa-question-stats {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}
.qa-question-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
  padding: 4px 6px;
  border-radius: 6px;
}
.qa-question-stat-num {
  font-size: 1rem;
  font-weight: 700;
  color: #475569;
}
.qa-question-stat-label {
  font-size: 0.62rem;
  color: #94a3b8;
  text-transform: uppercase;
}
.qa-question-stat.answered .qa-question-stat-num {
  color: #16a34a;
}
.qa-question-stat.answered {
  background: #f0fdf4;
}
.qa-question-body {
  flex: 1;
  min-width: 0;
}
.qa-question-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
}
.qa-question-title:hover {
  color: #4f46e5;
}
.qa-question-excerpt {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qa-question-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ── Tags / badges ─────────────────────── */
.qa-tags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.qa-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  background: #eef2ff;
  color: #4f46e5;
}
.qa-tag:hover {
  background: #e0e7ff;
  color: #4338ca;
  text-decoration: none;
}
.qa-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
}
.qa-badge-best {
  background: #dcfce7;
  color: #16a34a;
}
.qa-badge-new {
  background: #dcfce7;
  color: #16a34a;
}
.qa-badge-author {
  background: #fef3c7;
  color: #d97706;
}

/* ── Question detail page ──────────────── */
.qa-detail {
  padding: 24px;
}
.qa-detail-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 12px;
}
.qa-detail-body {
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: #334155;
  margin-bottom: 16px;
}
.qa-detail-stats {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 0.82rem;
  color: #64748b;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.qa-detail-stat strong {
  color: #1e293b;
}

/* ── Author / user badge ───────────────── */
.qa-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qa-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
}
.qa-avatar-lg {
  width: 56px;
  height: 56px;
}
.qa-avatar-sm {
  width: 22px;
  height: 22px;
}
.qa-author-info {
  flex: 1;
}
.qa-author-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #1e293b;
}
.qa-author-meta {
  font-size: 0.72rem;
  color: #94a3b8;
}
.qa-post-time {
  font-size: 0.72rem;
  color: #94a3b8;
}

/* ── Answers ───────────────────────────── */
.qa-answers-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.qa-answers-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.qa-answers-sort {
  font-size: 0.78rem;
  color: #94a3b8;
}
.qa-answers-sort a {
  color: #4f46e5;
  font-weight: 500;
}

.qa-answer {
  padding: 20px;
  border-bottom: 1px solid #f1f5f9;
}
.qa-answer:last-child {
  border-bottom: none;
}
.qa-answer.best {
  background: #f0fdf4;
  border-left: 3px solid #16a34a;
}
.qa-answer-body {
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: #334155;
  margin: 12px 0;
}
.qa-answer-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.qa-answer-actions {
  display: flex;
  gap: 12px;
}
.qa-answer-action {
  font-size: 0.76rem;
  color: #94a3b8;
  cursor: pointer;
}
.qa-answer-action:hover {
  color: #4f46e5;
}
.qa-vote {
  display: flex;
  align-items: center;
}
.qa-vote-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #94a3b8;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.qa-vote-btn:hover {
  border-color: #4f46e5;
  color: #4f46e5;
}
.qa-vote-score {
  width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e293b;
}
.qa-post-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.qa-post-action {
  font-size: 0.76rem;
  color: #94a3b8;
  cursor: pointer;
}
.qa-post-action:hover {
  color: #4f46e5;
}

/* ── Footer ────────────────────────────── */
.qa-footer {
  background: #1e1b4b;
  color: rgba(255,255,255,0.5);
  padding: 16px 0;
  font-size: 0.75rem;
  text-align: center;
}
.qa-footer-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.qa-footer a {
  color: rgba(255,255,255,0.6);
}
.qa-footer a:hover {
  color: #c7d2fe;
}

/* ── Auth Modal ────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-modal {
  background: #fff;
  border-radius: 14px;
  width: 400px;
  max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  overflow: hidden;
}
.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fb;
  padding: 0;
  border-bottom: 1px solid #e2e8f0;
}
.auth-tabs {
  display: flex;
}
.auth-tab {
  padding: 14px 24px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #94a3b8;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.auth-tab:hover {
  color: #64748b;
}
.auth-tab.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
}
.auth-close {
  padding: 14px 20px;
  cursor: pointer;
  font-size: 1.3rem;
  color: #94a3b8;
  line-height: 1;
}
.auth-close:hover {
  color: #ef4444;
}
.auth-modal-body {
  padding: 24px;
}
.auth-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin: 14px 0 5px;
}
.auth-form input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.auth-form input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.auth-form button {
  margin-top: 16px;
}

/* ── Empty state ───────────────────────── */
.qa-empty {
  padding: 48px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

/* ── Responsive ────────────────────────── */
@media (max-width: 800px) {
  .qa-sidebar {
    display: none;
  }
  .qa-layout {
    flex-direction: column;
  }
  .qa-main {
    padding: 16px;
  }
  .qa-search-wrap {
    max-width: none;
  }
}
