/*
═══════════════════════════════════════════════════════════════
   NIGHT MURMUR · QUIZ 01 轉變
   ——前台樣式。全部吃主題的 CSS 變數（--bone / --plum / --twilight…），
     所以後台換色、切淺色模式，測驗會跟著變，不用改這裡。
     沒有硬寫死任何顏色。
═══════════════════════════════════════════════════════════════
*/

.nmq01,
.nmq01-result {
    --q-gap: 28px;
    max-width: var(--max-narrow);
    margin: 0 auto;
    padding: 0 24px;
    color: var(--twilight);
    font-family: var(--ff-cn);
    font-weight: 300;
    line-height: 1.8;
}
.nmq01.lang-en,
.nmq01-result.lang-en { font-family: var(--ff-en); }

.nmq01 [hidden] { display: none !important; }


/* ─── 共用小元件 ──────────────────────────────── */
.nmq01-eyebrow {
    font-family: var(--ff-m);
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--mist);
    margin: 0 0 12px;
}

.nmq01-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--ff-m);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 14px 28px;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    transition: all .25s ease;
}
.nmq01-btn:disabled { opacity: .3; cursor: not-allowed; }

.nmq01-btn-primary {
    background: var(--plum);
    color: var(--bone);
}
.nmq01-btn-primary:not(:disabled):hover {
    background: var(--plum-hi);
    filter: brightness(1.12);
}

.nmq01-btn-ghost {
    color: var(--mist);
    border: 1px solid var(--linen-2);
}
.nmq01-btn-ghost:hover { color: var(--twilight); }

.nmq01-btn-wide { width: 100%; }

.nmq01-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--mist);
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    font-family: inherit;
}
.nmq01-link-btn:hover { color: var(--plum); }


/* ─── 開場 ────────────────────────────────────── */
.nmq01-intro {
    padding: 80px 0 100px;
    text-align: center;
}
.nmq01-intro-inner { max-width: var(--max-prose, 680px); margin: 0 auto; }

.nmq01-title {
    font-family: var(--ff-d);
    font-weight: 200;
    font-size: clamp(40px, 7vw, 76px);
    line-height: 1.05;
    letter-spacing: -.025em;
    margin: 0 0 8px;
    color: var(--twilight);
}
.lang-en .nmq01-title { font-style: italic; }

.nmq01-sub {
    font-family: var(--ff-d);
    font-size: clamp(17px, 2.4vw, 22px);
    font-weight: 300;
    color: var(--mist);
    margin: 0 0 40px;
}
.lang-en .nmq01-sub { font-style: italic; }

.nmq01-opening {
    text-align: left;
    border-left: 1px solid var(--linen-2);
    padding-left: 22px;
    margin: 0 0 32px;
}
.nmq01-opening p {
    font-size: 15px;
    line-height: 1.9;
    color: var(--mist);
    margin: 0 0 14px;
}
.nmq01-opening p:last-child { margin-bottom: 0; }

.nmq01-meta {
    font-family: var(--ff-m);
    font-size: 11px;
    letter-spacing: .16em;
    color: var(--mist-soft);
    margin: 0 0 32px;
}


/* ─── 進度 ────────────────────────────────────── */
.nmq01-quiz { padding: 40px 0 72px; }

.nmq01-progress { margin-bottom: 40px; }
.nmq01-progress-bar {
    height: 2px;
    background: var(--linen-2);
    overflow: hidden;
}
.nmq01-progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--plum);
    transition: width .35s ease;
}
.nmq01-progress-label {
    font-family: var(--ff-m);
    font-size: 11px;
    letter-spacing: .14em;
    color: var(--mist);
    margin: 10px 0 0;
}


/* ─── 題目 ────────────────────────────────────── */
.nmq01-q { animation: nmq01-fade .3s ease; }
@keyframes nmq01-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.nmq01-q-image { margin-bottom: 24px; }
.nmq01-q-image img { width: 100%; height: auto; display: block; }

.nmq01-q-text {
    font-size: clamp(19px, 4.4vw, 23px);
    line-height: 1.7;
    margin: 0 0 10px;
    font-weight: 400;
}
.nmq01-q-instruction {
    font-size: 13px;
    color: var(--mist);
    margin: 0 0 22px;
}
.nmq01-q-text + .nmq01-options,
.nmq01-q-text + .nmq01-scale5,
.nmq01-q-text + .nmq01-rank { margin-top: 26px; }


/* 單選類選項 */
.nmq01-options { display: flex; flex-direction: column; gap: 10px; }

.nmq01-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 17px 20px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.65;
    font-weight: 300;
    color: inherit;
    background: none;
    border: 1px solid var(--linen);
    border-radius: 2px;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}
.nmq01-option:hover { border-color: var(--mist); }
.nmq01-option.is-selected {
    border-color: var(--plum);
    background: color-mix(in srgb, var(--plum) 12%, transparent);
}


/* 1–5 量尺 */
.nmq01-scale5 {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.nmq01-scale-end {
    font-size: 12px;
    color: var(--mist);
    flex: 0 0 auto;
}
.nmq01-scale-row {
    display: flex;
    gap: 10px;
    flex: 1 1 auto;
    justify-content: center;
}
.nmq01-scale-dot {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--linen);
    background: none;
    color: var(--mist);
    font-family: var(--ff-m);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s ease;
}
.nmq01-scale-dot:hover { border-color: var(--mist); color: var(--twilight); }
.nmq01-scale-dot.is-selected {
    border-color: var(--plum);
    background: var(--plum);
    color: var(--bone);
}


/* 排序題 */
.nmq01-rank-hint {
    font-size: 12px;
    color: var(--mist);
    margin: 0 0 14px;
}
.nmq01-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nmq01-rank-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 16px;
    border: 1px solid var(--linen);
    border-radius: 2px;
    background: color-mix(in srgb, var(--plum) 4%, transparent);
    cursor: grab;
}
.nmq01-rank-item.is-dragging { opacity: .45; }
.nmq01-rank-num {
    flex: 0 0 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
    background: var(--plum);
    color: var(--bone);
    font-family: var(--ff-m);
    font-size: 12px;
}
.nmq01-rank-text {
    flex: 1 1 auto;
    font-size: 14.5px;
    line-height: 1.6;
}
.nmq01-rank-ctrls {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nmq01-rank-move {
    width: 30px;
    height: 22px;
    border: 1px solid var(--linen);
    background: none;
    color: var(--mist);
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    border-radius: 2px;
}
.nmq01-rank-move:disabled { opacity: .25; cursor: not-allowed; }
.nmq01-rank-move:not(:disabled):hover { color: var(--plum); border-color: var(--plum); }


/* 導覽 */
.nmq01-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 36px;
}


/* ─── Email Gate ─────────────────────────────── */
.nmq01-gate { padding: 48px 0 80px; }
.nmq01-gate-inner { max-width: 520px; }
.nmq01-gate-lede {
    font-size: 14.5px;
    color: var(--mist);
    line-height: 1.85;
    margin: 0 0 32px;
}

.nmq01-field { margin-bottom: 20px; }
.nmq01-field label {
    display: block;
    font-family: var(--ff-m);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--mist);
    margin-bottom: 7px;
}
.nmq01-field input,
.nmq01-field select {
    width: 100%;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    color: inherit;
    background: transparent;
    border: 1px solid var(--linen);
    border-radius: 2px;
}
.nmq01-field input:focus,
.nmq01-field select:focus {
    outline: none;
    border-color: var(--plum);
}
.nmq01-field select option { color: #111; }

.nmq01-err {
    display: block;
    font-size: 12px;
    color: var(--clay);
    margin-top: 5px;
    min-height: 1em;
}

.nmq01-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--mist);
    margin: 18px 0 4px;
    cursor: pointer;
}
.nmq01-check input {
    flex: 0 0 auto;
    margin-top: 4px;
    accent-color: var(--plum);
}
.nmq01-check-optional { margin-bottom: 28px; }

.nmq01-form-error {
    margin-top: 14px;
    font-size: 13px;
    color: var(--clay);
}


/* ─── 送出過場 ───────────────────────────────── */
.nmq01-loading {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nmq01-loading-inner { text-align: center; color: var(--mist); }
.nmq01-moon {
    width: 44px;
    height: 44px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--plum);
    animation: nmq01-breathe 2.6s ease-in-out infinite;
}
@keyframes nmq01-breathe {
    0%, 100% { opacity: .35; transform: scale(.9); }
    50%      { opacity: 1;   transform: scale(1.05); }
}


/* ═══════════════════════════════════════════════
   結果頁
   ═══════════════════════════════════════════════ */
.nmq01-result { padding: 20px 0 90px; }

/* 01 視覺 + 金句 */
.nmq01-r-hero { text-align: center; padding: 30px 0 12px; }

.nmq01-r-visual { margin: 0 auto 26px; max-width: 340px; }
.nmq01-r-visual.has-echo { margin-bottom: 52px; }
.nmq01-r-visual img,
.nmq01-r-visual video { width: 100%; height: auto; display: block; }
.nmq01-r-embed {
    position: relative;
    padding-top: 100%;
}
.nmq01-r-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.nmq01-r-quote {
    font-family: var(--ff-d);
    font-style: italic;
    font-size: clamp(22px, 5.4vw, 30px);
    line-height: 1.6;
    color: var(--bronze);
    margin: 0 auto;
    max-width: 20em;
}

.nmq01-r-audio {
    margin-top: 22px;
    background: none;
    border: 1px solid var(--linen);
    border-radius: 30px;
    padding: 8px 20px;
    font-family: var(--ff-m);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--mist);
    cursor: pointer;
}
.nmq01-r-audio.is-playing { color: var(--plum); border-color: var(--plum); }

/* 02 現況 */
.nmq01-r-status { padding: 30px 0 6px; }
.nmq01-r-stage {
    font-family: var(--ff-d);
    font-style: italic;
    font-size: 21px;
    font-weight: 500;
    color: var(--plum);
    margin: 0 0 14px;
}
.nmq01-r-retake {
    font-size: 12.5px;
    color: var(--mist);
    margin: -6px 0 16px;
}
.nmq01-r-body {
    font-size: 15.5px;
    line-height: 1.95;
    margin: 0 0 16px;
}
.nmq01-r-body--muted {
    font-size: 14px;
    color: var(--mist);
    line-height: 1.9;
}
.nmq01-r-note {
    font-size: 13.5px;
    color: var(--bronze);
    font-style: italic;
    margin: 0 0 8px;
}

.nmq01-r-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--linen-2), transparent);
    margin: 30px 0;
}

/* 03 + 04 */
.nmq01-r-leadin {
    font-family: var(--ff-d);
    font-style: italic;
    font-size: 17px;
    color: var(--bronze);
    margin: 0 0 12px;
}

/* 05 + 06 合成一張卡 */
.nmq01-r-card-wrap { padding: 4px 0; }
.nmq01-r-card {
    border: 1px solid var(--linen-2);
    border-radius: 16px;
    padding: 26px 24px;
    background: color-mix(in srgb, var(--plum) 5%, transparent);
}
.nmq01-r-direction {
    font-family: var(--ff-d);
    font-style: italic;
    font-size: 19px;
    line-height: 1.65;
    margin: 0 0 16px;
}
.nmq01-r-closing {
    font-size: 14px;
    line-height: 1.9;
    color: var(--mist);
    margin: 0;
}

/* 07 安全閥——比照金句的質感收尾 */
.nmq01-r-valve {
    text-align: center;
    padding: 42px 0 34px;
}
.nmq01-r-valve p {
    font-family: var(--ff-d);
    font-style: italic;
    font-size: clamp(16px, 4vw, 19px);
    line-height: 1.85;
    color: var(--bronze);
    margin: 0 auto;
    max-width: 22em;
}

/* 分享 */
.nmq01-r-share {
    border-top: 1px solid var(--linen-2);
    padding: 30px 0 8px;
    text-align: center;
}
.nmq01-r-share-title {
    font-family: var(--ff-m);
    font-size: 11px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--mist);
    margin: 0 0 16px;
}
.nmq01-r-share-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.nmq01-share-btn {
    padding: 11px 20px;
    font-family: var(--ff-m);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--mist);
    background: none;
    border: 1px solid var(--linen);
    border-radius: 2px;
    cursor: pointer;
    transition: all .2s ease;
}
.nmq01-share-btn:hover { color: var(--plum); border-color: var(--plum); }
.nmq01-share-btn:disabled { opacity: .4; cursor: wait; }

.nmq01-share-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--linen);
    border-radius: 50%;
    background: none;
    color: var(--mist);
    cursor: pointer;
    transition: all .2s ease;
}
.nmq01-share-icon:hover { color: var(--plum); border-color: var(--plum); }

.nmq01-r-emailed {
    font-size: 12.5px;
    color: var(--mist);
    margin: 18px 0 6px;
}

/* CTA */
.nmq01-r-cta {
    display: grid;
    gap: 12px;
    margin-top: 40px;
}
.nmq01-cta-card {
    display: block;
    padding: 20px 22px;
    border: 1px solid var(--linen-2);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: border-color .22s ease, background .22s ease;
}
.nmq01-cta-card:hover {
    border-color: var(--plum);
    background: color-mix(in srgb, var(--plum) 7%, transparent);
}
.nmq01-cta-title {
    display: block;
    font-size: 15.5px;
    margin-bottom: 5px;
}
.nmq01-cta-sub {
    display: block;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--mist);
}

/* 分享圖彈窗 */
.nmq01-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.86);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}
.nmq01-modal-inner {
    max-width: 420px;
    width: 100%;
    text-align: center;
}
.nmq01-modal img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}
.nmq01-modal-hint {
    font-size: 12.5px;
    color: rgba(255,255,255,.65);
    margin: 12px 0 0;
}
.nmq01-modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}
.nmq01-modal-actions .nmq01-btn-ghost {
    color: rgba(255,255,255,.7);
    border-color: rgba(255,255,255,.22);
}

/* 找不到結果 */
.nmq01-notfound {
    padding: 60px 0;
    text-align: center;
    color: var(--mist);
}


/* ─── 手機 ────────────────────────────────────── */
@media (max-width: 600px) {
    .nmq01, .nmq01-result { padding: 0 18px; }
    .nmq01-intro { padding: 40px 0 60px; }
    .nmq01-scale-row { gap: 7px; }
    .nmq01-scale-dot { width: 42px; height: 42px; }
    .nmq01-scale5 { gap: 8px; }
    .nmq01-scale-end { font-size: 11px; }
    .nmq01-r-card { padding: 22px 18px; }
}

/* ─── 跨測驗：最近一次的原型，疊在階段視覺上 ──────
   角色站在階段裡的感覺——所以是疊上去，不是排在下面。
   放在偏下、略微超出底緣，像是站在那個空間裡而不是浮在正中央。 */
.nmq01-r-visual.has-echo { position: relative; }

.nmq01-r-echo {
    position: absolute;
    left: 50%;
    /* 底部對齊階段圖的底緣——角色是站在那個階段裡，不是浮在上面 */
    bottom: 0;
    transform: translateX(-50%);
    width: 68%;
    max-width: 260px;
    z-index: 2;
    /* 角色本身自帶光暈，這裡再補一點讓它跟底下的階段圖分得開 */
    filter: drop-shadow(0 6px 22px rgba(0,0,0,.45));
}
.nmq01-r-echo img,
.nmq01-r-echo video { width: 100%; height: auto; display: block; }
.nmq01-r-echo-embed { position: relative; padding-top: 100%; }
.nmq01-r-echo-embed iframe {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* 貼在角色腳下。top:100% 是「這個框的下緣」，
   所以不管角色多高，標籤永遠緊貼在它下面。 */
.nmq01-r-echo-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    margin: 10px 0 0;
    font-family: var(--ff-m);
    font-size: 11px;
    letter-spacing: .1em;
    line-height: 1.7;
    color: var(--mist-soft);
}


/* ─── 測驗首頁的開場圖（選填）────────────────
   放在標題與說明文字之間。後台沒上傳就整塊不輸出，
   所以這裡不需要處理「沒有圖」的情況。 */
.nmq01-intro-image {
    margin: 26px auto 30px;
    max-width: 420px;
}
.nmq01-intro-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
}
@media (max-width: 600px) {
    .nmq01-intro-image { margin: 20px auto 24px; max-width: 100%; }
}


/* 開場媒體（影片與嵌入） */
.nmq01-intro-image video { display: block; width: 100%; border-radius: inherit; }
.nmq01-intro-embed { position: relative; aspect-ratio: 16 / 9; }
.nmq01-intro-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }


/* 開場媒體比例（影片/嵌入外框；圖片不受影響） */
.nmq01-intro-image.nmq01-ratio-1-1  .nmq01-intro-embed,
.nmq01-intro-image.nmq01-ratio-1-1  video { aspect-ratio: 1 / 1;  max-width: 420px; margin: 0 auto; }
.nmq01-intro-image.nmq01-ratio-9-16 .nmq01-intro-embed,
.nmq01-intro-image.nmq01-ratio-9-16 video { aspect-ratio: 9 / 16; max-width: 320px; margin: 0 auto; }
.nmq01-intro-image video { object-fit: cover; }


/* v0.1.11：草稿還原提示 */
.nmq01-resume-note { font-family: var(--ff-m, monospace); font-size: 11px; letter-spacing: .14em; color: var(--plum-hi, #9C8CBC); text-align: center; margin: 0 0 18px; }
