/* ============================================================
   Emoji 禁用规则（强制，详见 docs/页面模块创建规范.md）
   空白字体接管 U+1F000-1FAFF emoji 区段（📖🏠🎬🔥 等），与 style.css 中规则保持一致；
   ✓ ✗ ❌ ✅ ★ 等普通符号不在覆盖区段内，不受影响。
   ============================================================ */
@font-face { font-family: 'XD Emoji Block'; src: url('../fonts/emoji-blank.woff2') format('woff2'); font-display: block; unicode-range: U+1F000-1FAFF; }
@font-face { font-family: 'Apple Color Emoji'; src: url('../fonts/emoji-blank.woff2') format('woff2'); font-display: block; unicode-range: U+1F000-1FAFF; }
@font-face { font-family: 'Segoe UI Emoji'; src: url('../fonts/emoji-blank.woff2') format('woff2'); font-display: block; unicode-range: U+1F000-1FAFF; }
@font-face { font-family: 'Noto Color Emoji'; src: url('../fonts/emoji-blank.woff2') format('woff2'); font-display: block; unicode-range: U+1F000-1FAFF; }

/* ============================================================
   X-Dream CMS - 问答模块样式（对标百度知道）
   问答首页 + 问题详情（回答列表/采纳）+ 提问页 + 首页热门问答栏目
   ============================================================ */

/* ========== 状态徽标 ========== */
.qa-badge-solved, .qa-badge-unsolved {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: 2px;
    flex-shrink: 0;
}
.qa-badge-solved { color: #0e8a5f; background: #e7f6ef; border: 1px solid #bfe5d3; }
.qa-badge-unsolved { color: #b45f06; background: #fdf3e3; border: 1px solid #f0dcb0; }
.qa-badge-accepted {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: var(--success);
    padding: 1px 8px;
    border-radius: 3px;
}

/* ========== 问答首页：筛选 + 列表 ========== */
.qa-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.qa-filter {
    padding: 6px 16px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--gray-border);
    font-size: 13px;
    color: var(--text);
}
.qa-filter:hover { border-color: var(--primary); color: var(--primary); }
.qa-filter.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.qa-toolbar form { margin-left: auto; display: flex; gap: 6px; }
.qa-toolbar input[type="text"] {
    padding: 6px 12px;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius);
    font-size: 13px;
    width: 180px;
}

.qa-list { display: flex; flex-direction: column; gap: 12px; }
.qa-item {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 15px 18px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: box-shadow .2s;
}
.qa-item:hover { box-shadow: var(--shadow-hover); }
.qa-item-stats {
    flex-shrink: 0;
    width: 62px;
    text-align: center;
    border-right: 1px solid #f0f0f0;
    padding-right: 12px;
}
.qa-item-stats .st-num { font-size: 18px; font-weight: 700; color: var(--text); display: block; }
.qa-item-stats .st-label { font-size: 11px; color: var(--text-light); }
.qa-item-stats.has-accepted .st-num { color: var(--success); }
.qa-item-main { flex: 1; min-width: 0; }
.qa-item-title { font-size: 16px; font-weight: 700; line-height: 1.5; margin-bottom: 5px; }
.qa-item-title a { color: var(--text); }
.qa-item-title a:hover { color: var(--primary); }
.qa-item-excerpt {
    font-size: 12.5px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.qa-item-meta { font-size: 12px; color: #aaa; display: flex; gap: 14px; flex-wrap: wrap; }

/* ========== 问题详情页 ========== */
.qa-question-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    margin-bottom: 18px;
}
.qa-question-title { font-size: 22px; font-weight: 700; line-height: 1.45; margin-bottom: 10px; }
.qa-question-meta {
    font-size: 12.5px;
    color: var(--text-light);
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--gray-border);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}
.qa-question-meta .qm-user { color: var(--primary); font-weight: 600; }
.qa-question-body { font-size: 14px; line-height: 1.95; }
.qa-question-body p { margin-bottom: 8px; }

/* 回答区 */
.qa-answers-head {
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 12px;
}
.qa-answer {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 22px;
    margin-bottom: 12px;
    border-left: 4px solid transparent;
}
.qa-answer.accepted { border-left-color: var(--success); background: #fbfffd; }
.qa-answer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qa-answer-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--gray-bg); flex-shrink: 0; }
.qa-answer-avatar-letter {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; font-size: 15px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.qa-answer-user { font-size: 13.5px; font-weight: 600; color: var(--text); }
.qa-answer-time { font-size: 12px; color: #bbb; margin-left: auto; }
.qa-answer-body { font-size: 14px; line-height: 1.95; }
.qa-answer-body p { margin-bottom: 8px; }
.qa-answer-actions { margin-top: 10px; text-align: right; }

/* 回答表单 */
.qa-answer-form {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    margin-top: 18px;
}
.qa-answer-form h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.qa-answer-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    font-size: 13.5px;
    line-height: 1.8;
    resize: vertical;
    margin-bottom: 12px;
}
.qa-login-tip {
    background: var(--gray-bg);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

/* ========== 提问页 ========== */
.qa-ask-wrap {
    max-width: 760px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
}
.qa-ask-wrap h1 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.qa-ask-tip {
    background: var(--gray-bg);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 18px;
}
.qa-ask-wrap textarea[name="content"] {
    width: 100%;
    min-height: 160px;
    padding: 12px 14px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    font-size: 13.5px;
    line-height: 1.8;
    resize: vertical;
}

/* ========== 首页热门问答栏目 ========== */
/* 左右两大块容器：每块 4 个问题标题 */
.qa-home-2col {
    display: grid;
    /* minmax(0,1fr)：禁止轨道被 nowrap 标题的 min-content 撑宽（否则右块凸出容器） */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
.qa-home-list {
    min-width: 0;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px 22px;
}
.qa-home-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 2px;
    border-bottom: 1px dashed #f0f0f0;
    font-size: 14px;
    color: var(--text);
    min-width: 0;
}
.qa-home-item:last-child { border-bottom: none; }
.qa-home-item:hover .qa-home-title { color: var(--primary); }
.qa-home-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}
.qa-home-meta { flex-shrink: 0; font-size: 12px; color: #bbb; }
.qa-home-meta .ans { color: var(--primary); font-weight: 600; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .qa-item { flex-direction: column; gap: 10px; }
    .qa-item-stats { width: auto; border-right: none; border-bottom: 1px solid #f0f0f0; padding: 0 0 8px; display: flex; gap: 16px; text-align: left; }
    .qa-question-card { padding: 18px 16px; }
    .qa-question-title { font-size: 18px; }
    .qa-ask-wrap { padding: 20px 16px; }
    .qa-toolbar form { margin-left: 0; width: 100%; }
    .qa-toolbar input[type="text"] { flex: 1; width: auto; }
    .qa-home-meta .views { display: none; }
    /* 移动端左右两大块改为上下堆叠 */
    .qa-home-2col { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
