/* ==========================================================================
 * 自问自答（问答）样式
 * 文件：usr/themes/handsome/assets/css/qa.css
 *
 * 设计原则：
 *   1) 不硬编码颜色。文字一律用主题的 .text-black / .text-muted
 *      （这两个 class 在 dark.min.css 里有深色适配规则，会自动变色）
 *   2) 只补主题没提供的「结构 / 间距 / 层级」，尽量少写规则
 *   3) 所有规则以 .qa- 开头，不影响任何现有页面
 * ========================================================================== */

/* ==========================================================================
 * 一、问答首页 —— 头部（头像 + 大标题 + 副标题）
 * ========================================================================== */

.qa-hero {
    padding: 30px 16px 26px;
    margin-bottom: 18px;
}

/* 圆形头像 */
.qa-hero-avatar {
    margin-bottom: 16px;
}

.qa-hero-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    /* 用半透明阴影做层次，深浅色下都成立，不写死颜色 */
    box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
}

/* 大标题 —— 复用主题 .entry-title / .font-thin / .text-black 的深色适配 */
.qa-hero-title {
    font-size: 30px;
    font-weight: 300;
    line-height: 1.35;
    margin: 0 0 8px;
    letter-spacing: 2px;
}

/* 副标题 */
.qa-hero-subtitle {
    font-size: 15px;
    font-weight: 300;
    line-height: 1.6;
    margin: 0 0 12px;
    letter-spacing: 1px;
}

.qa-hero-stat {
    font-size: 12px;
}

/* ==========================================================================
 * 二、搜索框 + 筛选面板
 * ========================================================================== */

.qa-toolbar {
    max-width: 620px;
    margin: 0 auto 8px;
    padding: 0 4px;
}

/* ---- 搜索框 ---- */
.qa-search-group {
    display: flex;
    align-items: stretch;
}

.qa-search-icon {
    /* 用当前文字色透明度做背景与边框，深浅色通用，不写死颜色 */
    background: rgba(128, 128, 128, .10);
    border: 1px solid rgba(128, 128, 128, .22);
    border-right: none;
    border-radius: 22px 0 0 22px;
    padding: 0 6px 0 16px;
    display: flex;
    align-items: center;
    color: inherit;
}

.qa-search-icon i,
.qa-search-icon svg {
    width: 16px;
    height: 16px;
}

.qa-search-input.form-control {
    height: 44px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    background: transparent;
    border-color: rgba(128, 128, 128, .22);
    box-shadow: none;
    font-size: 14px;
    padding-left: 10px;
}

.qa-search-input.form-control:focus {
    box-shadow: none;
    border-color: rgba(128, 128, 128, .38);
    background: transparent;
}

/* 筛选按钮 */
.qa-filter-btn.btn {
    height: 44px;
    border-radius: 0 22px 22px 0;
    border: 1px solid rgba(128, 128, 128, .22);
    border-left: none;
    background: rgba(128, 128, 128, .10);
    color: inherit;
    padding: 0 18px;
    transition: background .2s;
}

.qa-filter-btn.btn:hover,
.qa-filter-btn.btn.active {
    background: rgba(128, 128, 128, .20);
}

.qa-filter-btn i,
.qa-filter-btn svg {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
}

/* ---- 筛选面板 ---- */
.qa-filter-panel {
    margin-top: 12px;
    padding: 16px 18px;
    border-radius: 10px;
    background: rgba(128, 128, 128, .07);
    border: 1px solid rgba(128, 128, 128, .16);
}

.qa-filter-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.qa-filter-row:last-of-type {
    margin-bottom: 0;
}

.qa-filter-label {
    width: 52px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 400;
    margin: 0;
}

.qa-filter-select.form-control {
    height: 36px;
    font-size: 13px;
    border-radius: 6px;
    background: transparent;
    border-color: rgba(128, 128, 128, .25);
    box-shadow: none;
    flex: 1;
}

.qa-filter-select.form-control:focus {
    box-shadow: none;
    border-color: rgba(128, 128, 128, .45);
}

/* 深色模式下让原生下拉的选项也可读 */
html.theme-dark .qa-filter-select option {
    background: #1a1a1b;
    color: #dcdcdc;
}

.qa-filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(128, 128, 128, .16);
}

.qa-filter-reset.btn {
    font-size: 13px;
    border-radius: 16px;
    padding: 5px 18px;
    border: 1px solid rgba(128, 128, 128, .30);
    background: transparent;
    color: inherit;
}

.qa-filter-reset.btn:hover {
    background: rgba(128, 128, 128, .15);
}

.qa-filter-count {
    font-size: 12px;
}

/* ---- 无结果提示 ---- */
.qa-no-result {
    text-align: center;
    padding: 36px 16px;
    font-size: 14px;
}

/* ==========================================================================
 * 三、问答首页 —— 问题列表（只显示标题，大字号居中）
 * ========================================================================== */

.qa-question-list {
    border-top: none;
    text-align: center;
}

.qa-question-item {
    padding: 22px 0;
    /* 分隔线用当前文字色的透明度呈现，深浅色下都自然（不写死颜色） */
    border-bottom: 1px solid rgba(128, 128, 128, .18);
    text-align: center;
}

.qa-question-item:last-child {
    border-bottom: none;
}

/* 问题标题：大字号、居中、悬停变色 */
.qa-q-title {
    display: block;
    font-size: 21px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: .5px;
    word-break: break-word;
    text-decoration: none;
    padding: 0 4%;
}

.qa-q-title:hover {
    text-decoration: none;
    opacity: .82;
}

/* 元信息：小字，居中在标题下方 */
.qa-q-meta {
    font-size: 12px;
    line-height: 1.6;
    margin-top: 10px;
}

.qa-q-meta span {
    display: inline-block;
}

/* ==========================================================================
 * 三、问题详情页 —— 头部（大标题 + 简单解释 + 元信息）
 *     与首页保持同一风格：居中、大字号
 * ========================================================================== */

.qa-single-head {
    padding: 30px 16px 24px;
    margin-bottom: 20px;
    text-align: center;
}

.qa-single-title {
    font-size: 30px;
    font-weight: 300;
    line-height: 1.35;
    margin: 0 0 14px;
    letter-spacing: 2px;
    word-break: break-word;
}

/* 「问题的简单解释」—— 取正文第一句 */
.qa-single-sub {
    font-size: 15px;
    font-weight: 300;
    line-height: 1.6;
    margin: 0 0 14px;
    letter-spacing: 1px;
    padding: 0 8%;
    word-break: break-word;
}

.qa-single-meta {
    font-size: 12px;
    line-height: 1.6;
}

.qa-single-meta span {
    display: inline-block;
}

/* ==========================================================================
 * 四、问题详情页 —— 回答列表
 * ========================================================================== */

.qa-answers-wrap {
    margin-top: 8px;
}

.qa-answers-title {
    font-size: 13px;
    font-weight: 400;
    margin: 0 0 18px;
    text-align: center;
    letter-spacing: 1px;
}

.qa-answer {
    padding: 0 0 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(128, 128, 128, .18);
}

.qa-answer:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* ---- 回答头部：头像 + 名字 + 时间 ---- */
.qa-answer-head {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.qa-answer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    flex-shrink: 0;
}

.qa-answer-who {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.qa-answer-name {
    font-size: 14px;
    margin-right: 6px;
}

.qa-answer-time {
    font-size: 12px;
    white-space: nowrap;
}

/* ---- 回答正文 ---- */
.qa-answer-body {
    font-size: 14px;
    line-height: 1.9;
    word-break: break-word;
}

.qa-answer-body > p:last-child {
    margin-bottom: 0;
}

/* ---- 回复按钮 ---- */
.qa-answer-actions {
    margin-top: 10px;
    text-align: right;
}

.qa-answer-reply {
    text-decoration: none;
    cursor: pointer;
    opacity: .72;
    transition: opacity .2s;
}

.qa-answer-reply:hover {
    opacity: 1;
    text-decoration: none;
}

/* ---- 嵌套：路人之间的回复 ---- */
.qa-answer-children {
    margin-top: 16px;
    padding-left: 46px;
}

.qa-answer-child {
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: rgba(128, 128, 128, .07);
    border-bottom: none;
}

.qa-answer-child .qa-answer-body {
    font-size: 13.5px;
}

.qa-answer-child .qa-answer-avatar {
    width: 28px;
    height: 28px;
}

/* ==========================================================================
 * 五、问题详情页 —— 发表回复
 * ========================================================================== */

.qa-respond {
    margin-top: 26px;
    padding: 20px 18px;
    border-radius: 6px;
}

.qa-respond-title {
    font-size: 15px;
    font-weight: 400;
    margin: 0 0 8px;
    text-align: center;
}

.qa-respond-tip {
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
    margin-bottom: 14px;
}

.qa-respond textarea {
    resize: vertical;
    min-height: 110px;
}

.qa-respond-actions {
    text-align: center;
    margin-top: 14px;
}

/* ==========================================================================
 * 六、分页
 * ========================================================================== */

.qa-pager {
    margin-top: 22px;
}

.qa-pager .page-navigator {
    display: inline-block;
    padding-left: 0;
    margin: 0;
}

.qa-pager .page-navigator > li > a,
.qa-pager .page-navigator > li > span {
    line-height: 1.42857143;
    padding: 6px 12px;
}

/* ==========================================================================
 * 七、空状态
 * ========================================================================== */

.qa-empty,
.qa-empty-all {
    padding: 14px 0;
}

/* ==========================================================================
 * 八、移动端
 * ========================================================================== */

@media (max-width: 500px) {
    .qa-hero {
        padding: 22px 12px 20px;
        margin-bottom: 12px;
    }

    .qa-hero-img {
        width: 76px;
        height: 76px;
    }

    .qa-hero-title {
        font-size: 23px;
        letter-spacing: 1px;
    }

    .qa-hero-subtitle {
        font-size: 13px;
    }

    .qa-q-title {
        font-size: 17px;
        padding: 0;
    }

    .qa-question-item {
        padding: 18px 0;
    }

    .qa-single-head {
        padding: 22px 12px 18px;
    }

    .qa-single-title {
        font-size: 23px;
        letter-spacing: 1px;
    }

    .qa-single-sub {
        font-size: 13px;
        padding: 0;
    }

    .qa-answer-children {
        padding-left: 16px;
    }

    .qa-answer-child {
        padding: 10px 11px;
    }

    /* 搜索框与筛选面板在手机上收窄 */
    .qa-toolbar {
        padding: 0;
    }

    .qa-search-input.form-control {
        height: 40px;
        font-size: 13px;
    }

    .qa-search-icon,
    .qa-filter-btn.btn {
        height: 40px;
    }

    .qa-search-icon {
        padding-left: 12px;
    }

    .qa-filter-btn.btn {
        padding: 0 14px;
    }

    .qa-filter-panel {
        padding: 13px 14px;
    }

    .qa-filter-label {
        width: 44px;
        font-size: 12px;
    }
}
