/* ============================================================
   EyouCMS 社区问答模板 - qa_community.css
   设计风格：Stack Overflow / SegmentFault 问答社区
   ============================================================ */

/* ---------- CSS Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #3d3d3d;
    background: #f6f8fa;
    line-height: 1.6;
}
a { color: #0969da; text-decoration: none; }
a:hover { color: #0550ae; text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1,h2,h3,h4,h5,h6 { margin: 0; font-weight: 600; }
p { margin: 0; }
input, button { outline: none; }

/* ---------- Layout ---------- */
.qa-container { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.qa-layout { display: flex; gap: 24px; }
.qa-main { flex: 1; min-width: 0; }
.qa-sidebar { width: 280px; flex-shrink: 0; }
.qa-main-wrap { padding: 24px 0 40px; }
.qa-mt30 { margin-top: 30px; }

/* ---------- Header ---------- */
#qa-header { background: #fff; border-bottom: 1px solid #e1e4e8; position: sticky; top: 0; z-index: 1000; }
.qa-topbar { }
.qa-topbar-inner {
    max-width: 1160px; margin: 0 auto; padding: 0 16px;
    height: 56px; display: flex; align-items: center; gap: 16px;
}
.qa-logo { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.qa-logo img { height: 32px; width: auto; }
.qa-logo-text { font-size: 18px; font-weight: 700; color: #1a1a1a; white-space: nowrap; }
.qa-logo:hover .qa-logo-text { text-decoration: none; }

.qa-search-wrap { flex: 1; max-width: 480px; }
.qa-search-form { display: flex; }
.qa-search-input {
    flex: 1; height: 36px; border: 1px solid #d0d7de; border-right: none;
    border-radius: 6px 0 0 6px; padding: 0 12px; font-size: 13px; color: #1a1a1a;
    background: #f6f8fa;
}
.qa-search-input:focus { background: #fff; border-color: #0969da; }
.qa-search-btn {
    height: 36px; padding: 0 14px; background: #0969da; color: #fff;
    border: none; border-radius: 0 6px 6px 0; font-size: 13px; cursor: pointer;
}
.qa-search-btn:hover { background: #0550ae; }

.qa-nav { margin-left: auto; }
.qa-nav-list { display: flex; align-items: center; gap: 4px; }
.qa-nav-list li { position: relative; }
.qa-nav-list li a {
    display: block; padding: 6px 10px; border-radius: 4px; font-size: 14px; color: #57606a;
    white-space: nowrap;
}
.qa-nav-list li.active > a,
.qa-nav-list li a:hover { background: #f3f4f6; color: #1a1a1a; text-decoration: none; }
.qa-dropdown {
    display: none; position: absolute; top: 100%; left: 0;
    background: #fff; border: 1px solid #d0d7de; border-radius: 6px; min-width: 140px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1); z-index: 100;
}
.qa-dropdown li a { padding: 8px 14px; color: #3d3d3d; }
.qa-dropdown li a:hover { background: #f6f8fa; text-decoration: none; }
.qa-nav-list li:hover .qa-dropdown { display: block; }

.qa-user-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.qa-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    padding: 6px 16px; border-radius: 6px; font-size: 14px; font-weight: 500;
    cursor: pointer; border: 1px solid transparent; transition: .15s;
    text-decoration: none !important;
}
.qa-btn-primary { background: #0969da; color: #fff; border-color: #0969da; }
.qa-btn-primary:hover { background: #0550ae; border-color: #0550ae; color: #fff; }
.qa-btn-ghost { background: #fff; color: #3d3d3d; border-color: #d0d7de; }
.qa-btn-ghost:hover { background: #f3f4f6; border-color: #adb5bd; }
.qa-btn-vote { background: #fff; color: #3d3d3d; border-color: #d0d7de; font-size: 13px; }
.qa-btn-vote:hover { background: #e8f4fd; border-color: #0969da; color: #0969da; }
.qa-btn-block { display: flex; width: 100%; }
.qa-btn-lg { height: 44px; padding: 0 24px; font-size: 15px; }

/* ---------- Hero ---------- */
.qa-hero {
    background: linear-gradient(135deg, #0969da 0%, #1a4d8f 100%);
    padding: 56px 16px 48px;
    text-align: center;
    color: #fff;
}
.qa-hero-title { font-size: 32px; font-weight: 700; margin-bottom: 10px; }
.qa-hero-sub { font-size: 16px; opacity: .85; margin-bottom: 28px; }
.qa-hero-search { max-width: 600px; margin: 0 auto 20px; }
.qa-hero-form { display: flex; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.qa-hero-input {
    flex: 1; height: 52px; border: none; padding: 0 18px; font-size: 15px; color: #1a1a1a;
}
.qa-hero-stats { display: flex; justify-content: center; gap: 32px; font-size: 14px; opacity: .9; }
.qa-hero-stats strong { font-size: 20px; font-weight: 700; }

/* ---------- Channel Banner ---------- */
.qa-channel-banner {
    background: linear-gradient(135deg, #0969da 0%, #1a4d8f 100%);
    padding: 28px 16px 24px;
    color: #fff;
}
.qa-channel-name { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.qa-channel-desc { font-size: 14px; opacity: .85; margin-bottom: 10px; }

/* ---------- Filter Bar ---------- */
.qa-filter-bar { background: #fff; border-bottom: 1px solid #e1e4e8; }
.qa-filter-inner {
    max-width: 1160px; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: center; gap: 8px; height: 44px; overflow-x: auto;
}
.qa-filter-btn {
    padding: 4px 14px; border-radius: 20px; font-size: 13px; color: #57606a;
    border: 1px solid transparent; white-space: nowrap; cursor: pointer; text-decoration: none;
    transition: .15s;
}
.qa-filter-btn:hover, .qa-filter-btn.active {
    background: #0969da; color: #fff; border-color: #0969da; text-decoration: none;
}

/* ---------- Category Nav (homepage) ---------- */
.qa-category-nav {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.qa-cat-btn {
    padding: 5px 14px; border-radius: 20px; font-size: 13px; color: #57606a;
    background: #fff; border: 1px solid #d0d7de; text-decoration: none; transition: .15s;
}
.qa-cat-btn:hover, .qa-cat-btn.active {
    background: #0969da; color: #fff; border-color: #0969da; text-decoration: none;
}

/* ---------- List Header ---------- */
.qa-list-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid #e1e4e8;
}
.qa-list-title { font-size: 16px; color: #1a1a1a; }
.qa-count { color: #0969da; }
.qa-link-more { font-size: 13px; color: #0969da; }
.qa-list-sort { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #57606a; }
.qa-sort-btn {
    padding: 3px 10px; border-radius: 4px; color: #57606a;
    border: 1px solid transparent; text-decoration: none;
}
.qa-sort-btn.active, .qa-sort-btn:hover {
    border-color: #d0d7de; background: #f3f4f6; color: #1a1a1a; text-decoration: none;
}

/* ---------- Question Item ---------- */
.qa-question-list { display: flex; flex-direction: column; gap: 0; }
.qa-question-item {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 16px 0; border-bottom: 1px solid #eaecef; background: #fff;
    padding-left: 16px; padding-right: 16px;
}
.qa-question-item:first-child { border-top: none; }
.qa-question-item--compact .qa-question-desc { display: none; }

.qa-vote-box {
    flex-shrink: 0; width: 56px; text-align: center;
    background: #f6f8fa; border: 1px solid #eaecef; border-radius: 6px;
    padding: 8px 4px;
}
.qa-vote-num { font-size: 18px; font-weight: 700; color: #1a1a1a; line-height: 1; }
.qa-vote-num.qa-hot { color: #e3402e; }
.qa-vote-label { font-size: 11px; color: #57606a; margin-top: 3px; }

.qa-question-body { flex: 1; min-width: 0; }
.qa-question-title { font-size: 15px; font-weight: 500; margin-bottom: 6px; line-height: 1.4; }
.qa-question-title a { color: #0969da; }
.qa-question-title a:hover { text-decoration: underline; }
.qa-question-desc { font-size: 13px; color: #57606a; margin-bottom: 8px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qa-question-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #57606a; }
.qa-meta-user, .qa-meta-time, .qa-meta-view { display: inline-flex; align-items: center; gap: 3px; }

.qa-question-thumb { flex-shrink: 0; width: 100px; }
.qa-question-thumb img { width: 100px; height: 66px; object-fit: cover; border-radius: 4px; }

.qa-question-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- Tags ---------- */
.qa-tag {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 12px; background: #e8f4fd; color: #0969da; border: 1px solid #b8d8f5;
    text-decoration: none; transition: .15s;
}
.qa-tag:hover { background: #0969da; color: #fff; border-color: #0969da; text-decoration: none; }

/* ---------- Badge ---------- */
.qa-badge { display: inline-block; padding: 1px 5px; border-radius: 3px; font-size: 11px; font-weight: 600; vertical-align: middle; margin-left: 4px; }
.qa-badge-img { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }

/* ---------- Pagination ---------- */
.qa-pagination { padding: 24px 0 8px; }
.qa-page-list { display: flex; gap: 4px; flex-wrap: wrap; }
.qa-page-list li a, .qa-page-list li span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 8px;
    border: 1px solid #d0d7de; border-radius: 6px; color: #3d3d3d; font-size: 13px;
    background: #fff; text-decoration: none; transition: .15s;
}
.qa-page-list li a:hover { background: #f3f4f6; border-color: #adb5bd; }
.qa-page-list li.active a { background: #0969da; color: #fff; border-color: #0969da; }

/* ---------- Breadcrumb ---------- */
.qa-breadcrumb { font-size: 13px; color: #57606a; margin-bottom: 8px; }
.qa-breadcrumb a { color: #57606a; }
.qa-breadcrumb a:hover { color: #0969da; }
.qa-breadcrumb-top { padding-top: 12px; }

/* ---------- Sidebar Cards ---------- */
.qa-sidebar-card {
    background: #fff; border: 1px solid #d0d7de; border-radius: 8px;
    padding: 16px; margin-bottom: 16px;
}
.qa-sidebar-title { font-size: 14px; font-weight: 600; color: #1a1a1a; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #eaecef; }
.qa-ask-cta { text-align: center; background: linear-gradient(135deg, #e8f4fd, #fff); border-color: #b8d8f5; }
.qa-ask-cta p { font-size: 14px; color: #0969da; margin-bottom: 12px; font-weight: 500; }
.qa-tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.qa-sidebar-catlist li { padding: 5px 0; border-bottom: 1px solid #f3f4f6; }
.qa-sidebar-catlist li:last-child { border: none; }
.qa-sidebar-catlist li a { font-size: 13px; color: #3d3d3d; }
.qa-sidebar-catlist li a:hover { color: #0969da; text-decoration: none; }
.qa-sidebar-randlist li { padding: 6px 0; border-bottom: 1px solid #f3f4f6; }
.qa-sidebar-randlist li:last-child { border: none; }
.qa-sidebar-randlist li a { font-size: 13px; color: #3d3d3d; line-height: 1.4; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.qa-sidebar-randlist li a:hover { color: #0969da; text-decoration: none; }
.qa-sidebar-adv { padding: 8px; }
.qa-adv-img { width: 100%; border-radius: 4px; }

/* ---------- Question Detail ---------- */
.qa-question-card {
    background: #fff; border: 1px solid #d0d7de; border-radius: 8px; margin-bottom: 20px;
}
.qa-question-card-head { padding: 20px 20px 16px; border-bottom: 1px solid #eaecef; }
.qa-detail-title { font-size: 22px; color: #1a1a1a; line-height: 1.4; margin-bottom: 12px; }
.qa-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 13px; color: #57606a; margin-bottom: 10px; }
.qa-meta-collect { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: #57606a; }
.qa-meta-collect:hover { color: #0969da; text-decoration: none; }
.qa-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.qa-question-card-body { padding: 20px; min-height: 80px; }
.qa-content { font-size: 15px; line-height: 1.8; color: #24292f; }
.qa-content h2 { font-size: 18px; margin: 20px 0 10px; }
.qa-content h3 { font-size: 16px; margin: 16px 0 8px; }
.qa-content p { margin-bottom: 12px; }
.qa-content pre { background: #f6f8fa; border: 1px solid #e1e4e8; border-radius: 6px; padding: 16px; overflow-x: auto; font-size: 13px; }
.qa-content code { background: #f6f8fa; border-radius: 3px; padding: 2px 5px; font-size: 13px; color: #e3402e; font-family: "SFMono-Regular", Consolas, monospace; }
.qa-content blockquote { border-left: 4px solid #d0d7de; margin: 12px 0; padding: 8px 16px; color: #57606a; background: #f6f8fa; }
.qa-content img { border-radius: 6px; max-width: 100%; }
.qa-question-card-foot { padding: 14px 20px; border-top: 1px solid #eaecef; }
.qa-action-row { display: flex; gap: 10px; }

/* ---------- Pre/Next Nav ---------- */
.qa-prenext-nav {
    background: #fff; border: 1px solid #d0d7de; border-radius: 8px;
    padding: 16px 20px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px;
}
.qa-prenext-item { font-size: 13px; }
.qa-prenext-label { color: #57606a; margin-right: 4px; }
.qa-prenext-link { color: #0969da; }
.qa-prenext-link:hover { text-decoration: underline; }
.qa-text-muted { color: #adb5bd; }

/* ---------- Related Section ---------- */
.qa-related-section { background: #fff; border: 1px solid #d0d7de; border-radius: 8px; padding: 16px 20px; }
.qa-section-title { font-size: 15px; color: #1a1a1a; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #eaecef; }
.qa-related-list { display: flex; flex-direction: column; gap: 0; }
.qa-related-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.qa-related-item:last-child { border: none; }
.qa-related-link { font-size: 13px; color: #0969da; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; margin-right: 10px; }
.qa-related-link:hover { text-decoration: underline; }
.qa-related-time { font-size: 11px; color: #adb5bd; flex-shrink: 0; }

/* ---------- Login Box ---------- */
.qa-login-box { padding: 8px 16px 16px; }
.qa-login-title { font-size: 18px; font-weight: 600; text-align: center; margin-bottom: 16px; color: #1a1a1a; }
.qa-form-item { margin-bottom: 12px; }
.qa-input {
    width: 100%; height: 38px; border: 1px solid #d0d7de; border-radius: 6px;
    padding: 0 12px; font-size: 14px; color: #1a1a1a; background: #fff;
}
.qa-input:focus { border-color: #0969da; }
.qa-captcha-row { display: flex; gap: 8px; align-items: center; }
.qa-captcha-input { flex: 1; }
.qa-captcha-row img { height: 38px; border-radius: 4px; cursor: pointer; flex-shrink: 0; }
.qa-login-links { text-align: center; font-size: 13px; color: #57606a; margin-top: 12px; display: flex; justify-content: space-between; }
.qa-login-links a { color: #0969da; }

/* ---------- Footer ---------- */
.qa-footer { background: #24292f; color: #8b949e; font-size: 13px; padding: 40px 0 20px; margin-top: 40px; }
.qa-footer-inner { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.qa-footer-cols { display: flex; gap: 40px; flex-wrap: wrap; margin-bottom: 28px; }
.qa-footer-col { flex: 1; min-width: 140px; }
.qa-footer-col h4 { font-size: 13px; font-weight: 600; color: #f0f6fc; margin-bottom: 12px; }
.qa-footer-col ul li { margin-bottom: 6px; }
.qa-footer-col ul li a { color: #8b949e; text-decoration: none; }
.qa-footer-col ul li a:hover { color: #f0f6fc; }
.qa-footer-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.qa-footer-tags .qa-tag { background: transparent; border-color: #3d444d; color: #8b949e; }
.qa-footer-tags .qa-tag:hover { background: #3d444d; color: #f0f6fc; }
.qa-footer-col p { margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.qa-qrcode { margin-top: 10px; text-align: center; }
.qa-qrcode img { width: 80px; height: 80px; border-radius: 4px; }
.qa-qrcode span { display: block; font-size: 11px; margin-top: 4px; }
.qa-footer-links { padding: 16px 0; border-top: 1px solid #3d444d; display: flex; flex-wrap: wrap; gap: 12px; }
.qa-footer-links a { color: #57606a; text-decoration: none; font-size: 12px; }
.qa-footer-links a:hover { color: #f0f6fc; }
.qa-footer-copy { padding-top: 16px; border-top: 1px solid #3d444d; font-size: 12px; color: #57606a; text-align: center; }

/* ---------- Icons (伪元素 fallback，使用文字图标) ---------- */
.qa-icon::before { font-style: normal; }
.qa-icon-search::before  { content: "🔍"; font-size: 12px; }
.qa-icon-user::before    { content: "👤"; font-size: 12px; }
.qa-icon-time::before    { content: "🕐"; font-size: 12px; }
.qa-icon-eye::before     { content: "👁"; font-size: 12px; }
.qa-icon-thumbup::before { content: "👍"; font-size: 12px; }
.qa-icon-back::before    { content: "←"; font-size: 12px; }
.qa-icon-home::before    { content: "🏠"; font-size: 12px; }
.qa-icon-star::before    { content: "☆"; }
.qa-icon-star-fill::before { content: "★"; }
.qa-icon-phone::before   { content: "📞"; font-size: 12px; }
.qa-icon-email::before   { content: "✉"; font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .qa-sidebar { display: none; }
    .qa-topbar-inner { gap: 10px; }
    .qa-nav { display: none; }
    .qa-search-wrap { flex: 1; max-width: none; }
    .qa-hero-title { font-size: 22px; }
    .qa-footer-cols { gap: 20px; }
}
@media (max-width: 600px) {
    .qa-hero { padding: 32px 16px 28px; }
    .qa-hero-stats { flex-direction: column; gap: 6px; }
    .qa-question-item { flex-wrap: wrap; }
    .qa-vote-box { width: 48px; }
    .qa-detail-title { font-size: 18px; }
}
