/* style.css — WordPhoto v2 样式（对齐原版 index.html 视觉） */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Vue 挂载前隐藏未编译模板，避免弹窗/占位符一闪而过 */
[v-cloak] { display: none !important; }
#boot-loading { text-align: center; padding: 60px 0; font-size: 1.1rem; color: #fff; opacity: 0.9; }
#app:not([v-cloak]) + #boot-loading { display: none; }

body {
    font-family: 'Nunito', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container { max-width: 1100px; margin: 0 auto; }

/* ===== 主页 ===== */
.main-header { text-align: center; padding: 40px 20px 30px; color: #fff; }
.main-header h1 { font-size: 2.8rem; letter-spacing: 2px; text-shadow: 2px 2px 12px rgba(0,0,0,0.3); }
.main-header p { font-size: 1.15rem; opacity: 0.9; margin-top: 8px; }

.action-bar { display: flex; justify-content: center; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }

.btn {
    padding: 14px 32px; font-size: 1.1rem; font-weight: 700;
    border: none; border-radius: 30px; cursor: pointer;
    transition: all 0.3s; font-family: inherit;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-review { background: linear-gradient(135deg, #fdcb6e, #f0932b); color: #fff; font-size: 1.25rem; padding: 16px 40px; }
.btn-review:hover { box-shadow: 0 8px 28px rgba(240,147,43,0.5); }
.btn-shuffle { background: rgba(255,255,255,0.25); color: #fff; }
.btn-shuffle:hover { background: rgba(255,255,255,0.4); }
/* 管理台等白底容器内：半透明白底+白字会隐形，改用紫色渐变保证文字可见 */
.review-container .btn-shuffle { background: linear-gradient(135deg, #a29bfe, #6c5ce7); color: #fff; }
.review-container .btn-shuffle:hover { background: linear-gradient(135deg, #8f86f5, #5b4bd5); }

.footer { text-align: center; color: rgba(255,255,255,0.75); padding: 30px 0 10px; font-size: 0.95rem; }

/* ===== 通用容器（复习页/管理页/学习页共用）===== */
.review-container {
    background: #fff; border-radius: 24px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    min-height: 70vh;
}
.review-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 26px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff;
}
.review-header .title { font-size: 1.25rem; font-weight: 800; }
.review-header .progress { font-size: 0.95rem; opacity: 0.92; font-weight: 700; }
.btn-back {
    background: rgba(255,255,255,0.22); border: none; color: #fff;
    padding: 8px 18px; border-radius: 20px; cursor: pointer;
    font-weight: 700; font-size: 0.95rem; font-family: inherit;
}
.btn-back:hover { background: rgba(255,255,255,0.4); }
.review-body { padding: 26px; }

/* ===== 看图猜单词复习页 ===== */
.finish-msg { text-align: center; padding: 60px 20px; }
.finish-msg h2 { font-size: 2rem; color: #2d3436; }
.finish-msg p { color: #636e72; margin-top: 10px; font-size: 1.1rem; }

.review-image-wrap { position: relative; margin-bottom: 18px; }
.review-image {
    width: 100%; max-height: 420px; object-fit: contain;
    border-radius: 16px; display: block;
    background: #f8f9fb;
}
.btn-nav-side {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 46px; height: 46px; border-radius: 50%;
    border: none; background: rgba(255,255,255,0.85);
    font-size: 1.2rem; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.2s;
}
.btn-nav-side:hover:not(:disabled) { background: #fff; transform: translateY(-50%) scale(1.1); }
.btn-nav-side:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-nav-prev { left: 14px; }
.btn-nav-next { right: 14px; }
.btn-nav-next.last { background: linear-gradient(135deg, #fdcb6e, #f0932b); color: #fff; }

.review-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.btn-reveal, .btn-mic, .btn-listen {
    padding: 11px 20px; border-radius: 24px; border: none;
    font-weight: 700; font-size: 0.98rem; cursor: pointer;
    font-family: inherit; transition: all 0.2s;
}
.btn-reveal { background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: #fff; }
.btn-reveal.done { background: #dfe6e9; color: #636e72; }
.btn-mic { background: linear-gradient(135deg, #0984e3, #74b9ff); color: #fff; }
.btn-mic.listening { background: linear-gradient(135deg, #d63031, #e17055); animation: pulse 1.2s infinite; }
.btn-mic.correct { background: linear-gradient(135deg, #00b894, #55efc4); }
.btn-mic.wrong { background: linear-gradient(135deg, #d63031, #e17055); }
.btn-listen { background: linear-gradient(135deg, #fdcb6e, #f0932b); color: #fff; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.65; } }

.mic-feedback { margin: 14px auto; max-width: 640px; padding: 14px 18px; border-radius: 14px; background: #f5f6fa; text-align: left; }
.mic-feedback.correct { background: #eafff8; }
.mic-feedback.wrong { background: #fff5f5; }
.mic-heard { color: #636e72; margin-bottom: 6px; }
.heard-text { font-weight: 700; color: #2d3436; }
.mic-result { font-weight: 800; margin-bottom: 4px; }
.cmp-box { margin-top: 8px; padding: 8px 12px; border-radius: 8px; font-size: 15px; line-height: 1.8; }
.cmp-box.good { background: #f0fff4; }
.cmp-box.bad { background: #fff5f5; }
.cmp-legend { margin-bottom: 4px; font-size: 12px; color: #999; }
.tok-ok { color: #00b894; font-weight: 600; }
.tok-mid { color: #fdcb6e; font-weight: 600; text-decoration: underline; }
.tok-bad { color: #d63031; font-weight: 600; text-decoration: underline; }
.mic-compare sub { font-size: 0.7em; text-decoration: none; }

.reveal-content {
    margin-top: 16px; padding: 22px; border-radius: 16px;
    background: linear-gradient(135deg, #f8f7ff, #eef1ff);
    text-align: center;
}
.reveal-word { font-size: 2.2rem; font-weight: 900; color: #2d3436; }
.reveal-phonetic { color: #636e72; margin-top: 4px; }
.reveal-meaning { font-size: 1.2rem; font-weight: 700; color: #6c5ce7; margin-top: 10px; }
.reveal-sentence { margin-top: 14px; text-align: left; max-width: 560px; margin-left: auto; margin-right: auto; }
.reveal-row { display: flex; align-items: flex-start; gap: 8px; }
.reveal-sentence .en { flex: 1; color: #2d3436; line-height: 1.7; }
.reveal-sentence .cn { color: #636e72; margin-top: 4px; }

/* 到期复习自评按钮 */
.review-due-btns { display: flex; gap: 14px; justify-content: center; margin-top: 18px; }
.btn-due {
    padding: 12px 34px; border: none; border-radius: 26px;
    font-size: 1.05rem; font-weight: 800; color: #fff; cursor: pointer;
    font-family: inherit; transition: all 0.2s;
}
.btn-due:hover { transform: translateY(-2px); }
.btn-due.forgot { background: linear-gradient(135deg, #d63031, #e17055); }
.btn-due.remember { background: linear-gradient(135deg, #00b894, #55efc4); }
.speaker-inline {
    background: none; border: none; font-size: 1.15rem; cursor: pointer;
    padding: 2px 6px; border-radius: 8px; transition: background 0.2s;
}
.speaker-inline:hover { background: rgba(108,92,231,0.12); }

/* ── 小喇叭播放中动效：律动 + 扩散声波圈 ── */
.speaking { animation: speaker-pulse 0.9s ease-in-out infinite; }
@keyframes speaker-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(253,203,110,0.65); }
    50% { transform: scale(1.18); box-shadow: 0 0 0 9px rgba(253,203,110,0); }
}
.highlight { color: #e17055; font-weight: 800; }

/* ===== 卡片详情页 ===== */
.card-wrap {
    background: #fff; border-radius: 24px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.card-hdr { padding: 22px 26px 16px; color: #fff; }
.card-hdr-title-row { display: flex; align-items: center; gap: 14px; }
.card-hdr h1 { font-size: 2.7rem; text-shadow: 2px 2px 8px rgba(0,0,0,0.2); }
.card-hdr-speaker {
    background: rgba(255,255,255,0.25); border: none; font-size: 1.3rem;
    width: 46px; height: 46px; border-radius: 50%; cursor: pointer; transition: all 0.2s;
}
.card-hdr-speaker:hover { background: rgba(255,255,255,0.45); transform: scale(1.08); }
.card-hdr-phonetic { font-size: 1.1rem; opacity: 0.92; margin-top: 6px; }
.card-hdr-badge {
    display: inline-block; margin-top: 10px; padding: 4px 14px;
    background: rgba(255,255,255,0.25); border-radius: 20px;
    font-size: 0.85rem; font-weight: 700;
}

.card-mode-bar { display: flex; gap: 10px; padding: 14px 26px; background: #f8f7ff; flex-wrap: wrap; }
.card-mode-btn {
    padding: 9px 22px; border-radius: 22px; border: 2px solid #dfe6e9;
    background: #fff; color: #636e72; font-weight: 700; cursor: pointer; font-family: inherit;
}
.card-mode-btn.active { border-color: #6c5ce7; color: #6c5ce7; background: #f1f0ff; }
.card-mode-home {
    margin-left: auto; padding: 9px 22px; border-radius: 22px; border: none;
    background: #dfe6e9; color: #2d3436; font-weight: 700; cursor: pointer; font-family: inherit;
}
.card-learned-btn { margin-left: 0; background: linear-gradient(135deg, #00b894, #00cec9); color: #fff; }
.card-nav-btn { background: #eef1ff; color: #6c5ce7; }
.card-nav-btn:hover:not(:disabled) { background: #e0e4ff; }
.card-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.card-body { padding: 18px 26px 22px; }
.card-body.review-mode .card-section:nth-child(1),
.card-body.review-mode .card-section:nth-child(2),
.card-body.review-mode .card-section:nth-child(4) { display: none; }
/* 复习模式下隐藏图片说明文字，避免任何文字提示 */
.card-body.review-mode .card-image-caption { display: none; }

.card-section { margin-bottom: 14px; }

/* ── 一屏展示：宽屏下学习模式双栏布局（左图右文，图片保持宽高比）── */
@media (min-width: 861px) {
    .card-body:not(.review-mode) {
        display: grid;
        grid-template-columns: minmax(300px, 5fr) 6fr;
        grid-template-areas:
            "img meaning"
            "img sentence"
            "img analysis";
        gap: 4px 24px;
        align-items: start;
    }
    .card-body:not(.review-mode) .card-section:nth-child(1) { grid-area: meaning; }
    .card-body:not(.review-mode) .card-section:nth-child(2) { grid-area: sentence; }
    .card-body:not(.review-mode) .card-section:nth-child(3) { grid-area: img; }
    .card-body:not(.review-mode) .card-section:nth-child(4) { grid-area: analysis; }
    .card-body:not(.review-mode) .card-image-box img {
        max-height: 50vh; width: auto; max-width: 100%;
        margin: 0 auto; display: block;
    }
    /* 解析内容较长时在区块内部滚动，保证整页一屏展示 */
    .card-body:not(.review-mode) .card-analysis-box {
        max-height: 22vh; overflow-y: auto;
    }
}
/* 复习模式：限制图片高度，让答案按钮也在一屏内（宽高比不变）*/
.card-body.review-mode .card-image-box img {
    max-height: 46vh; width: auto; max-width: 100%;
    margin: 0 auto; display: block;
}
.card-section-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 800; color: #2d3436; margin-bottom: 12px; }
.card-section-num {
    width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.95rem; font-weight: 800;
}
.num-1 { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
.num-2 { background: linear-gradient(135deg, #00b894, #55efc4); }
.num-3 { background: linear-gradient(135deg, #fdcb6e, #f0932b); }
.num-4 { background: linear-gradient(135deg, #0984e3, #74b9ff); }

.card-meaning-box { background: #f8f7ff; border-radius: 14px; padding: 16px 20px; }
.card-meaning-cn { font-size: 1.3rem; font-weight: 800; color: #2d3436; }
.card-meaning-en { color: #636e72; margin-top: 5px; }
.card-sentence-box { background: #fffdf4; border-radius: 14px; padding: 16px 20px; }
.card-sentence-row { display: flex; align-items: flex-start; gap: 10px; }
.card-sentence-en { flex: 1; font-size: 1.05rem; color: #2d3436; line-height: 1.7; }
.card-sentence-cn { color: #636e72; margin-top: 6px; }
.card-sentence-speaker {
    background: rgba(253,203,110,0.25); border: none; font-size: 1.05rem;
    width: 38px; height: 38px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
}
.card-sentence-speaker:hover { background: rgba(253,203,110,0.5); }
.reveal-speaker { display: block; margin: 0 auto 8px; }
.card-image-box { position: relative; }
.card-image-box img { width: 100%; display: block; }
.card-image-caption { text-align: center; color: #636e72; margin-top: 10px; font-size: 0.95rem; }

/* 卡片复习模式 */
.card-review-only { margin-top: 16px; }
.card-body:not(.review-mode) .card-review-only { display: none; }
.card-reveal-btn-wrap { text-align: center; }
.card-reveal-btn {
    padding: 13px 34px; border-radius: 26px; border: none;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: #fff;
    font-size: 1.05rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.card-reveal-btn.done { background: linear-gradient(135deg, #fdcb6e, #f0932b); }
.card-reveal-area { margin-top: 16px; }
.card-answer-word { font-size: 2.1rem; font-weight: 900; text-align: center; }
.card-answer-phonetic { text-align: center; color: #636e72; margin-bottom: 12px; }
.card-reveal-area .card-meaning-box { margin-bottom: 10px; }
.card-review-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.card-action-btn {
    padding: 11px 20px; border-radius: 24px; border: none;
    font-weight: 700; font-size: 0.95rem; cursor: pointer; font-family: inherit; color: #fff;
}
.btn-lw { background: linear-gradient(135deg, #fdcb6e, #f0932b); }
.btn-ls { background: linear-gradient(135deg, #e17055, #fab1a0); }
.btn-rw { background: linear-gradient(135deg, #0984e3, #74b9ff); }
.btn-rs { background: linear-gradient(135deg, #00b894, #55efc4); }
.card-action-btn:disabled { opacity: 0.6; cursor: wait; }
.card-action-btn.listening { animation: pulse 1.2s infinite; }
.card-action-btn.correct { box-shadow: 0 0 0 3px rgba(0,184,148,0.45); }
.card-action-btn.wrong { box-shadow: 0 0 0 3px rgba(214,48,49,0.4); }
.card-footer { text-align: center; padding: 18px; color: #b2bec3; font-size: 0.9rem; background: #fafafa; }

/* ===== 卡片网格 ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.word-card {
    background: #fff; border-radius: 18px; overflow: hidden; cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1); transition: all 0.25s;
    border: 2px solid #f1f2f6;
}
.word-card:hover { transform: translateY(-5px); box-shadow: 0 14px 30px rgba(0,0,0,0.18); }
.thumb { width: 100%; height: 160px; object-fit: cover; display: block; }
.thumb-empty { display: flex; align-items: center; justify-content: center; background: #dfe6e9; font-size: 2.4rem; }
.word-card .info { padding: 12px 14px; }
.word-name { font-size: 1.25rem; font-weight: 900; color: #2d3436; }
.word-meaning { font-size: 0.92rem; color: #636e72; margin-top: 3px; }
.word-badge {
    display: inline-block; margin-top: 7px; padding: 2px 11px;
    font-size: 0.75rem; font-weight: 700; background: #f1f0ff; color: #6c5ce7; border-radius: 20px;
}
.empty-hint { text-align: center; color: #999; padding: 24px; }

/* ===== Tab 与按钮 ===== */
.lib-tabs { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.lib-tab {
    padding: 10px 24px; border-radius: 24px; border: none;
    background: #f1f2f6; color: #636e72; font-weight: 700; cursor: pointer; font-family: inherit;
}
.lib-tab.active { background: #6c5ce7; color: #fff; }

.lib-btn {
    padding: 10px 22px; border-radius: 22px; border: none;
    font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.95rem;
    transition: all 0.2s;
}
.lib-btn:hover:not(:disabled) { transform: translateY(-1px); }
.lib-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.lib-btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.lib-btn-purple { background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: #fff; }
.lib-btn-green { background: linear-gradient(135deg, #00b894, #55efc4); color: #fff; }
.lib-btn-red { background: linear-gradient(135deg, #d63031, #e17055); color: #fff; }
.lib-btn-blue { background: linear-gradient(135deg, #0984e3, #74b9ff); color: #fff; }
.lib-btn-grey { background: #dfe6e9; color: #2d3436; }
.lib-btn-ai { background: linear-gradient(135deg, #fd79a8, #a55eea); color: #fff; }
.lib-btn-orange { background: linear-gradient(135deg, #e17055, #fab1a0); color: #fff; }
.lib-btn-teal { background: linear-gradient(135deg, #00b894, #00cec9); color: #fff; }
.lib-btn-indigo { background: linear-gradient(135deg, #3949ab, #7986cb); color: #fff; }
.lib-btn-cyan { background: linear-gradient(135deg, #00cec9, #81ecec); color: #fff; }
.lib-btn-gold { background: linear-gradient(135deg, #f0932b, #fdcb6e); color: #fff; }

/* AI 生成弹窗 */
.ai-modal { max-width: 460px; }
.ai-tip { color: #636e72; font-size: 0.88rem; line-height: 1.6; margin-bottom: 14px; }
.ai-error { color: #d63031; font-size: 0.88rem; margin-top: 12px; line-height: 1.5; }

/* API Key 配置区 */
.ai-config {
    margin-top: 14px; padding: 12px 14px;
    background: #f8f9fb; border-radius: 12px;
}
.ai-config-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-cfg-ok { color: #00b894; font-size: 0.88rem; font-weight: 700; }
.ai-cfg-none { color: #e17055; font-size: 0.88rem; font-weight: 700; }
.ai-cfg-toggle {
    background: none; border: none; color: #6c5ce7;
    font-size: 0.88rem; font-weight: 700; cursor: pointer; font-family: inherit;
    padding: 2px 6px;
}
.ai-cfg-toggle:hover { text-decoration: underline; }
.ai-config-edit { display: flex; gap: 8px; margin-top: 10px; }
.ai-config-edit input {
    flex: 1; padding: 9px 12px; border: 2px solid #dfe6e9; border-radius: 10px;
    font-size: 0.9rem; font-family: inherit;
}
.ai-config-edit input:focus { outline: none; border-color: #a29bfe; }
.ai-cfg-hint { color: #00b894; font-size: 0.85rem; margin-top: 8px; }
/* 音频配置行：上行标签+保存，下行引擎+音色两个下拉平分宽度，窄屏不再溢出 */
.ai-cfg-row { margin-top: 12px; }
.ai-cfg-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ai-cfg-hd .ai-cfg-ok { white-space: nowrap; }
.ai-cfg-line { display: flex; gap: 8px; }
.ai-cfg-line select { flex: 1; min-width: 0; }
.ai-cfg-line .img-upload-btn { flex: none; }

/* ===== AI 设置页 ===== */
.ai-set-card {
    background: #fff; border-radius: 14px; padding: 16px 18px;
    margin-bottom: 14px; box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}
.ai-set-card h3 { margin: 0 0 12px; font-size: 1.02rem; color: #2d3436; }
.ai-set-ops { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ai-set-note { color: #636e72; font-size: 0.83rem; }
.ai-set-readonly { color: #636e72; font-size: 0.85rem; margin: 10px 0 0; word-break: break-all; line-height: 1.6; }
.ai-cfg-hd-ops { display: inline-flex; gap: 6px; }
.ai-test-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.ai-test-item {
    display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
    background: #f8f9fb; border-radius: 8px; padding: 7px 10px; font-size: 0.88rem;
}
.ai-test-detail { color: #636e72; }
.ai-ov-link { display: flex; align-items: center; justify-content: center; }
.ai-pron-edit { flex-wrap: wrap; }
.ai-pron-edit input { min-width: 180px; }

/* ===== 提示词管理页 ===== */
.prompt-page-tip {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 0 18px; padding: 13px 16px; border-radius: 12px;
    background: #f6f5ff; color: #576076; font-size: 0.85rem; line-height: 1.7;
}
.prompt-dirty-tip { color: #e17055; font-weight: 700; white-space: nowrap; }
.prompt-card {
    background: #fff; border-radius: 16px; padding: 18px 20px;
    margin-bottom: 16px; border: 2px solid #eef0f6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    transition: border-color .2s, box-shadow .2s;
}
.prompt-card:focus-within { border-color: #d9d4f7; box-shadow: 0 4px 18px rgba(108, 92, 231, .12); }
.prompt-card.is-dirty { border-color: #f5c97b; }
.prompt-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prompt-hd h3 { margin: 0; flex: 1; font-size: 1.05rem; color: #2d3436; }
.prompt-badge {
    font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 3px 10px;
    white-space: nowrap;
}
.prompt-badge-def { background: rgba(0, 184, 148, .12); color: #00b894; }
.prompt-badge-mod { background: rgba(240, 147, 43, .14); color: #e08600; }
.prompt-dirty-flag {
    font-size: .75rem; font-weight: 700; color: #e17055;
    background: rgba(225, 112, 85, .12); border-radius: 999px; padding: 3px 10px;
    animation: pulse 1.6s infinite;
}
.prompt-desc { margin: 8px 0 0; color: #8a90a3; font-size: 0.83rem; line-height: 1.6; }
.prompt-editor {
    width: 100%; box-sizing: border-box; margin-top: 10px;
    font-family: Consolas, Menlo, 'Courier New', monospace; font-size: 0.83rem; line-height: 1.65;
    border: 1.5px solid #e2e6f2; border-radius: 10px; padding: 12px 14px;
    background: #fbfaff; color: #2d3436; resize: vertical; min-height: 240px;
    transition: border-color .2s, background .2s;
}
.prompt-editor:focus { outline: none; border-color: #a29bfe; background: #fff; }
.prompt-ft {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-top: 10px;
}
.prompt-ft-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: #8a90a3; font-size: 0.78rem; }
.prompt-ft-dot { font-style: normal; color: #d0d5e0; }
.prompt-dirty-txt { color: #e17055; font-weight: 700; }
.prompt-ft-kbd {
    color: #6c5ce7; background: #f1f0ff; border-radius: 6px; padding: 2px 8px;
    font-size: 0.72rem; font-weight: 700; cursor: help;
}
.prompt-ft-ops { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prompt-default {
    margin: 12px 0 0; padding: 12px 14px; background: #f2f4f8; border-radius: 10px;
    font-size: 0.78rem; line-height: 1.65; white-space: pre-wrap; word-break: break-all;
    max-height: 320px; overflow: auto; color: #576076;
    border: 1px dashed #d0d5e0;
}
.prompt-savebar {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 8900;
    display: flex; align-items: center; gap: 14px;
    background: #2d3436; color: #fff; border-radius: 30px;
    padding: 9px 12px 9px 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    animation: toast-in .25s ease;
}
.prompt-savebar-txt { font-size: 0.88rem; font-weight: 700; }
@media (max-width: 640px) {
    .prompt-savebar { width: calc(100% - 32px); justify-content: space-between; }
    .prompt-ft { flex-direction: column; align-items: stretch; }
    .prompt-ft-ops { justify-content: flex-end; }
}

/* ===== 后台任务栏 ===== */
.task-fab {
    position: fixed; right: 24px; bottom: 24px; z-index: 9000;
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff; font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 8px 24px rgba(108, 92, 231, 0.45);
    user-select: none; transition: transform 0.2s;
}
.task-fab:hover { transform: scale(1.08); }
.task-fab-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
    background: #d63031; color: #fff; font-size: 0.75rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.task-fab-spin { position: absolute; bottom: -6px; right: -6px; font-size: 1rem; animation: pulse 1.2s infinite; }
.task-panel {
    position: fixed; right: 24px; bottom: 92px; z-index: 9000;
    width: 320px; max-height: 420px; overflow-y: auto;
    background: #fff; border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    padding: 14px;
}
.task-panel-hd {
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 800; color: #2d3436; margin-bottom: 10px;
}
.task-close { background: none; border: none; color: #636e72; font-size: 0.85rem; cursor: pointer; font-family: inherit; }
.task-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.task-tabs button {
    flex: 1; padding: 8px 6px; border: none; border-radius: 10px;
    background: #f1f2f6; color: #636e72; font-weight: 700; font-size: 0.82rem;
    cursor: pointer; font-family: inherit;
}
.task-tabs button.active { background: #6c5ce7; color: #fff; }
.task-empty { color: #999; text-align: center; padding: 24px 0; font-size: 0.9rem; }
.task-item { padding: 10px; border-radius: 12px; background: #f8f9fb; margin-bottom: 8px; }
.task-info { display: flex; align-items: center; gap: 8px; }
.task-type { font-size: 0.8rem; font-weight: 800; color: #6c5ce7; white-space: nowrap; }
.task-word { flex: 1; font-weight: 700; color: #2d3436; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-status { font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.st-running { color: #f0932b; }
.st-queued { color: #6c5ce7; }
.st-done { color: #00b894; }
.st-failed { color: #d63031; }
.task-err { color: #d63031; font-size: 0.78rem; margin-top: 6px; line-height: 1.5; }
.task-note { color: #00b894; font-size: 0.78rem; margin-top: 6px; font-weight: 700; }
.task-note.warn { color: #e17055; }
.task-ops { display: flex; gap: 8px; margin-top: 8px; }
.app-toast {
    position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 10001;  /* 高于弹窗遮罩(9999)，弹窗内操作的提示不被压暗 */
    background: rgba(45, 52, 54, 0.92); color: #fff;
    padding: 10px 22px; border-radius: 24px; font-size: 0.92rem; font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.lib-toolbar { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.lib-toolbar input, .lib-toolbar select {
    padding: 10px 14px; border-radius: 12px; border: 2px solid #dfe6e9;
    font-size: 0.95rem; font-family: inherit; background: #fff;
}
.lib-toolbar input { flex: 1; min-width: 180px; }
.lib-toolbar input:focus, .lib-toolbar select:focus { outline: none; border-color: #a29bfe; }

/* ===== 词库管理 ===== */
.lib-cat-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px; border-radius: 12px; background: #f8f9fb; margin-bottom: 10px;
}
.lib-cat-name { font-weight: 800; color: #2d3436; flex: 1; }
.lib-cat-count { color: #636e72; font-size: 0.9rem; }
.lib-cat-add { display: flex; gap: 10px; margin-top: 16px; }
.lib-cat-add input {
    flex: 1; padding: 10px 14px; border-radius: 12px; border: 2px solid #dfe6e9;
    font-size: 0.95rem; font-family: inherit;
}

.lib-batch-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; border-radius: 12px; margin-bottom: 12px;
    background: #f1f0ff; color: #6c5ce7; font-weight: 700; font-size: 0.92rem;
}
.lib-batch-bar select { padding: 7px 10px; border-radius: 10px; border: 2px solid #d5d0f5; font-family: inherit; }

.lib-pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.lib-pager-num {
    min-width: 34px; padding: 6px 10px; border-radius: 10px; border: 2px solid #dfe6e9;
    background: #fff; font-size: 0.9rem; font-family: inherit; color: #2d3436; cursor: pointer;
}
.lib-pager-num:hover { border-color: #a29bfe; }
.lib-pager-num.active { border-color: #6c5ce7; background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: #fff; font-weight: 700; }
.lib-pager-dots { color: #b2bec3; padding: 0 2px; }
.lib-pager-info { color: #8a90a3; font-size: 0.85rem; margin-left: 8px; white-space: nowrap; }
.lib-pager-size {
    margin-left: auto; padding: 6px 10px; border-radius: 10px; border: 2px solid #dfe6e9;
    font-size: 0.88rem; font-family: inherit; background: #fff;
}

.lib-table-wrap { overflow-x: auto; }
.lib-table { width: 100%; border-collapse: collapse; }
.lib-table th {
    text-align: left; padding: 10px 12px; font-size: 0.88rem; color: #6c5ce7;
    border-bottom: 2px solid #f1f0ff; white-space: nowrap;
}
.lib-table td { padding: 11px 12px; border-bottom: 1px solid #f1f2f6; font-size: 0.95rem; }
.lib-table tr:hover td { background: #faf9ff; }
.th-check { width: 36px; }
.th-cat { width: 170px; }
.th-op { width: 150px; }
.lib-word-cell { font-weight: 800; color: #2d3436; }
.lib-phonetic-cell { color: #636e72; font-size: 0.88rem; }
.lib-meaning-cell { color: #636e72; }
.lib-table select {
    padding: 6px 8px; border-radius: 10px; border: 2px solid #dfe6e9;
    font-size: 0.88rem; font-family: inherit; max-width: 150px;
}

/* ===== 弹窗表单 ===== */
.modal-mask {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: #fff; border-radius: 20px; padding: 28px;
    max-width: 440px; width: 92%; max-height: 88vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-box h2 { margin: 0 0 16px; color: #2d3436; font-size: 1.3rem; }
.lib-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lib-form-grid .form-full { grid-column: 1 / -1; }
@media (max-width: 560px) { .lib-form-grid { grid-template-columns: 1fr; } }
.mini-link {
    background: none; border: none; color: #6c5ce7;
    font-size: 0.8rem; font-weight: 700; cursor: pointer;
    font-family: inherit; padding: 0 6px;
}
.mini-link:hover { text-decoration: underline; }
.lib-form-row { display: flex; flex-direction: column; gap: 5px; }
.lib-form-row label { font-size: 0.88rem; font-weight: 700; color: #636e72; }
.lib-form-row input, .lib-form-row select {
    padding: 10px 12px; border: 2px solid #dfe6e9; border-radius: 10px;
    font-size: 0.95rem; font-family: inherit;
}
.lib-form-row textarea {
    padding: 10px 12px; border: 2px solid #dfe6e9; border-radius: 10px;
    font-size: 0.95rem; font-family: inherit; resize: vertical;
}
.lib-form-row input:focus, .lib-form-row select:focus, .lib-form-row textarea:focus { outline: none; border-color: #a29bfe; }

/* 图片上传区 */
.img-upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.img-upload-btn {
    display: inline-block; padding: 9px 18px; border-radius: 12px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: #fff;
    font-weight: 700; font-size: 0.9rem; cursor: pointer; white-space: nowrap;
}
.img-upload-btn:hover { transform: translateY(-1px); }
.img-regen-btn {
    background: linear-gradient(135deg, #00b894, #55efc4); border: none; font-family: inherit;
}
.img-regen-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.img-ai-btn { background: linear-gradient(135deg, #fd79a8, #a55eea); border: none; font-family: inherit; font-size: 0.9rem; cursor: pointer; }
.img-ai-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.img-upload-preview {
    width: 72px; height: 72px; object-fit: cover;
    border-radius: 12px; border: 2px solid #dfe6e9;
}
.img-upload-hint { color: #636e72; font-size: 0.88rem; flex: 1; min-width: 140px; }
.form-tts-hint { color: #636e72; font-size: 0.85rem; margin-top: 14px; }
.modal-btns { display: flex; gap: 10px; margin-top: 18px; }
.modal-btns .lib-btn { flex: 1; padding: 12px; }

/* 大表单弹窗：固定头尾 + 中间滚动 + 分区 */
.modal-box-lg { max-width: 620px; padding: 0; display: flex; flex-direction: column; max-height: 88vh; overflow: hidden; }
.modal-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; border-bottom: 1px solid #f1f2f6; flex-shrink: 0;
}
.modal-hd h2 { margin: 0; }
.modal-x {
    background: none; border: none; font-size: 1rem; color: #636e72;
    cursor: pointer; padding: 4px 10px; border-radius: 8px; font-family: inherit;
}
.modal-x:hover { background: #f1f2f6; color: #2d3436; }
.modal-body { padding: 18px 24px; overflow-y: auto; }
.modal-ft {
    display: flex; gap: 10px; padding: 14px 24px;
    border-top: 1px solid #f1f2f6; flex-shrink: 0; background: #fff;
}
.modal-ft .lib-btn { flex: 1; padding: 12px; }
.form-section {
    grid-column: 1 / -1;
    font-weight: 800; color: #2d3436; font-size: 0.92rem;
    margin-top: 6px; padding-top: 12px; border-top: 1px dashed #e3e6ef;
}
.form-section.first { border-top: none; padding-top: 0; margin-top: 0; }
.form-section .mini-link { font-weight: 700; }

/* ===== 我的单词 ===== */
.study-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin-bottom: 22px; }
.study-stat-card { background: #f8f9fb; border-radius: 16px; padding: 18px; text-align: center; }
.study-stat-card .num { font-size: 2rem; font-weight: 900; }
.study-stat-card .lbl { color: #636e72; font-size: 0.9rem; margin-top: 4px; }

/* 概览-学习进度条 */
.study-progress-card { background: #f8f9fb; border-radius: 16px; padding: 18px; margin-bottom: 22px; }
.study-progress-card.empty { text-align: center; color: #636e72; padding: 22px 18px; }
.study-progress-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.study-progress-title { font-weight: 800; }
.study-progress-summary { color: #636e72; font-size: 0.9rem; }
.study-progress-bar { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: #dfe6e9; }
.study-progress-bar .seg { height: 100%; transition: width 0.3s; }
.study-progress-bar .seg-mastered { background: #00b894; }
.study-progress-bar .seg-learning { background: #6c5ce7; }
.study-progress-bar .seg-new { background: #f0932b; }
.study-progress-bar .seg-forgot { background: #d63031; }
.study-progress-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-size: 0.85rem; color: #636e72; align-items: center; }
.study-progress-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.study-progress-legend .rate { margin-left: auto; font-weight: 700; color: #2d3436; }

.study-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.study-actions.two-col { grid-template-columns: 1fr 1fr; }
.study-big-btn {
    border: none; border-radius: 18px; padding: 20px 14px;
    color: #fff; font-size: 1.15rem; font-weight: 800; cursor: pointer;
    font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 6px;
    transition: all 0.25s; box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.study-big-btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0,0,0,0.18); }
.study-big-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.study-big-btn .sub { font-size: 0.8rem; font-weight: 600; opacity: 0.9; }
.study-btn-learn { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
.study-btn-review { background: linear-gradient(135deg, #fdcb6e, #f0932b); }
.study-btn-test { background: linear-gradient(135deg, #00b894, #55efc4); }
.study-btn-seq { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.study-btn-rand { background: linear-gradient(135deg, #fd79a8, #fab1a0); }
.study-vocab-review { margin-top: 24px; }
.study-vocab-title { font-weight: 800; color: #636e72; margin-bottom: 10px; }

.study-word-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 12px; background: #f8f9fb; margin-bottom: 8px;
}
.sw-word { font-weight: 800; color: #2d3436; flex: 1; }
.sw-meaning { color: #636e72; font-size: 0.92rem; }
.wrong-count { color: #d63031; font-size: 0.85rem; font-weight: 700; }
.study-tag {
    display: inline-block; padding: 3px 10px; border-radius: 14px;
    font-size: 0.78rem; font-weight: 700; margin-right: 8px;
}
.study-tag-new { background: #e8f8f0; color: #00b894; }
.study-tag-learning { background: #eef1ff; color: #6c5ce7; }
.study-tag-mastered { background: #eafff8; color: #00b894; }
.study-tag-forgot { background: #fff0f0; color: #d63031; }

/* ===== 学习/复习/测试模式卡片 ===== */
.mode-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mode-topbar-title { font-weight: 800; color: #2d3436; }
.mode-progress { color: #636e72; font-weight: 700; font-size: 0.92rem; }
.mode-tip { color: #636e72; margin-bottom: 12px; }
.study-mode-card {
    background: #f8f9fb; border-radius: 20px; padding: 26px;
    max-width: 640px; margin: 0 auto; text-align: center;
}
.study-mode-img { width: 100%; max-height: 300px; object-fit: contain; margin-bottom: 12px; }
.study-mode-img-ph { height: 180px; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.review-ask { color: #999; margin: 10px 0 4px; }
.study-mode-word { font-size: 2rem; font-weight: 900; color: #2d3436; margin-top: 8px; }
.study-mode-phonetic { color: #636e72; margin-top: 4px; }
.study-mode-meaning { font-size: 1.2rem; font-weight: 700; color: #6c5ce7; margin-top: 8px; }
.study-mode-btns { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.mode-big { font-size: 1.1rem; padding: 12px 32px; }
.mode-emoji { font-size: 3rem; margin: 12px 0; }
.mode-title { font-size: 1.4rem; font-weight: 800; color: #2d3436; margin-bottom: 16px; }
.test-q-text { font-size: 1.35rem; font-weight: 800; color: #2d3436; margin: 14px 0; }
.study-opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.study-opt-btn {
    padding: 14px; border-radius: 14px; border: 2px solid #dfe6e9;
    background: #fff; font-size: 1.05rem; font-weight: 700; cursor: pointer;
    font-family: inherit; transition: all 0.2s;
}
.study-opt-btn:hover:not(:disabled) { border-color: #a29bfe; background: #f8f7ff; }
.study-opt-btn.correct { border-color: #00b894; background: #eafff8; color: #00b894; }
.study-opt-btn.wrong { border-color: #d63031; background: #fff5f5; color: #d63031; }
.wrong-box {
    margin-top: 14px; padding: 12px; background: #fff5f5;
    border-radius: 12px; text-align: left; color: #2d3436; line-height: 1.8;
}
.wrong-title { font-weight: 800; color: #d63031; margin-bottom: 6px; }

/* 学习任务 */
.lt-card { background: #f8f9fb; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.lt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lt-name { font-weight: 800; color: #2d3436; font-size: 1.05rem; }
.lt-meta { color: #636e72; font-size: 0.85rem; margin: 6px 0 8px; }
.lt-bar { height: 8px; border-radius: 4px; background: #e5e8f0; overflow: hidden; margin-bottom: 10px; }
.lt-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #00b894, #55efc4); transition: width 0.3s; }
.tc-list { max-height: 300px; overflow-y: auto; border: 2px solid #e5e8f0; border-radius: 12px; padding: 6px; }
.tc-batch-hint { font-size: 0.82rem; color: #d63031; margin: -2px 0 8px; line-height: 1.4; }
.tc-dup-hint { font-size: 0.82rem; color: #b26a00; background: #fff6e5; border: 1px solid #f5d9a8; border-radius: 8px; padding: 6px 10px; margin: 0 0 8px; line-height: 1.5; }
.tc-dup-tag { margin-left: auto; flex: none; font-size: 0.72rem; color: #b26a00; background: #fff6e5; border: 1px solid #f5d9a8; border-radius: 10px; padding: 1px 8px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.tc-row:hover { background: #f1f0ff; }
.tc-word { font-weight: 800; color: #2d3436; min-width: 110px; }
.tc-meaning { color: #636e72; font-size: 0.88rem; }
.word-card.learned { opacity: 0.65; }
.learned-badge { font-size: 0.9rem; }

/* 任务测试页：一行一词四列布局 */
.tt-summary {
    display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
    background: #f1f0ff; border: 2px solid #d8d4ff; border-radius: 12px;
    padding: 12px 16px; margin-bottom: 14px; font-weight: 700; color: #2d3436;
}
.tt-list { border: 2px solid #e5e8f0; border-radius: 12px; overflow: hidden; }
.tt-row {
    display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 56px 56px;
    align-items: center; gap: 10px;
    padding: 10px 14px; border-bottom: 1px solid #eef1f5; background: #fff;
    transition: background 0.2s;
    cursor: pointer;
}
.tt-row:hover { background: #f4f6fb; }
.tt-row.tt-known:hover { background: #e4f7ef; }
.tt-row.tt-unknown:hover { background: #fae7e1; }
.tt-row:last-child { border-bottom: none; }
.tt-row.tt-known { background: #effbf6; }
.tt-row.tt-unknown { background: #fdf1ee; }
.tt-word { font-weight: 800; color: #2d3436; cursor: pointer; user-select: none; }
.tt-word:hover { color: #6c5ce7; }
.tt-word.speaking { color: #6c5ce7; animation: pulse 0.8s ease-in-out infinite; }
.tt-meaning { color: #2d3436; font-size: 0.92rem; }
.tt-meaning-hidden { color: #b2bec3; letter-spacing: 2px; }
.tt-mark {
    width: 42px; height: 42px; border-radius: 50%; border: 2px solid #e5e8f0;
    background: #fff; font-size: 1.1rem; cursor: pointer; justify-self: center;
    transition: all 0.15s; font-family: inherit;
}
.tt-mark:hover { transform: scale(1.1); }
.tt-mark.active { border-color: transparent; transform: scale(1.12); }
.tt-row.tt-known .tt-mark.active { background: #d4f5e9; }
.tt-row.tt-unknown .tt-mark.active { background: #fadbd3; }

/* 读/说测试 */
.oral-img-row { display: flex; align-items: center; gap: 12px; position: relative; }
.oral-img { flex: 1; min-width: 0; }
.oral-mic { font-size: 1.1rem; padding: 13px 34px; border-radius: 26px; }
.oral-score { margin-top: 14px; font-size: 1.05rem; color: #2d3436; font-weight: 700; }
.oral-score b { color: #6c5ce7; font-size: 1.3rem; }

/* 卡片解析（v-html 渲染的内容）*/
.card-analysis-box { background: #f4fbf7; border-radius: 14px; padding: 18px 22px; line-height: 1.8; color: #2d3436; }
.card-analysis-row { display: flex; gap: 10px; margin-bottom: 8px; }
.card-analysis-label { font-weight: 800; color: #00b894; white-space: nowrap; }
.card-analysis-value { flex: 1; }
.card-analysis-tip { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #b2dfdb; }
.word-part { color: #6c5ce7; font-weight: 800; }

/* 篇章阅读页 */
.passage-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.passage-card {
    background: #fff; border-radius: 14px; padding: 20px 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}
.passage-title { margin: 0 0 12px; font-size: 1.3rem; text-align: center; color: #2d3436; }
.passage-hint { color: #888; font-size: .85rem; margin: 0 0 10px; }
.passage-body { line-height: 1.9; font-size: 1.05rem; color: #2d3436; }
.passage-body p { margin: 0 0 10px; }
.passage-body mark { background: #ffeaa7; border-radius: 4px; padding: 0 3px; color: inherit; }
/* ── 篇章插图：集中展示在文章开头的画廊，可显隐 ── */
.passage-illusts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.passage-illust-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.passage-illust-item img {
    height: 264px; width: auto; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
    cursor: zoom-in;
}
.passage-illust-cap { font-size: .75rem; color: #8a7fc7; }
.passage-illust-ph-sm {
    display: flex; align-items: center; justify-content: center;
    height: 264px; width: 360px; border-radius: 12px;
    color: #8a7fc7; font-size: .85rem;
    background: linear-gradient(90deg, #f3f0ff, #e8f4ff, #f3f0ff);
}
/* ── 插图大图预览（lightbox） ── */
.lightbox {
    position: fixed; inset: 0; z-index: 300;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .78); cursor: zoom-out;
}
.lightbox-img {
    max-width: 92vw; max-height: 86vh;
    border-radius: 12px; box-shadow: 0 10px 44px rgba(0, 0, 0, .55);
}
.lightbox-tip {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    color: rgba(255, 255, 255, .85); font-size: .85rem;
}
.passage-sent { cursor: pointer; border-radius: 4px; transition: background 0.15s; }
.passage-sent:hover { background: #eef1fb; }
.passage-sent.speaking { background: #c8e6c9; animation: pulse 0.8s ease-in-out infinite; }
.passage-title.speaking { background: #c8e6c9; border-radius: 8px; animation: pulse 0.8s ease-in-out infinite; }
.passage-cn {
    margin-top: 14px; background: #f6f7fb; border-radius: 14px;
    padding: 16px 20px; color: #555; line-height: 1.8;
}
.passage-cn h3, .passage-words h3 { margin: 0 0 8px; font-size: .95rem; color: #888; }
.passage-words-toggle { cursor: pointer; user-select: none; transition: color 0.15s; }
.passage-words-toggle:hover { color: #6c5ce7; }
.passage-words-toggle span { color: #b2bec3; font-size: .82rem; margin-left: 6px; font-weight: 400; }
.passage-cn p { margin: 0 0 8px; }
.passage-words { margin-top: 14px; }
.passage-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.passage-chip {
    border: none; cursor: pointer; background: #eef1fb; border-radius: 999px;
    padding: 6px 12px; font-size: .85rem; color: #2d3436; font-weight: 700;
    transition: background 0.15s;
}
.passage-chip:hover { background: #dfe6f8; }
.passage-chip span { color: #888; margin-left: 6px; font-weight: 400; }

@media (max-width: 640px) {
    .study-actions { grid-template-columns: 1fr; }
    .study-actions.two-col { grid-template-columns: 1fr; }
    .study-opt-grid { grid-template-columns: 1fr; }
    .card-hdr h1 { font-size: 2rem; }
    .review-header { flex-wrap: wrap; gap: 8px; }
    .coach-body { flex-direction: column; }
    .coach-left { min-width: 0; }
}

/* ===== AI 教练 ===== */
.lib-btn-pink { background: linear-gradient(135deg, #fd79a8, #fdcb6e); color: #fff; }
.task-start-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

.coach-body { display: flex; gap: 18px; align-items: flex-start; }
.coach-left {
    flex: 0 0 300px; background: #fff; border-radius: 16px; padding: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06); text-align: center;
}
.coach-right { flex: 1; min-width: 0; }

/* 教练形象（3D 数字人 → 插画 → 纯 CSS 脸三级兜底） */
.coach-avatar { position: relative; display: inline-block; padding: 10px 0 4px; }
/* 3D 数字人画布容器 */
.ca-3d {
    width: 240px; height: 240px; margin: 0 auto; border-radius: 22px; overflow: hidden;
    background: linear-gradient(160deg, #fffdf5, #ffeaa7 85%);
    box-shadow: 0 4px 14px rgba(253,203,110,.5);
}
.ca-3d canvas { display: block; }
/* 插画形象：按状态切换表情图，呼吸/说话/庆祝动画叠加在图上 */
.ca-img {
    display: block; width: 150px; height: 150px; margin: 0 auto; object-fit: cover;
    border-radius: 22px; box-shadow: 0 4px 14px rgba(253,203,110,.5);
    animation: ca-breath 3.2s ease-in-out infinite;
}
.coach-avatar.st-speaking .ca-img { animation: ca-img-talk .5s ease-in-out infinite alternate; }
@keyframes ca-img-talk { from { transform: scale(1) rotate(0deg); } to { transform: scale(1.04) rotate(-1.5deg); } }
.coach-avatar.st-listening .ca-img { box-shadow: 0 0 0 6px rgba(9,132,227,.15), 0 4px 14px rgba(253,203,110,.5); }
/* 插画模式：光环对齐 150px 图中心 */
.coach-avatar:has(.ca-img) .ca-ring { top: 85px; width: 165px; height: 165px; margin: -82px 0 0 -82px; }
.ca-face {
    position: relative; width: 120px; height: 120px; margin: 0 auto;
    border-radius: 50%; background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    box-shadow: 0 4px 14px rgba(253,203,110,.5);
    animation: ca-breath 3.2s ease-in-out infinite;
}
@keyframes ca-breath { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.ca-eye {
    position: absolute; top: 42px; width: 12px; height: 14px; border-radius: 50%;
    background: #2d3436; animation: ca-blink 4.5s infinite;
}
.ca-eye-l { left: 34px; }
.ca-eye-r { right: 34px; }
@keyframes ca-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.ca-cheek { position: absolute; top: 62px; width: 16px; height: 9px; border-radius: 50%; background: rgba(253,121,168,.45); }
.ca-cheek-l { left: 20px; }
.ca-cheek-r { right: 20px; }
.ca-mouth {
    position: absolute; left: 50%; top: 74px; transform: translateX(-50%);
    width: 26px; height: 10px; border-radius: 0 0 26px 26px; background: #d63031;
    transition: height .1s;
}
.coach-avatar.st-speaking .ca-mouth { animation: ca-talk .28s ease-in-out infinite alternate; }
@keyframes ca-talk { from { height: 6px; width: 20px; } to { height: 20px; width: 26px; border-radius: 50%; } }
.coach-avatar.st-listening .ca-face { box-shadow: 0 0 0 6px rgba(9,132,227,.15), 0 4px 14px rgba(253,203,110,.5); }
.ca-ring {
    position: absolute; left: 50%; top: 60px; width: 130px; height: 130px;
    margin: -65px 0 0 -65px; border-radius: 50%; pointer-events: none; opacity: 0;
    border: 3px solid rgba(9,132,227,.5);
}
.coach-avatar.st-listening .ca-ring { animation: ca-ring 1.4s ease-out infinite; }
.coach-avatar.st-thinking .ca-ring { animation: ca-ring 2s ease-out infinite; border-color: rgba(108,92,231,.4); }
@keyframes ca-ring { 0% { opacity: .8; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.25); } }
.ca-name { margin-top: 10px; font-weight: 800; color: #2d3436; }
.ca-state { font-size: .82rem; color: #888; margin-top: 2px; }

/* 字幕与提示 */
.coach-bubble {
    margin-top: 12px; background: #f1f2f6; border-radius: 12px; padding: 10px 12px;
    font-size: .95rem; color: #2d3436; line-height: 1.5; text-align: left; min-height: 1.4em;
    max-height: 9em; overflow-y: auto;  /* 超长独白时限高滚动，避免擑爆布局 */
}
.coach-heard { margin-top: 8px; font-size: .85rem; color: #0984e3; }
.coach-hint { margin-top: 8px; font-size: .82rem; color: #b2bec3; }
/* "教练听到啦"即时反馈气泡（1.2s 自动消失） */
.coach-heard-bubble {
    display: inline-block; margin-top: 8px; padding: 4px 12px;
    background: #eafff3; color: #00b894; border: 1px solid #a7f3d0;
    border-radius: 14px; font-size: .85rem; font-weight: 700;
    animation: coach-heard-pop .18s ease-out;
}
@keyframes coach-heard-pop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* 播放上下文挂起时的解锁浮层（任意点击即 resume） */
.coach-audio-blocked {
    position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 999;
    background: #ffeaa7; color: #8a6d00; border: 2px solid #fdcb6e; border-radius: 22px;
    padding: 10px 20px; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
/* 「再听例句」小按钮（例句下方） */
.coach-replay-btn {
    margin-top: 6px; padding: 4px 12px; border: 1px solid #dfe6e9; border-radius: 14px;
    background: #f1f2f6; color: #6c5ce7; font-size: .8rem; font-weight: 600; cursor: pointer;
}
.coach-replay-btn:hover { background: #e8e6ff; }
/* 选词页断连续学条 */
.coach-resume-tip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.coach-error {
    margin: 14px 0; background: #ffeaa7; color: #d63031; border-radius: 12px;
    padding: 12px 16px; font-weight: 600;
}

/* 单词板 */
.coach-dots { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.coach-step {
    display: inline-block; margin-bottom: 12px; padding: 4px 14px;
    background: #eef1fb; border-radius: 999px; font-size: .85rem;
    color: #6c5ce7; font-weight: 700;
}
.coach-child-hint {
    margin: 0 0 12px; padding: 10px 16px; border-radius: 12px;
    background: linear-gradient(135deg, #fff5e6, #ffeaa7);
    color: #b35a00; font-weight: 800; font-size: 1.02rem;
    animation: ch-pulse 2s ease-in-out infinite;
}
@keyframes ch-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.coach-ctrl { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.coach-ctrl .lib-btn[disabled] { opacity: .45; cursor: not-allowed; }
.coach-select-tip { margin: 4px 0 14px; font-weight: 700; color: #6c5ce7; }
.coach-voice-row { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 6px 8px; background: #f4f2ff; border-radius: 12px; }
.coach-voice-modal { max-width: 520px; position: relative; }
.coach-voice-modal .modal-x { position: absolute; top: 12px; right: 12px; }
.coach-voice-modal h3 { margin: 0 28px 6px 0; color: #2d3436; font-size: 1.15rem; }
.coach-voice-modal .ai-cfg-line { margin: 12px 0 2px; }
.coach-pause-note { color: #888; margin-bottom: 14px; }
/* 本词完成提示条（留在上课页，不自动切页） */
.coach-done-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: linear-gradient(135deg, #fff9e6, #eafff3);
    border: 2px solid #ffeaa7; border-radius: 14px;
    padding: 10px 14px; margin: 0 0 12px;
}
.coach-done-bar .cdb-title { font-weight: 700; color: #2d3436; }
.coach-done-bar .cdb-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.coach-dot {
    width: 16px; height: 16px; border-radius: 50%; background: #dfe6e9;
    transition: all .2s;
}
.coach-dot.cur { background: #fdcb6e; transform: scale(1.35); box-shadow: 0 0 0 3px rgba(253,203,110,.35); }
.coach-dot.done { background: #00b894; }
.coach-dot.mid { background: #74b9ff; }
.coach-dot.bad { background: #e17055; }
.coach-board {
    background: #fff; border-radius: 16px; padding: 20px; text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.coach-board-empty { padding: 48px 20px; color: #b2bec3; }
.cbe-emoji { font-size: 3rem; margin-bottom: 10px; }
.cbe-text { font-weight: 600; }
.coach-img {
    width: min(300px, 100%); aspect-ratio: 1; object-fit: cover;
    border-radius: 14px; box-shadow: 0 3px 12px rgba(0,0,0,.12);
}
.coach-word { font-size: 2.2rem; font-weight: 800; color: #2d3436; margin-top: 12px; }
.coach-phonetic { color: #6c5ce7; margin-top: 2px; }
.coach-sentence { margin-top: 10px; color: #636e72; font-size: 1.02rem; }
.coach-meaning {
    display: inline-block; margin-top: 12px; background: #ffeaa7; border-radius: 999px;
    padding: 6px 16px; font-weight: 700; color: #2d3436;
}

/* 结课总结 */
.coach-summary { background: #fff; border-radius: 16px; padding: 24px; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.cs-list { max-width: 420px; margin: 0 auto 10px; }
.cs-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 14px; border-bottom: 1px dashed #eee; font-size: 1.02rem;
}
.cs-word { font-weight: 700; }
.cs-tag.mastered { color: #00b894; font-weight: 700; }
.cs-tag.learning { color: #0984e3; font-weight: 700; }
.cs-tag.forgot { color: #e17055; font-weight: 700; }

/* ───── 学生操作指示区（与流程同步：等待/可说/在听） ───── */
.coach-action-card {
    margin-top: 14px; border-radius: 14px; padding: 12px 14px;
    display: flex; align-items: center; gap: 12px;
    border: 1px solid #e5e7f0; background: #fff; min-height: 68px;
}
.coach-action-card.wait { background: #fff8e6; border-color: #f3e3b3; }
.coach-action-card.ready { background: #e9f9ef; border-color: #bbe8cc; }
.coach-action-card.listen { background: #e8f2ff; border-color: #c3dbf7; }
.cac-icon {
    position: relative; width: 44px; height: 44px; border-radius: 50%;
    background: #fff; display: flex; align-items: center; justify-content: center;
    flex: none; box-shadow: 0 1px 4px rgba(30,40,90,.08);
}
.cac-mic { font-size: 22px; line-height: 1; }
.cac-mic.grey { filter: grayscale(1); opacity: .45; }
.coach-action-card.ready .cac-icon { animation: cac-pulse 1.2s ease-out infinite; }
@keyframes cac-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34,197,94,.40); }
    70% { box-shadow: 0 0 0 14px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.cac-waves { display: flex; gap: 3px; align-items: flex-end; height: 20px; }
.cac-waves i { width: 4px; height: 8px; background: #3b82f6; border-radius: 2px; animation: cac-wave .9s ease-in-out infinite; }
.cac-waves i:nth-child(2) { animation-delay: .15s; }
.cac-waves i:nth-child(3) { animation-delay: .3s; }
@keyframes cac-wave { 0%,100% { height: 6px; } 50% { height: 18px; } }
.cac-text { min-width: 0; }
.cac-title { font-weight: 700; font-size: 15px; color: #333a4d; }
.coach-action-card.ready .cac-title { color: #16a34a; }
.coach-action-card.wait .cac-title { color: #d97706; }
.coach-action-card.listen .cac-title { color: #2563eb; }
.cac-sub { font-size: 12.5px; color: #8a90a3; margin-top: 2px; }

/* ---------- 学生档案弹窗 ---------- */
.profile-modal { max-width: 680px; width: 94%; padding: 30px 36px 26px; }
.profile-hd { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.profile-hd-icon { flex: none; width: 54px; height: 54px; border-radius: 16px; font-size: 27px;
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(108, 92, 231, .28); }
.profile-hd-text { flex: 1; min-width: 0; text-align: left; }
.profile-hd-text h2 { margin: 0; font-size: 1.3rem; color: #2d3436; }
.profile-hd-text p { margin: 3px 0 0; font-size: .86rem; color: #8a90a3; }
.profile-hd .modal-x { position: static; flex: none; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; }
.profile-field { margin-bottom: 20px; text-align: left; }
.profile-field > label { display: block; font-weight: 600; color: #3f4658; font-size: .92rem; margin-bottom: 9px; }
.profile-field input, .profile-field select, .profile-field textarea {
    width: 100%; box-sizing: border-box; padding: 11px 14px; font-size: .95rem;
    border: 1.5px solid #e2e6f2; border-radius: 12px; background: #fafbff; color: #333a4d;
    font-family: inherit; transition: border-color .15s, background .15s; }
.profile-field input:focus, .profile-field select:focus, .profile-field textarea:focus {
    outline: none; border-color: #6c5ce7; background: #fff; }
.profile-field textarea { resize: vertical; min-height: 74px; line-height: 1.55; }
.profile-hint { margin: 7px 2px 0; font-size: .8rem; color: #9aa0b5; }
.profile-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.profile-chip { border: 1.5px solid #e2e6f2; background: #fff; border-radius: 999px;
    padding: 8px 18px; font-size: .9rem; cursor: pointer; color: #4a5165; transition: all .15s; }
.profile-chip:hover { border-color: #a29bfe; color: #6c5ce7; }
.profile-chip.on { background: #6c5ce7; border-color: #6c5ce7; color: #fff;
    box-shadow: 0 3px 10px rgba(108, 92, 231, .30); }
.profile-ft { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px;
    padding-top: 18px; border-top: 1px solid #eef0f6; }
.profile-save { min-width: 150px; }
@media (max-width: 620px) { .profile-grid { grid-template-columns: 1fr; gap: 0; } .profile-modal { padding: 24px 20px; } }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.login-card { background: #fff; border-radius: 22px; padding: 40px 36px; width: 100%; max-width: 380px;
    box-shadow: 0 20px 60px rgba(30, 40, 90, .18); text-align: center; }
.login-card .profile-hd-icon { margin: 0 auto 14px; }
.login-card h1 { margin: 0 0 4px; font-size: 1.4rem; color: #2d3436; }
.login-card p { margin: 0 0 22px; color: #8a90a3; font-size: .9rem; }
.login-card input { width: 100%; box-sizing: border-box; margin-bottom: 12px; padding: 12px 14px;
    border: 1.5px solid #e2e6f2; border-radius: 12px; font-size: .95rem; background: #fafbff; }
.login-card input:focus { outline: none; border-color: #6c5ce7; background: #fff; }
.login-err { color: #d63031; font-size: .85rem; margin: 0 0 10px !important; }
.login-btn { width: 100%; padding: 12px 0; font-size: 1rem; }

/* ---------- 顶栏用户条 ---------- */
.user-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
    background: #fff; border-radius: 12px; padding: 8px 14px; box-shadow: 0 1px 4px rgba(30,40,90,.08); }
.user-bar-name { font-weight: 700; color: #333a4d; }
.usage-badge { font-size: .78rem; color: #6c5ce7; background: rgba(108,92,231,.10); border-radius: 999px; padding: 3px 10px; }
.usage-badge-btn { cursor: pointer; }
.usage-badge-btn:hover { background: rgba(108,92,231,.22); }
.user-bar .btn-back { margin-left: auto; background: #6c5ce7; color: #fff; }
.user-bar .btn-back:hover { background: #5b4bd5; }

/* ---------- 管理台 ---------- */
.admin-create { display: flex; gap: 10px; flex-wrap: wrap; background: #fff; border-radius: 12px;
    padding: 14px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(30,40,90,.08); }
.admin-create input, .admin-create select { flex: 1; min-width: 140px; padding: 9px 12px;
    border: 1.5px solid #e2e6f2; border-radius: 10px; font-size: .9rem; }
.admin-create input[type="date"], .lib-toolbar input[type="date"] { flex: 0 0 auto; width: 158px; min-width: 0; }
.admin-stu { display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: #fff; border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(30,40,90,.08); }
.admin-stu-info { display: flex; align-items: center; gap: 8px; }
.admin-nick { color: #8a90a3; font-size: .85rem; }
.admin-off { color: #d63031; background: rgba(214,48,49,.1); border-radius: 999px; padding: 2px 10px; font-size: .75rem; }
.admin-usage-sum { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.usage-chip { background: #6c5ce7; color: #fff; border-radius: 999px; padding: 5px 14px; font-size: .82rem; }
.admin-meta { display: block; width: 100%; color: #8a90a3; font-size: .75rem; margin-top: 2px; }
.admin-stu-info { flex-wrap: wrap; }
.admin-overview { display: flex; gap: 12px; flex-wrap: wrap; padding: 20px 26px 0; }
.admin-ov-card { flex: 1; min-width: 140px; background: #f6f5ff; border-radius: 12px; padding: 14px 18px;
    display: flex; flex-direction: column; align-items: center; gap: 2px; }
.admin-ov-card b { font-size: 1.5rem; color: #6c5ce7; }
.admin-ov-card span { font-size: .82rem; color: #576076; }
.admin-ov-card em { font-style: normal; font-size: .72rem; color: #d63031; }

/* ---------- 系统词库导入 ---------- */
.import-list { max-height: 46vh; overflow-y: auto; margin: 12px 0; border: 1px solid #eef0f6; border-radius: 12px; }
.import-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #f4f5fa; cursor: pointer; margin: 0; }
.import-row:last-child { border-bottom: none; }
.import-row:hover { background: #fafbff; }
.import-word { font-weight: 600; color: #333a4d; min-width: 90px; }

/* ---------- 积分 ---------- */
.credit-badge { background: rgba(253,203,110,.20); color: #b07d1a; font-weight: 700; }
.credit-low { background: rgba(255,165,2,.25) !important; color: #c77800 !important; }
.credit-zero { background: rgba(214,48,49,.16) !important; color: #d63031 !important; }
.credit-low-text { color: #c77800; font-weight: 700; margin-left: 8px; }
.credit-zero-text { color: #d63031; font-weight: 700; margin-left: 8px; }
.credit-balance-line { margin: 10px 0; font-size: .95rem; }
.credit-balance-line b { font-size: 1.3rem; color: #6c5ce7; }
.credit-redeem-line { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.credit-redeem-line input { flex: 1; min-width: 140px; }
.credit-rates-line { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.credit-plus { color: #00b894; font-weight: 700; }
.credit-minus { color: #d63031; font-weight: 700; }
.admin-sec-hd { margin: 18px 0 8px; font-weight: 700; color: #444; display: flex; gap: 8px; align-items: center; }
.rate-input { width: 70px; margin: 0 4px; }
.rate-select { margin-left: 8px; }

/* ---------- 积分弹窗 v2 ---------- */
.credit-body { padding: 18px 24px 22px; overflow-y: auto; }
.credit-hero { border-radius: 16px; padding: 16px 20px; color: #fff;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe); display: flex; flex-direction: column; gap: 2px; }
.credit-hero-low { background: linear-gradient(135deg, #e17055, #fdcb6e); }
.credit-hero-zero { background: linear-gradient(135deg, #d63031, #e17055); }
.credit-hero-num { font-size: 2.1rem; font-weight: 800; line-height: 1.1; }
.credit-hero-unit { font-size: .9rem; font-weight: 600; margin-left: 6px; opacity: .9; }
.credit-hero-sub { font-size: .78rem; opacity: .85; }
.credit-hero-warn { margin-top: 8px; font-size: .8rem; font-weight: 700;
    background: rgba(255,255,255,.22); border-radius: 8px; padding: 4px 10px; align-self: flex-start; }
.credit-sec { margin: 16px 0 8px; font-weight: 700; font-size: .9rem; color: #444;
    display: flex; align-items: center; gap: 8px; }
.credit-sec-tip { font-weight: 400; color: #98a0b3; font-size: .75rem; }
.credit-rate-chip { border: 1px solid #d9d4f7; background: #f7f5ff; color: #5b4bd5;
    border-radius: 999px; padding: 3px 10px; font-size: .75rem; white-space: nowrap; }
.credit-rate-chip b { margin-left: 5px; }
.credit-txns { max-height: 260px; overflow-y: auto; border: 1px solid #eef0f6; border-radius: 12px; }
.credit-txn { display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 9px 14px; border-bottom: 1px solid #f4f5fa; }
.credit-txn:last-child { border-bottom: none; }
.credit-txn-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.credit-txn-note { font-size: .85rem; color: #333a4d; }
.credit-txn-time { font-size: .72rem; color: #98a0b3; }
.credit-txn-empty { padding: 18px; text-align: center; color: #98a0b3; font-size: .8rem; }

/* ---------- 用量弹窗 v2 ---------- */
.usage-filter-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.usage-filter-line input[type="date"] { border: 1px solid #e3e6f0; border-radius: 10px; padding: 6px 10px; font-size: .82rem; color: #333a4d; }
.usage-preset-group { display: inline-flex; border: 1px solid #e3e6f0; border-radius: 999px; overflow: hidden; margin-left: auto; }
.usage-preset { border: none; background: #fff; color: #666; font-size: .78rem; padding: 6px 14px; cursor: pointer; }
.usage-preset + .usage-preset { border-left: 1px solid #eef0f6; }
.usage-preset.on { background: #6c5ce7; color: #fff; font-weight: 700; }
.usage-note { font-style: normal; color: #98a0b3; margin-left: 6px; font-size: .75rem; }
.usage-qty { color: #5b4bd5; white-space: nowrap; }
.credit-rate-chip i { font-style: normal; margin-left: 5px; color: #9a90e8; font-size: .7rem; }

/* ---------- 管理端用量页 v2 ---------- */
.admin-credit-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-credit-card { flex: 1; min-width: 140px; background: #f7f5ff; border: 1px solid #e5e0fb;
    border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.admin-credit-card b { font-size: 1.4rem; color: #5b4bd5; }
.admin-credit-card span { font-size: .75rem; color: #98a0b3; }
.usage-stu-select { border: 1px solid #e3e6f0; border-radius: 10px; padding: 6px 10px; font-size: .82rem; color: #333a4d; max-width: 260px; }
.usage-td-time { white-space: nowrap; color: #98a0b3; }
.usage-table td { font-size: .84rem; }
.usage-table td:nth-child(3) { white-space: nowrap; }

/* ---------- 积分管理页 v3（3 Tab 布局） ---------- */
.wp-tabs { display: flex; gap: 6px; border-bottom: 2px solid #eef0f6; margin: 4px 0 16px; }
.wp-tab { border: none; background: none; padding: 10px 18px; font-size: .92rem; font-weight: 600;
    color: #8a90a3; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
    border-radius: 10px 10px 0 0; transition: all .15s; }
.wp-tab:hover { color: #5b4bd5; background: #f7f5ff; }
.wp-tab.on { color: #5b4bd5; border-bottom-color: #6c5ce7; background: #f7f5ff; }

.stu-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.stu-search { flex: 1; min-width: 200px; max-width: 340px; padding: 9px 14px; border: 1.5px solid #e2e6f2;
    border-radius: 999px; font-size: .88rem; outline: none; }
.stu-search:focus { border-color: #b9aef5; }
.stu-summary { font-size: .82rem; color: #576076; margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stu-summary b { color: #5b4bd5; }
.stu-list-wrap { background: #fff; border: 1px solid #eef0f6; border-radius: 14px; overflow: auto; max-height: 58vh; }
.stu-table { width: 100%; border-collapse: collapse; }
.stu-table th { text-align: left; font-size: .75rem; color: #98a0b3; font-weight: 600;
    padding: 10px 16px; background: #fafbff; position: sticky; top: 0; border-bottom: 1px solid #eef0f6; }
.stu-table td { padding: 9px 16px; border-bottom: 1px solid #f4f5fa; font-size: .86rem; vertical-align: middle; }
.stu-table tbody tr:hover { background: #fafbff; }
.stu-table tbody tr:last-child td { border-bottom: none; }
.stu-th-ops { text-align: right; }
.stu-td-name { display: flex; align-items: center; gap: 8px; }
.stu-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: inline-flex;
    align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
    color: #fff; background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
.stu-state { font-size: .72rem; border-radius: 999px; padding: 2px 10px; background: rgba(0,184,148,.12); color: #00b894; }
.stu-state.off { background: rgba(214,48,49,.1); color: #d63031; }
.stu-bal { font-size: .95rem; color: #5b4bd5; }
.stu-bal.low { color: #c77800; }
.stu-bal.zero { color: #d63031; }
.stu-ops { text-align: right; white-space: nowrap; }
.stu-ops .lib-btn { margin-left: 6px; }

.rate-cell { width: 86px; border: 1px solid #d9d4f7; border-radius: 8px; padding: 4px 8px;
    color: #5b4bd5; font-weight: 700; font-size: .88rem; background: #fff; }
.rate-save-line { display: flex; justify-content: flex-end; margin: 10px 0 6px; }

.price-panel { background: #f7f5ff; border: 1px solid #e5e0fb; border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; }
.price-panel-hd { font-size: .82rem; font-weight: 700; color: #5b4bd5; margin-bottom: 10px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 10px; }
.price-field { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e5e0fb;
    border-radius: 10px; padding: 6px 10px; font-size: .8rem; color: #576076; }
.price-field span { white-space: nowrap; }
.price-field input { width: 74px; border: 1px solid #d9d4f7; border-radius: 8px; padding: 3px 8px;
    color: #5b4bd5; font-weight: 700; background: #fff; }
.price-field em { font-style: normal; font-size: .68rem; color: #98a0b3; white-space: nowrap; }
.cost-table td, .cost-table th { white-space: nowrap; }
.cost-yuan { color: #d63031; font-weight: 600; }
.cost-margin.warn { color: #d63031; }
.cost-total td { background: #fafbff; }

.code-num { width: 90px !important; flex: none !important; min-width: 0 !important;
    border: 1px solid #e3e6f0; border-radius: 10px; padding: 6px 10px; font-size: .85rem; }
.code-badge { font-style: normal; font-size: .7rem; border-radius: 999px; padding: 2px 8px; margin-left: 8px; }
.code-badge.free { background: rgba(0,184,148,.12); color: #00b894; }
.code-badge.used { background: #eef0f6; color: #98a0b3; }
.code-right { display: flex; align-items: center; gap: 10px; }
