/* 问卷界面重做：聊天里的卡片 + 管理 / 编辑 / 回答 / 揭晓 四个底部弹层。
   只覆盖 .qn-* 的外观，逻辑不变；颜色全部跟随主题（--primary-color / --text-color）。 */

.qn-modepill {
    display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 10px;
    background: rgba(0, 0, 0, .05); color: #6d777a; margin-right: 6px;
}

/* ---------- 聊天里的问卷卡片 ----------
   外层「卡片本体」（背景 / 阴影 / 圆角）只用单个 class 选择器、并且不加 ::before / ::after，
   这样别人做的卡片美化（例如果冻质感）写在 .vote-card 上时仍然生效，不会被我覆盖；
   里面的内容排版用的是 .qn-* 的新 class，不影响外层。 */
.qn-card {
    width: 188px; padding: 11px 12px 10px; border: 0; border-radius: 16px; overflow: hidden;
    background: linear-gradient(160deg, color-mix(in srgb, var(--primary-color, #cee4f1) 34%, #fff) 0%, #fff 64%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .07), 0 0 0 1px rgba(0, 0, 0, .04);
}
.qn-card .qn-quote {
    position: absolute; right: 10px; top: -12px; font-size: 70px; line-height: 1; pointer-events: none;
    font-family: Georgia, 'Times New Roman', serif; color: color-mix(in srgb, var(--primary-color, #cee4f1) 70%, #fff); opacity: .5;
}
.qn-card .qn-top { display: flex; align-items: center; gap: 5px; margin-bottom: 7px; position: relative; z-index: 1; }
.qn-card .qn-tag {
    display: inline-flex; align-items: center; gap: 4px; font-size: calc(10px * var(--app-font-scale, 1)); letter-spacing: .1em;
    padding: 2px 8px 2px 6px; border-radius: 9px; background: var(--primary-color, #cee4f1); color: var(--text-color, #2a3032);
}
.qn-card .qn-modepill { font-size: calc(10px * var(--app-font-scale, 1)); margin-right: 0; padding: 2px 7px; }
.qn-card .qn-title {
    position: relative; z-index: 1; font-weight: 700; font-size: calc(14px * var(--app-font-scale, 1)); line-height: 1.35;
    color: var(--text-color, #2a3032); word-break: break-word;
}
.qn-card .qn-meta {
    margin: 6px 0 9px; font-size: calc(10px * var(--app-font-scale, 1)); color: #8a9496; position: relative; z-index: 1;
}
.qn-card .qn-action-row { position: relative; z-index: 1; }
.qn-card .qn-action { padding: 6px; border-radius: 14px; font-size: calc(12px * var(--app-font-scale, 1)); }
.qn-card .message-time { position: relative; z-index: 1; }

/* ---------- 底部弹层通用 ---------- */
.modal-overlay.qn-overlay { align-items: center; justify-content: center; background: rgba(20, 24, 26, .42); }
.qn-overlay .qn-sheet {
    width: 90%; max-width: 400px; box-sizing: border-box; max-height: 84%; padding: 0; display: flex; flex-direction: column;
    border-radius: 26px; background: #fbfbfc; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
    animation: qnPop .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes qnPop { from { transform: scale(.94) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.qn-sheet-head { flex: none; padding: 20px 20px 6px; }
.qn-grab { display: none; }
.qn-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qn-sheet .qn-head-row h3 {
    margin: 0; text-align: left; font-size: 22px; font-weight: 700; line-height: 1.25; color: var(--text-color, #2a3032); word-break: break-word;
}
  .qn-head-sub:empty { display: none; }
.qn-head-sub { font-size: 12px; color: #9aa3a6; margin-top: 4px; letter-spacing: .02em; }
.qn-close {
    flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #eff1f2; color: #6d777a;
    font-size: 20px; line-height: 32px; padding: 0; cursor: pointer;
}
.qn-sheet-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 20px 18px; }
.qn-sheet-foot { flex: none; display: flex; gap: 10px; padding: 10px 20px 14px; background: #fbfbfc; box-shadow: 0 -8px 20px rgba(0, 0, 0, .04); }
.qn-btn {
    flex: 1; height: 46px; border: 0; border-radius: 23px; background: var(--text-color, #2a3032); color: #fff;
    font-size: 15px; letter-spacing: .06em; font-family: var(--font-family); cursor: pointer; box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}
.qn-btn.ghost { background: #eceff0; color: #5b6568; box-shadow: none; }
.qn-btn:active { transform: scale(.98); }
.qn-section-title { font-size: 12px; letter-spacing: .1em; color: #a3abae; margin: 22px 0 10px; }

/* ---------- 管理 ---------- */
.qn-new {
    width: 100%; height: 54px; border: 1.5px dashed color-mix(in srgb, var(--text-color, #2a3032) 28%, #fff); border-radius: 18px; background: transparent;
    color: var(--text-color, #2a3032); font-size: 15px; font-family: var(--font-family); letter-spacing: .06em; cursor: pointer;
}
.qn-new:active { background: rgba(0, 0, 0, .03); }
.qn-empty { text-align: center; color: #a3abae; padding: 22px 0 8px; font-size: 14px; }
.qn-empty svg { display: block; margin: 0 auto 8px; color: #d3d8da; }
.qn-empty small { display: block; margin-top: 4px; font-size: 12px; color: #b5bcbf; }
.qn-draft-item, .qn-done-item {
    display: flex; align-items: center; gap: 10px; padding: 14px 14px; border-radius: 18px; background: #fff; margin-bottom: 10px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .03), 0 0 0 1px rgba(0, 0, 0, .045);
}
.qn-draft-title { font-weight: 700; font-size: 15px; color: var(--text-color, #2a3032); }
.qn-draft-sub { display: flex; align-items: center; font-size: 12px; color: #9aa3a6; margin-top: 6px; }
.qn-draft-actions { gap: 6px; align-items: center; }
.qn-draft-actions button { border-radius: 14px; padding: 6px 11px; background: #f1f3f4; color: #5b6568; font-size: 12px; }
.qn-draft-actions button[data-qn-draft-act="send"] { background: var(--text-color, #2a3032); color: #fff; }
.qn-draft-actions button.qn-del { background: transparent; color: #d98c89; padding: 6px 4px; }
.qn-done-arrow { color: #c3c9cb; font-size: 20px; }
.qn-done-item .qn-draft-sub { margin-top: 4px; }

/* ---------- 编辑 ---------- */
.qn-field { margin-bottom: 20px; }
.qn-field > label { display: block; font-size: 12px; letter-spacing: .08em; color: #8a9496; margin-bottom: 8px; }
.qn-field input[type="text"] {
    width: 100%; height: 46px; box-sizing: border-box; padding: 0 14px; border: 0; border-radius: 14px; background: #f1f3f4;
    font-size: 15px; font-family: var(--font-family); color: #2f383b;
}
.qn-field input[type="text"]:focus, .qn-answer-input:focus { outline: 2px solid color-mix(in srgb, var(--primary-color, #cee4f1) 90%, #000 10%); outline-offset: 0; background: #fff; }
.qn-hint { font-size: 12px; color: #a3abae; margin: -2px 0 10px; line-height: 1.6; }
.qn-mode-row { gap: 10px; }
.qn-mode-opt { border: 0 !important; border-radius: 16px !important; background: #f1f3f4; padding: 12px 12px !important; position: relative; }
.qn-mode-opt input { position: absolute; opacity: 0; }
.qn-mode-opt:has(input:checked) { background: var(--text-color, #2a3032); }
.qn-mode-opt:has(input:checked) b { color: #fff; }
.qn-mode-opt:has(input:checked) small { color: rgba(255, 255, 255, .7); }
.qn-mode-opt b { font-size: 14px; }
.qn-mode-opt small { font-size: 11px; }
.qn-editor-row { gap: 8px; }
.qn-editor-no {
    flex: none; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--primary-color, #cee4f1) 60%, #fff);
    color: var(--text-color, #2a3032); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.qn-editor-q {
    height: 44px; padding: 0 14px !important; border: 0 !important; border-radius: 14px !important; background: #f1f3f4; font-size: 14px;
}
.qn-editor-q:focus { outline: 2px solid color-mix(in srgb, var(--primary-color, #cee4f1) 90%, #000 10%); background: #fff; }
.qn-editor-del { background: transparent; color: #b5bcbf; font-size: 22px; }
.qn-addq {
    width: 100%; margin-top: 10px; height: 42px; border: 0; border-radius: 14px; background: #f1f3f4; color: #5b6568;
    font-size: 14px; font-family: var(--font-family); cursor: pointer;
}

/* ---------- 回答 ---------- */
.qn-progress { flex: none; display: flex; align-items: center; gap: 10px; padding: 4px 20px 6px; }
.qn-progress-bar { flex: 1; height: 5px; border-radius: 3px; background: #e8ebec; overflow: hidden; }
.qn-progress-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--text-color, #2a3032); transition: width .25s ease; }
.qn-progress span { font-size: 12px; color: #8a9496; font-variant-numeric: tabular-nums; }
.qn-qcard { background: #fff; border-radius: 20px; padding: 14px 14px 12px; margin-bottom: 12px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .045); }
.qn-q-label { display: flex !important; align-items: flex-start; gap: 10px; margin: 0 0 10px !important; font-size: 15px; font-weight: 600; line-height: 1.45; color: #2f383b; }
.qn-q-num {
    flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--text-color, #2a3032); color: #fff;
    font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.qn-q-body { min-width: 0; }
.qn-answer-input {
    border: 0 !important; background: #f4f5f6; border-radius: 14px !important; padding: 12px 14px !important; font-size: 14px; line-height: 1.6; min-height: 70px;
}

/* ---------- 揭晓（答案沿用原来的样式：不做气泡，一题一块，名字小标签 + 文字） ---------- */
.qn-result-item { padding: 12px 0; border-bottom: 1px solid #eee; margin: 0; background: transparent; border-radius: 0; box-shadow: none; }
.qn-result-item:last-child { border-bottom: none; }
.qn-result-q { font-weight: 600; font-size: 14px; margin-bottom: 6px; display: block !important; }
.qn-result-q .qn-q-num { width: auto; height: auto; background: transparent; color: inherit; font-size: inherit; display: inline; margin: 0 4px 0 0; }
.qn-result-a { font-size: 13px; line-height: 1.5; margin-bottom: 4px; word-break: break-word; }
.qn-result-a .qn-who {
    display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 7px; margin-right: 6px;
    background: var(--primary-color, #cee4f1); color: var(--text-color, #2a3032);
}
.qn-result-a .qn-bi, .qn-result-a .qn-bi-orig, .qn-result-q .qn-bi, .qn-result-q .qn-bi-orig { display: inline; }
.qn-result-q .qn-q-num::after { content: '.'; }

/* ---- 紧凑版：弹窗整体、字体、按钮缩小 ---- */
.qn-overlay .qn-sheet { width: 84%; max-width: 330px; max-height: 76%; border-radius: 22px; }
.qn-sheet-head { padding: 15px 16px 4px; }
.qn-sheet .qn-head-row h3 { font-size: 17px; }
.qn-head-sub { font-size: 10px; margin-top: 3px; }
.qn-close { width: 26px; height: 26px; font-size: 17px; line-height: 26px; }
.qn-sheet-body { padding: 8px 16px 12px; }
.qn-sheet-foot { gap: 8px; padding: 8px 16px 11px; }
.qn-btn { height: 36px; border-radius: 18px; font-size: 13px; box-shadow: 0 5px 12px rgba(0, 0, 0, .12); }
.qn-section-title { font-size: 10px; margin: 16px 0 8px; }
.qn-new { height: 42px; border-radius: 14px; font-size: 13px; }
.qn-empty { font-size: 12px; padding: 16px 0 6px; }
.qn-empty small { font-size: 10px; }
.qn-draft-item, .qn-done-item { padding: 10px 11px; border-radius: 14px; margin-bottom: 8px; }
.qn-draft-title { font-size: 13px; }
.qn-draft-sub { font-size: 10px; margin-top: 4px; }
.qn-draft-actions button { border-radius: 11px; padding: 4px 9px; font-size: 11px; }
.qn-done-arrow { font-size: 17px; }
.qn-field { margin-bottom: 15px; }
.qn-field > label { font-size: 10px; margin-bottom: 6px; }
.qn-field input[type="text"] { height: 36px; border-radius: 11px; font-size: 13px; padding: 0 11px; }
.qn-hint { font-size: 10px; }
.qn-mode-opt { border-radius: 13px !important; padding: 9px 10px !important; }
.qn-mode-opt b { font-size: 12px; }
.qn-mode-opt small { font-size: 10px; }
.qn-editor-no { width: 20px; height: 20px; font-size: 10px; }
.qn-editor-q { height: 36px; border-radius: 11px !important; font-size: 13px; padding: 0 11px !important; }
.qn-editor-del { font-size: 19px; }
.qn-addq { height: 34px; border-radius: 11px; font-size: 12px; margin-top: 8px; }
.qn-progress { padding: 3px 16px 4px; }
.qn-progress span { font-size: 10px; }
.qn-qcard { border-radius: 16px; padding: 11px 11px 9px; margin-bottom: 9px; }
.qn-q-label { font-size: 13px; gap: 8px; }
.qn-q-num { width: 20px; height: 20px; font-size: 10px; }
.qn-answer-input, .qn-q-body textarea { font-size: 12px; min-height: 58px; border-radius: 12px !important; padding: 9px 11px !important; }
.qn-result-q { font-size: 12px; }
.qn-result-a { font-size: 11px; }
.qn-who { font-size: 9px; }
