/* ============================================
 * respond.css — 受测者作答视图（单页版）
 * 问卷研究工作室 · 多期追踪问卷工具
 *
 * 参考问卷星手机作答页（jqmobo.css / 385763943.html 实测）：
 *   标题 #2c3e7a 居中加粗 · 选项 1px #e4e9f0 边框分组、行高 48px
 *   单选圈 18px 边框 #a3aeb9、选中 border:5px solid #2c3e7a
 *   量表：左右端点文案 + 26px 圆点刻度 · 必答星号 #c0392b
 *   正文 #2c3e50 / 次要 #5b6b7c / 输入框边框 #ced7e0
 *
 * 这个视图同时被「真实作答页」和「预览界面」复用，
 * 保证发布者预览到的就是受测者真正看到的。
 * ============================================ */

.qa {
    background: #fff;
    color: #2c3e50;
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", "微软雅黑", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    box-sizing: border-box;
}
.qa *, .qa *::before, .qa *::after { box-sizing: border-box; }

.qa-inner { max-width: 760px; margin: 0 auto; padding: 26px 20px 40px; }

/* ---------------- 问卷头部 ---------------- */
.qa-head { text-align: center; padding: 10px 0 4px; }
.qa-title {
    margin: 0;
    color: #2c3e7a;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    word-break: break-word;
}
.qa-desc {
    margin-top: 10px;
    text-align: left;
    font-size: 14px;
    line-height: 24px;
    color: #5b6b7c;
    white-space: pre-wrap;
    word-break: break-word;
}
.qa-tags { margin-top: 10px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.qa-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 18px;
    background: #eef1f8;
    color: #2c3e7a;
}
.qa-tag.warn { background: #fff3e6; color: #e67e22; }

/* ---------------- 分页栏 ---------------- */
.qa-pagesep {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0 6px;
    color: #8b98a5;
    font-size: 13px;
}
.qa-pagesep em { flex: 1 1 auto; border-top: 1px dashed #dfe5ec; font-style: normal; }

/* ---------------- 题目 ---------------- */
.qa-q { padding: 20px 0 4px; position: relative; }
.qa-q + .qa-q { border-top: 1px solid #f0f3f7; }
.qa-q.qa-hidden { display: none; }

.qa-q-head { display: flex; align-items: flex-start; margin-bottom: 12px; }
.qa-req { color: #c0392b; font-weight: 700; margin-right: 2px; flex: 0 0 auto; }
.qa-req.off { visibility: hidden; }
.qa-no { flex: 0 0 auto; margin-right: 4px; color: #2c3e50; font-weight: 600; }
.qa-no.off { display: none; }
.qa-qtxt { flex: 1 1 auto; font-size: 16px; font-weight: 600; color: #2c3e50; word-break: break-word; }

.qa-q-desc { margin: -6px 0 10px; font-size: 13px; color: #8b98a5; line-height: 1.7; white-space: pre-wrap; }
.qa-q-body { padding-left: 0; }
.qa-q-err {
    display: none;
    margin-top: 8px;
    font-size: 13px;
    color: #c0392b;
}
.qa-q.invalid .qa-q-err { display: block; }
.qa-q.invalid .qa-qtxt { color: #c0392b; }

/* 逻辑关系验证态 */
.qa-q.skipped { opacity: .45; }
.qa-q.skipped .qa-qtxt { text-decoration: line-through; }
.qa-logic-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #2c3e7a;
}

/* ---------------- 选项组（单选 / 多选 / 排序） ---------------- */
.qa-opts { border: 1px solid #e4e9f0; border-bottom: none; border-right: none; }
.qa-opts.plain { border: none; }
.qa-opt {
    display: flex;
    align-items: flex-start;
    min-height: 48px;
    border-bottom: 1px solid #e4e9f0;
    border-right: 1px solid #e4e9f0;
    background: #fff;
    cursor: pointer;
    transition: background .12s;
}
.qa-opt:hover { background: #fafbfd; }
.qa-mark {
    flex: 0 0 auto;
    width: 18px; height: 18px;
    margin: 15px 10px 0 12px;
    border: 1px solid #a3aeb9;
    background: #fff;
    box-shadow: 0 1px 0 0 rgba(0, 0, 0, .08);
    border-radius: 50%;
    position: relative;
    transition: all .1s;
}
.qa-mark.check { border-radius: 3px; }
.qa-opt.checked .qa-mark.radio { border: 5px solid #2c3e7a; }
.qa-opt.checked .qa-mark.check { background: #2c3e7a; border-color: #2c3e7a; }
.qa-opt.checked .qa-mark.check::after {
    content: '';
    position: absolute; left: 5px; top: 1px;
    width: 4px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.qa-opt-label { flex: 1 1 auto; padding: 13px 10px 13px 0; font-size: 16px; color: #5b6b7c; min-height: 36px; word-break: break-word; }
.qa-opt.checked .qa-opt-label { color: #2c3e50; }

/* 横向多列 */
.qa-opts.cols { display: flex; flex-wrap: wrap; border: none; }
.qa-opts.cols .qa-opt { width: 50%; }
.qa-opts.cols.col3 .qa-opt { width: 33.333%; }
.qa-opts.cols .qa-opt { border: none; min-height: 40px; }
.qa-opts.cols .qa-mark { margin-top: 11px; }

/* ---------------- 量表 / NPS ---------------- */
.qa-scale { padding: 4px 0 0; }
.qa-scale-legend { display: flex; justify-content: space-between; font-size: 14px; color: #5b6b7c; }
.qa-scale-track {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    position: relative;
    overflow-x: auto;
    padding-bottom: 2px;
}
.qa-scale-track::before {
    content: '';
    position: absolute; left: 13px; right: 13px; top: 13px;
    border-top: 1px solid #e4e9f0;
}
.qa-dot { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 0 0 auto; position: relative; z-index: 1; }
.qa-dot-btn {
    width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid #ced7e0; background: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: #5b6b7c; cursor: pointer;
    transition: all .12s;
}
.qa-dot-btn:hover { border-color: #2c3e7a; color: #2c3e7a; }
.qa-dot.selected .qa-dot-btn { background: #2c3e7a; border-color: #2c3e7a; color: #fff; }
.qa-dot-anchor { font-size: 11px; color: #a3aeb9; text-align: center; line-height: 1.3; max-width: 72px; }

/* ---------------- 评分（星级） ---------------- */
.qa-stars { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.qa-star { font-size: 30px; line-height: 1; color: #d8dfe7; cursor: pointer; user-select: none; transition: color .12s, transform .12s; }
.qa-star:hover { transform: scale(1.08); }
.qa-star.on { color: #e0a23a; }
.qa-star-value { margin-left: 6px; font-size: 13px; color: #8b98a5; }

/* ---------------- 填空 ---------------- */
.qa-input, .qa-textarea, .qa-select {
    width: 100%;
    border: 1px solid #ced7e0;
    border-radius: 2px;
    background: #fff;
    color: #2c3e50;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color .12s;
}
.qa-input, .qa-select { height: 44px; padding: 0 12px; }
.qa-textarea { min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.7; }
.qa-input:focus, .qa-textarea:focus, .qa-select:focus { border-color: #2c3e7a; }
.qa-input::placeholder, .qa-textarea::placeholder { color: #b6bfc9; }
.qa-select { max-width: 320px; cursor: pointer; }

.qa-gapfill { display: flex; flex-direction: column; gap: 10px; }
.qa-gap-row { display: flex; align-items: center; gap: 8px; }
.qa-gap-row b { flex: 0 0 auto; font-weight: 400; color: #8b98a5; font-size: 14px; min-width: 20px; }
.qa-gap-row .qa-input { flex: 1 1 auto; }

/* ---------------- 排序 ---------------- */
.qa-sort { display: flex; flex-direction: column; gap: 8px; }
.qa-sort-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    border: 1px solid #e4e9f0;
    border-radius: 2px;
    background: #fff;
}
.qa-sort-row .qa-sort-no { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: #2c3e7a; color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.qa-sort-row .qa-sort-txt { flex: 1 1 auto; font-size: 15px; color: #2c3e50; }
.qa-sort-btn {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    border: 1px solid #ced7e0; border-radius: 2px; background: #fff;
    color: #5b6b7c; cursor: pointer; font-size: 14px; line-height: 1;
}
.qa-sort-btn:hover { border-color: #2c3e7a; color: #2c3e7a; }

/* ---------------- 矩阵 ---------------- */
.qa-matrix-wrap { width: 100%; overflow-x: auto; }
.qa-matrix { width: 100%; border-collapse: collapse; min-width: 420px; }
.qa-matrix th, .qa-matrix td { border: 1px solid #e4e9f0; padding: 10px 8px; font-size: 13px; text-align: center; }
.qa-matrix th { background: #f7f9fb; font-weight: 600; color: #5b6b7c; }
.qa-matrix td.qa-mx-row { text-align: left; background: #fbfbfb; color: #5b6b7c; font-size: 14px; }
.qa-mx-cell { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.qa-mx-cell input { width: 16px; height: 16px; accent-color: #2c3e7a; cursor: pointer; }

/* ---------------- 段落说明 ---------------- */
.qa-para {
    padding: 14px 16px;
    background: #f7f9fb;
    border-left: 3px solid #2c3e7a;
    border-radius: 2px;
    color: #5b6b7c;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* ---------------- 底部提交 ---------------- */
.qa-foot { margin-top: 28px; }
.qa-agree {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 13px; color: #8b98a5; margin-bottom: 14px; cursor: pointer;
}
.qa-agree input { margin-top: 3px; accent-color: #2c3e7a; width: 15px; height: 15px; }
.qa-submit {
    display: block;
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 2px;
    background: #2c3e7a;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}
.qa-submit:hover { background: #1a264f; }
.qa-submit:disabled { background: #c6cfe4; cursor: not-allowed; }
.qa-footnote { margin-top: 14px; text-align: center; font-size: 12px; color: #b6bfc9; }

/* ---------------- 分页导航（有「分页栏」时启用） ---------------- */
.qa-pagenav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.qa-navbtn {
    flex: 1 1 auto;
    height: 46px;
    border: 1px solid #ced7e0;
    border-radius: 2px;
    background: #fff;
    color: #5b6b7c;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: all .15s;
}
.qa-navbtn:hover:not(:disabled) { border-color: #2c3e7a; color: #2c3e7a; }
.qa-navbtn:disabled { color: #cdcdcd; cursor: not-allowed; }
.qa-navbtn.primary {
    border-color: #2c3e7a;
    background: #2c3e7a;
    color: #fff;
}
.qa-navbtn.primary:hover:not(:disabled) { background: #1a264f; border-color: #1a264f; color: #fff; }
.qa-pageind {
    flex: 0 0 auto;
    font-size: 13px;
    color: #8b98a5;
    white-space: nowrap;
}
.qa-pageind b { color: #2c3e7a; font-size: 15px; }

/* ---------------- 题干配图（实验图片材料） ---------------- */
/* 紧贴标题、居中，属于题干的一部分，位于题目说明之上 */
.qa-stemimg {
    margin: 12px auto;
    text-align: center;
}
.qa-stemimg img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 2px;
    background: #fafbfc;
    border: 1px solid #eef1f5;
}

/* ---------------- 图片评分题：居中大图 + 逐维度评分 ---------------- */
.qa-imggrid { display: block; }
.qa-imgitem {
    border: 1px solid var(--st-line);
    border-radius: 4px;
    padding: 16px 14px 18px;
    background: #fff;
    margin-bottom: 18px;
}
.qa-imgitem:last-child { margin-bottom: 0; }
/* 居中大图：撑满可用宽度，特别高的图按 460px 收住 */
.qa-imgbox {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--st-bg-2);
    border-radius: 3px;
    overflow: hidden;
    padding: 8px;
}
.qa-imgbox img {
    max-width: 100%;
    max-height: 460px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.qa-imgname {
    margin: 10px 0 4px;
    font-size: 13px;
    color: var(--st-ink-2);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 一个维度一排 */
.qa-dimrow {
    padding: 10px 0 2px;
    border-top: 1px dashed var(--st-line);
    margin-top: 8px;
}
.qa-dimrow:first-of-type { border-top: none; margin-top: 6px; }
.qa-dimname {
    font-size: 13px;
    color: var(--st-ink);
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}
.qa-dimctl { padding: 0 2px; }
.qa-imgscale { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.qa-imgdot {
    width: 30px; height: 30px;
    border: 1px solid var(--st-line-2); border-radius: 50%; background: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--st-ink-2); cursor: pointer;
    transition: all .12s;
}
.qa-imgdot:hover { border-color: var(--st-brand); color: var(--st-brand); }
.qa-imgdot.selected { background: var(--st-brand); border-color: var(--st-brand); color: #fff; }
.qa-imglegend {
    display: flex; justify-content: space-between;
    margin-top: 5px; font-size: 11px; color: var(--st-ink-3);
}
.qa-imgstars { display: flex; align-items: center; justify-content: center; gap: 3px; flex-wrap: wrap; }
.qa-imgstar { font-size: 24px; line-height: 1; color: #d8dfe7; cursor: pointer; user-select: none; }
.qa-imgstar.on { color: var(--st-gold); }
.qa-imgstar-val { margin-left: 8px; font-size: 12px; color: var(--st-ink-3); }
.qa-hint { font-size: 13px; color: var(--st-ink-3); }

/* 手机端：图给足宽度，刻度收紧一点 */
@media (max-width: 560px) {
    .qa-imgitem { padding: 12px 10px 14px; }
    .qa-imgbox { padding: 4px; }
    .qa-imgbox img { max-height: 380px; }
    .qa-imgscale { gap: 4px; }
    .qa-imgdot { width: 28px; height: 28px; font-size: 12px; }
    .qa-stemimg { max-width: 100% !important; }
}

/* ---------------- 交卷后的「分数解释」界面 ---------------- */
.score-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}
.score-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(44, 62, 122, .08);
    overflow: hidden;
}
.score-hero {
    padding: 30px 24px 24px;
    text-align: center;
    background: linear-gradient(180deg, var(--st-brand-bg) 0%, #fff 100%);
    border-bottom: 1px solid var(--st-line);
}
.score-hero-icon { font-size: 34px; line-height: 1; margin-bottom: 10px; }
.score-hero h1 { margin: 0 0 6px; font-size: 22px; color: var(--st-brand); }
.score-hero p { margin: 0; font-size: 13px; color: var(--st-ink-3); }
.score-hero-meta { margin-top: 6px !important; font-size: 12px; color: var(--st-ink-4); }

.score-body { padding: 22px 24px 6px; }

.score-thanks {
    padding: 34px 10px;
    text-align: center;
    font-size: 20px;
    color: var(--st-brand);
    letter-spacing: 1px;
}

.score-section-title {
    font-size: 13px;
    color: var(--st-ink-3);
    margin: 6px 0 10px;
    padding-left: 8px;
    border-left: 3px solid var(--st-brand);
}

.score-item {
    border: 1px solid var(--st-line);
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
}
.score-item.is-total {
    border-color: var(--st-brand-line);
    background: var(--st-brand-bg-2);
}
.score-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.score-item-name { font-size: 15px; font-weight: 600; color: var(--st-ink); }
.score-item-num { font-size: 13px; color: var(--st-ink-2); white-space: nowrap; }
.score-item-num b { font-size: 21px; color: var(--st-brand); font-weight: 700; }
.score-item.is-total .score-item-num b { font-size: 26px; }
.score-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--st-line);
    margin: 10px 0 0;
    overflow: hidden;
}
.score-bar i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--st-brand-2), var(--st-brand));
}
.score-item-text {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--st-ink);
    white-space: pre-wrap;
}
.score-item-text.empty { color: var(--st-ink-4); }

.score-note {
    font-size: 12px;
    line-height: 1.8;
    color: var(--st-ink-3);
    margin: 4px 0 14px;
}

.score-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px 22px;
    border-top: 1px solid var(--st-line);
}

@media (max-width: 560px) {
    .score-wrap { padding: 12px 10px 32px; }
    .score-body { padding: 18px 14px 4px; }
    .score-hero { padding: 24px 16px 20px; }
    .score-item.is-total .score-item-num b { font-size: 23px; }
}

/* ---------------- 提示条 ---------------- */
.qa-alert {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 2px;
    font-size: 13px;
    line-height: 1.7;
    background: #fff8e6;
    border: 1px solid #f6e0c0;
    color: #a86b00;
}
.qa-alert.err { background: #fbeaea; border-color: #ffccc7; color: #cf1322; }

/* ---------------- 独立作答页外壳 ---------------- */
/* 受测者从链接/扫码进入时看到的样子：浅灰底 + 居中白卡 */
.qa-standalone {
    background: #f5f7fa;
    min-height: calc(100vh - var(--header-height, 64px));
    padding: 22px 16px 60px;
    margin: -28px -24px -60px;   /* 抵消 .app-wrap 的内边距，让灰底铺满 */
}
.qa-card {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    padding-bottom: 8px;
}
@media (max-width: 720px) {
    .qa-standalone { margin: -16px -12px -40px; padding: 14px 10px 40px; }
}

/* ---------------- 电脑端放宽 ---------------- */
@media (min-width: 720px) {
    .qa-title { font-size: 26px; }
    .qa-inner { padding: 34px 28px 48px; }
}

/* ---------------- 窄屏：多级量表（如 0-10）也要能一行放下 ---------------- */
@media (max-width: 480px) {
    .qa-scale-track { gap: 2px; }
    .qa-dot-btn { width: 24px; height: 24px; font-size: 12px; }
    .qa-dot-anchor { max-width: 54px; font-size: 10px; }
    .qa-scale-legend { font-size: 13px; }
}
