/* ============================================================
   css/panels/panels-ec-test.css — 「测一测」邀请卡 + 整页测验（第 4 窗口）
   ------------------------------------------------------------
   前缀一律 lt-（不许占用公共层的 ec-，也不许借用别的分区的前缀）。
   规矩（与全站一致）：
     · 零 emoji、线条图标、衬线中文、禁系统默认控件（选项/按钮全部自己画）
     · 竖屏；360 / 390 / 430 都要好看，窄屏 <370 不破版、不横向溢出
     · 底部留白含 --safe-bottom（iPhone 底部横条不压内容）
     · 触碰有动画反馈；prefers-reduced-motion 要有替代
   ============================================================ */

/* ===== 一、聊天里那张邀请卡（外层 .lt-shell 是透明壳：卡片自己带底，防「双层纸」）===== */
.lt-shell {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100%;
}

.lt-card {
    position: relative;
    width: 100%;
    max-width: 290px;
    padding: 16px 16px 14px;
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(255, 252, 253, 0.98), rgba(250, 243, 246, 0.98));
    border: 1px solid var(--ec-line, rgba(196, 160, 172, 0.28));
    box-shadow: 0 8px 22px rgba(160, 120, 135, 0.10);
    transition: transform 0.22s cubic-bezier(.22, .68, .3, 1), box-shadow 0.22s ease;
}
.lt-card:active { transform: scale(0.985); }

.lt-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.lt-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    color: var(--ec-gold-ink, #a8873f);
    background: rgba(214, 186, 122, 0.14);
}
.lt-en {
    font-family: 'Great Vibes', 'Playfair Display', cursive;
    font-size: 19px;
    line-height: 1;
    color: var(--ec-rose-ink, #c2808f);
    opacity: 0.85;
}

.lt-invite-title {
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.55;
    color: var(--ec-ink, #2f2a2b);
    letter-spacing: 0.2px;
}
.lt-invite-sub {
    margin-top: 6px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--ec-sub, #8d8486);
}
.lt-invite-btn {
    margin-top: 12px;
    width: 100%;
}
.lt-invite-btn[disabled] {
    opacity: 0.55;
    cursor: default;
}
.lt-invite-btn.is-busy { opacity: 0.75; pointer-events: none; }
/* 过期/已完成：整张卡安静下来（不是死卡，仍能看到状态） */
.lt-st-expired { opacity: 0.78; }
.lt-st-done { border-color: rgba(168, 135, 63, 0.34); }

/* ===== 二、整页测验 ===== */
.lt-page {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-sizing: border-box;
}
/* 最顶栏自己让出 iOS 顶部安全区（全站铁律：只让一次，别层层叠加） */
.lt-head { flex-shrink: 0; }

.lt-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 4px 18px calc(26px + var(--safe-bottom, 0px));
    box-sizing: border-box;
}
/* 窄屏（<370）收紧左右留白，别把选项挤成两行 */
@media (max-width: 370px) {
    .lt-body { padding-left: 14px; padding-right: 14px; }
}

.lt-progress {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 6px 0 8px;
}
.lt-progress-text {
    font-size: 11.5px;
    letter-spacing: 0.6px;
    color: var(--ec-sub, #8d8486);
}
.lt-progress-num {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 12.5px;
    color: var(--ec-rose-ink, #c2808f);
}

.lt-q {
    margin: 18px 0 20px;
    text-align: center;
}
.lt-q-word {
    font-family: 'Playfair Display', 'Times New Roman', serif;
    font-size: 27px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--ec-ink, #2f2a2b);
    word-break: break-word;
}
.lt-q-phonetic {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--ec-sub, #8d8486);
    letter-spacing: 0.3px;
}
.lt-q-hint {
    margin-top: 10px;
    font-size: 11.5px;
    color: var(--ec-sub, #8d8486);
    opacity: 0.9;
}
@media (max-width: 370px) {
    .lt-q-word { font-size: 24px; }
}

.lt-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lt-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    text-align: left;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--ec-line, rgba(196, 160, 172, 0.28));
    color: var(--ec-ink, #2f2a2b);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.5;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}
.lt-opt:active { transform: scale(0.985); }
.lt-opt-idx {
    flex: 0 0 auto;
    width: 20px;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 12.5px;
    color: var(--ec-rose-ink, #c2808f);
}
.lt-opt-text { flex: 1 1 auto; word-break: break-word; }
.lt-opt-mark { flex: 0 0 auto; display: inline-flex; width: 17px; }

.lt-opt.is-right {
    border-color: rgba(120, 165, 130, 0.55);
    background: rgba(233, 245, 235, 0.96);
}
.lt-opt.is-right .lt-opt-mark { color: #5f8f6b; }
.lt-opt.is-wrong {
    border-color: rgba(198, 120, 130, 0.55);
    background: rgba(252, 238, 240, 0.96);
}
.lt-opt.is-wrong .lt-opt-mark { color: #b4666f; }
.lt-opt.is-dim { opacity: 0.5; }
.lt-opt[disabled] { cursor: default; }

.lt-fb {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    animation: ltFbIn 0.24s ease both;
}
@keyframes ltFbIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.lt-fb-right { background: rgba(233, 245, 235, 0.8); }
.lt-fb-wrong { background: rgba(252, 238, 240, 0.85); }
.lt-fb-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ec-ink, #2f2a2b);
}
.lt-fb-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--ec-sub, #8d8486);
    word-break: break-word;
}

.lt-next { margin-top: 14px; width: 100%; }

.lt-foot {
    margin-top: auto;
    padding-top: 18px;
    text-align: center;
}
.lt-foot-note {
    font-size: 11px;
    line-height: 1.6;
    color: var(--ec-sub, #8d8486);
    opacity: 0.85;
}

/* ===== 三、成绩页 ===== */
.lt-result { align-items: center; text-align: center; }
.lt-score-wrap {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin: 26px 0 6px;
}
.lt-score {
    font-family: 'Playfair Display', serif;
    font-size: 56px;
    font-weight: 600;
    line-height: 1;
    color: var(--ec-rose-ink, #c2808f);
    animation: ltScoreIn 0.42s cubic-bezier(.22, .68, .3, 1) both;
}
@keyframes ltScoreIn {
    from { opacity: 0; transform: translateY(6px) scale(0.96); }
    to { opacity: 1; transform: none; }
}
.lt-score-unit {
    font-size: 13px;
    color: var(--ec-sub, #8d8486);
}
.lt-result-line {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ec-ink, #2f2a2b);
    letter-spacing: 0.3px;
}
.lt-result-meta {
    margin: 8px 0 16px;
    font-size: 12px;
    color: var(--ec-sub, #8d8486);
}
.lt-result .ec-bar { width: 100%; }
.lt-result-note {
    margin-top: 14px;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--ec-sub, #8d8486);
}
.lt-result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 26px;
}

/* ===== 四、减少动效 / 暗色 ===== */
@media (prefers-reduced-motion: reduce) {
    .lt-card, .lt-opt { transition: none; }
    .lt-fb, .lt-score { animation: none; }
}

/* ===== 五、聊天里直接弹开的答题层（2028-10 第 10 窗口）=====
   为什么要有这一层：从前点卡片要先把整个外文面板开起来再切进测验页，
   链上任何一环慢/失败就是她看到的「一直正在准备」。现在答题自己就是一整屏，
   跟面板无关。挂 #app 内、限宽 480、竖屏铺满，桌面端也是手机那一屏。 */
.lt-layer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 2400;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(170deg, #fffdfd 0%, #fdf5f7 52%, #faf1f4 100%);
    opacity: 1;
    transition: opacity 0.24s ease;
}
/* standalone（加到主屏那个图标）里 100dvh 才算真高度；有 dvh 就用 dvh，没有就退回 100% */
@supports (height: 100dvh) {
    .lt-layer { height: 100dvh; }
}
.lt-layer .lt-page {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}
/* 顶栏自己让出一次顶部安全区（全站铁律：只让一次） */
.lt-layer .lt-head {
    padding-top: calc(6px + env(safe-area-inset-top, 0px));
}
.lt-layer .lt-body {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: calc(26px + var(--safe-bottom, 0px));
}
/* 层里那些「加载中/出错」的整块也要撑满，不然字挤在顶部 */
.lt-layer > .ec-loading,
.lt-layer > .ec-empty,
.lt-layer > .ec-error {
    margin: auto;
    padding: 0 18px;
}
/* 答题层开着时，后面的聊天不许跟着滚 */
body.lt-layer-open { overflow: hidden; }

/* 选词填空：把那个空画成一条下划线，句子居中、行高放宽（英文长句在小屏上要能折行） */
.lt-q-sentence {
    font-family: 'Playfair Display', 'Times New Roman', serif;
    font-size: 17px;
    line-height: 1.85;
    text-align: center;
    color: var(--ec-ink, #2f2a2b);
    word-break: break-word;
}
.lt-blank {
    display: inline-block;
    min-width: 62px;
    margin: 0 3px;
    border-bottom: 1.5px solid var(--ec-rose-ink, #c2808f);
    vertical-align: baseline;
}
@media (max-width: 370px) {
    .lt-q-sentence { font-size: 15.5px; line-height: 1.8; }
    .lt-blank { min-width: 52px; }
}

/* 他自己出的题（题面是他写的一句话，比单词长，字号收一点、不要夸张的衬线大字） */
.lt-q-word.lt-q-custom {
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.7;
}

/* 打字题型：自绘外观的输入框（不吃系统默认框），键盘用系统英文键盘 */
.lt-typing { margin-top: 4px; }
.lt-input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border-radius: 13px;
    border: 1px solid var(--ec-line, rgba(196, 160, 172, 0.34));
    background: rgba(255, 255, 255, 0.95);
    color: var(--ec-ink, #2f2a2b);
    font-family: 'Playfair Display', 'Times New Roman', serif;
    font-size: 17px;
    letter-spacing: 0.6px;
    text-align: center;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.18s ease, background 0.18s ease;
}
.lt-input::placeholder {
    color: var(--ec-sub, #8d8486);
    opacity: 0.6;
    letter-spacing: 0.2px;
    font-size: 14px;
}
.lt-input:focus { border-color: rgba(194, 128, 143, 0.62); }
.lt-input.is-right {
    border-color: rgba(120, 165, 130, 0.6);
    background: rgba(233, 245, 235, 0.96);
}
.lt-input.is-wrong {
    border-color: rgba(198, 120, 130, 0.6);
    background: rgba(252, 238, 240, 0.96);
}

/* 听写：念一遍那颗按钮（自己要看得像可点的东西，不能只是个图标） */
.lt-say {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 auto 4px;
    padding: 11px 22px;
    border-radius: 999px;
    border: 1px solid rgba(214, 186, 122, 0.5);
    background: rgba(255, 253, 250, 0.96);
    color: var(--ec-gold-ink, #a8873f);
    font-family: inherit;
    font-size: 13.5px;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease;
}
.lt-say:active { transform: scale(0.97); background: rgba(250, 243, 232, 0.98); }
.lt-say svg { width: 20px; height: 20px; }
.lt-q .lt-say { display: flex; }

@media (prefers-reduced-motion: reduce) {
    .lt-layer, .lt-input, .lt-say { transition: none; }
}
