* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink: #17324d;
    --muted: #5f7185;
    --brand: #0f766e;
    --brand-2: #0e7490;
    --accent: #f59e0b;
    --bg: #eef5f4;
    --card: #ffffff;
    --line: #d9e6e3;
    --ok: #0f766e;
    --warn: #b45309;
    --bad: #b91c1c;
    --shadow: 0 10px 30px rgba(23, 50, 77, 0.09);
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at 15% 0%, rgba(15, 118, 110, 0.13), transparent 34%),
        radial-gradient(circle at 90% 12%, rgba(14, 116, 144, 0.10), transparent 30%),
        var(--bg);
    color: var(--ink);
    line-height: 1.6;
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 42px;
    background: linear-gradient(120deg, #0f766e 0%, #0e7490 58%, #155e75 100%);
    color: white;
    box-shadow: 0 4px 22px rgba(15, 118, 110, 0.28);
    position: sticky;
    top: 0;
    z-index: 30;
}

.brand .logo {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-sub {
    font-size: 12px;
    opacity: 0.78;
    margin-top: 2px;
}

.nav-menu {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.18);
}

.app-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 34px 20px 50px;
    min-height: calc(100vh - 150px);
}

.page-section {
    display: none;
    animation: fadeIn 0.35s ease;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-banner {
    padding: 46px 28px 36px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(246, 253, 251, 0.94));
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.eyebrow {
    display: inline-block;
    color: var(--brand);
    background: #e2f5f1;
    border-radius: 999px;
    padding: 4px 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.hero-banner h2 {
    font-size: clamp(24px, 4vw, 34px);
    color: var(--ink);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 有待复习词时，首页先说明白今天要做什么 */
.hero-review-hint {
    margin: 12px auto 0;
    max-width: 520px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff6e5;
    color: #8a5a12;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.primary-btn,
.ghost-btn,
.icon-btn {
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    border-radius: 999px;
    padding: 11px 24px;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.primary-btn {
    background: linear-gradient(135deg, #0f766e, #0e7490);
    color: #fff;
    box-shadow: 0 7px 16px rgba(15, 118, 110, 0.26);
    font-weight: 700;
}

.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
    transform: translateY(-1px);
    opacity: 0.96;
}

.primary-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.ghost-btn {
    background: #fff;
    color: var(--brand);
    border: 1px solid rgba(15, 118, 110, 0.35);
}

.primary-btn.small {
    padding: 8px 17px;
    font-size: 14px;
}

.icon-btn {
    background: #edf7f5;
    color: var(--brand);
    padding: 9px 16px;
    border: 1px solid #d3eae5;
}

.load-status {
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.feature-card {
    background: var(--card);
    border-radius: 16px;
    padding: 24px 22px;
    box-shadow: 0 6px 18px rgba(23, 50, 77, 0.07);
    text-align: center;
    border: 1px solid #edf2f1;
}

.feature-icon {
    font-size: 34px;
    margin-bottom: 8px;
}

.feature-card h3 {
    font-size: 17px;
    margin-bottom: 6px;
}

.feature-card p {
    color: var(--muted);
    font-size: 14px;
}

.panel {
    background: var(--card);
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 6px 18px rgba(23, 50, 77, 0.06);
    border: 1px solid #edf2f1;
}

.today-panel {
    margin-top: 22px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.panel-head h3 {
    font-size: 17px;
}

.hint-text,
.section-subtitle {
    color: var(--muted);
    font-size: 13px;
}

.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

.mini-stats > div {
    background: #f6fbfa;
    border: 1px solid #e8f1ef;
    border-radius: 12px;
    padding: 12px 8px;
}

.mini-stats strong {
    display: block;
    color: var(--brand);
    font-size: 24px;
    line-height: 1.2;
}

.mini-stats span {
    color: var(--muted);
    font-size: 13px;
}

.milestone-stat {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--brand);
}

.section-title {
    text-align: center;
    font-size: 25px;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.section-subtitle {
    text-align: center;
    margin-bottom: 20px;
}

.practice-container {
    max-width: 680px;
    margin: 0 auto;
}

.practice-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.85);
    padding: 12px 18px;
    border-radius: 14px;
}

/* 跟读页操作条挪到页面下方：滚动时贴在视口底部，随时能按暂停/结束 */
#practice .practice-topbar {
    position: sticky;
    bottom: 10px;
    z-index: 6;
    margin-top: 18px;
    margin-bottom: 0;
    background: #ffffff;
    border: 1px solid rgba(15, 118, 110, 0.14);
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.14);
    flex-wrap: wrap;
}

/* 底部操作条里的「已读单词」标签：全对绿勾，有错红叉 */
#practice .round-marks {
    flex: 1 0 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(15, 118, 110, 0.16);
}

#practice .round-mark {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    line-height: 1.4;
    white-space: nowrap;
}

#practice .round-mark i {
    font-style: normal;
    font-weight: 800;
}

#practice .round-mark.ok {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #15803d;
}

#practice .round-mark.bad {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.round-text {
    font-size: 14px;
    color: var(--muted);
    margin-top: 4px;
}

.drill-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.drill-controls .ghost-btn {
    padding: 7px 13px;
    font-size: 14px;
    line-height: 1.2;
    flex: 0 0 auto;
    white-space: nowrap;
}

.drill-controls .ghost-btn.on {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.drill-controls .ghost-btn:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
}

@media (max-width: 560px) {
    .practice-topbar {
        gap: 10px;
        padding: 10px 12px;
    }

    .round-progress {
        max-width: none;
        min-width: 40px;
    }
}

.round-progress {
    flex: 1;
    max-width: 260px;
    height: 9px;
    background: #deece9;
    border-radius: 999px;
    overflow: hidden;
}

.round-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #0f766e, #f59e0b);
    border-radius: inherit;
    transition: width 0.25s ease;
}

.word-card {
    background: var(--card);
    border-radius: 20px;
    padding: 34px 26px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 18px;
    border: 1px solid #ecf3f1;
    position: relative;
}

.unit-badge {
    display: inline-block;
    position: absolute;
    top: 14px;
    left: 16px;
    background: #fff7e6;
    color: #b45309;
    border: 1px solid #fde3b0;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
}

.english-word {
    font-size: clamp(38px, 7vw, 56px);
    font-weight: 800;
    letter-spacing: 1px;
    color: #0f4f49;
    margin-top: 10px;
    margin-bottom: 4px;
    word-break: break-word;
}

/* 复习时中文当题干：字号小一档，别糊成一片 */
.english-word.is-cn {
    font-size: clamp(26px, 4.6vw, 40px);
    letter-spacing: 0;
    line-height: 1.25;
}

.phonetic {
    font-size: 18px;
    color: var(--muted);
    margin-bottom: 18px;
}

.word-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chinese-meaning {
    margin-top: 18px;
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    padding: 10px;
    border-top: 1px dashed var(--line);
}

.finish-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.finish-actions .primary-btn {
    min-width: 190px;
}

.hidden {
    display: none !important;
}

.practice-instructions {
    background: #fffdf7;
    border: 1px solid #f8e8c6;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.practice-instructions p {
    color: #6b5a37;
    font-size: 14px;
    margin: 4px 0;
}

.answer-panel {
    background: var(--card);
    border-radius: 18px;
    padding: 22px 24px;
    box-shadow: 0 8px 22px rgba(23, 50, 77, 0.07);
    border: 1px solid #ecf3f1;
}

.field {
    display: block;
    margin-bottom: 14px;
}

.field span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    border: 1.5px solid #d7e5e2;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 16px;
    font-family: inherit;
    color: var(--ink);
    background: #fbfdfd;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

.answer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.feedback-panel {
    margin-top: 16px;
    border-radius: 16px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 6px 18px rgba(23, 50, 77, 0.05);
}

.feedback-panel.ok { border-color: #a7dcd2; background: #f2fcf9; }
.feedback-panel.warn { border-color: #f3d29a; background: #fffaf0; }
.feedback-panel.bad { border-color: #eecaca; background: #fff7f7; }

.feedback-panel h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.feedback-panel.ok h3 { color: var(--ok); }
.feedback-panel.warn h3 { color: var(--warn); }
.feedback-panel.bad h3 { color: var(--bad); }

.score-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.score-row > div {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(217, 230, 227, 0.9);
    border-radius: 12px;
    padding: 12px;
}

.score-row span { color: var(--muted); font-size: 13px; display: block; }
.score-row strong { font-size: 26px; color: var(--brand); display: block; line-height: 1.2; }
.score-row em { font-size: 12px; color: var(--muted); font-style: normal; }

.feedback-note {
    margin-top: 12px;
    font-size: 13px;
    color: var(--muted);
}

.feedback-panel .primary-btn {
    margin-top: 14px;
}

.review-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 620px;
    margin: 0 auto 14px;
    flex-wrap: wrap;
}

.review-list {
    max-width: 620px;
    margin: 0 auto;
}

.review-item {
    background: var(--card);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    border: 1px solid #eaf1ef;
    box-shadow: 0 3px 12px rgba(23, 50, 77, 0.05);
}

.review-item.due {
    border-left: 5px solid var(--accent);
    background: #fffdf7;
}

.review-word {
    font-size: 17px;
    font-weight: 800;
    color: var(--ink);
}

.review-unit {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    background: #eef6f4;
    border-radius: 6px;
    padding: 2px 6px;
    margin-left: 6px;
    vertical-align: 1px;
}

.review-meaning {
    color: var(--muted);
    font-size: 13px;
}

/* 记得库 / 熟记库 两档标签 */
.tier-tag {
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    padding: 2px 6px;
    margin-left: 4px;
    vertical-align: 1px;
}

.tier-tag.remembered {
    color: #8a5a12;
    background: #fff6e5;
}

.tier-tag.mastered {
    color: #0f4f49;
    background: #d8f0ea;
}

.review-time {
    color: var(--brand);
    font-size: 13px;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    background: #fff;
    border-radius: 14px;
    padding: 28px 18px;
    border: 1px dashed var(--line);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto 18px;
}

.stat-card {
    background: var(--card);
    border-radius: 15px;
    padding: 22px 18px;
    text-align: center;
    box-shadow: 0 5px 16px rgba(23, 50, 77, 0.06);
    border: 1px solid #ecf3f1;
}

.stat-number {
    font-size: 34px;
    font-weight: 800;
    color: var(--brand);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.stats-note {
    max-width: 900px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 13px;
}

.stats-note h3 { color: var(--ink); font-size: 16px; margin-bottom: 6px; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translate(-50%, 20px);
    background: rgba(23, 50, 77, 0.94);
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 60;
    max-width: min(90vw, 520px);
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.app-footer {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid #e4eeec;
}

@media (max-width: 700px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 18px;
    }
    .nav-menu { width: 100%; justify-content: flex-start; }
    .app-main { padding: 18px 12px 36px; }
    .hero-banner { padding: 30px 16px 26px; border-radius: 16px; }
    .word-card { padding: 28px 16px; }
    .unit-badge { position: static; margin-bottom: 8px; }
    .score-row { grid-template-columns: 1fr; }
    .review-item { align-items: flex-start; flex-direction: column; gap: 4px; }
    .practice-topbar { flex-direction: column; align-items: stretch; }
    .round-progress { max-width: none; }
    .mini-stats { gap: 6px; }
    .primary-btn, .ghost-btn { width: 100%; }
    .answer-actions { flex-direction: column; }
}

/* ===== 数字人面板 ===== */
.avatar-panel {
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
    padding: 14px;
    background: linear-gradient(160deg, #f2f7ff 0%, #ffffff 60%);
    border: 1px solid #dbe7f7;
    border-radius: 16px;
}

.avatar-stage {
    display: flex;
    gap: 14px;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.avatar {
    width: 150px;
    height: 175px;
    flex: 0 0 auto;
}

.avatar-bubble {
    position: relative;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #dbe7f7;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.6;
    color: #2c3e50;
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.08);
}

.avatar-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 28px;
    border: 8px solid transparent;
    border-right-color: #fff;
}

.avatar-side {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 290px;
    flex: 0 0 auto;
}

.self-cam {
    width: 100%;
    height: 130px;
    border-radius: 12px;
    background: #0f172a;
    object-fit: cover;
    opacity: 0.35;
}

.self-cam.on { opacity: 1; }

.avatar-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.avatar-tools .icon-btn {
    flex: 1 1 auto;
    font-size: 13px;
    padding: 6px 8px;
}

#camStatus {
    font-size: 12px;
    color: #7b8794;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .avatar-panel { flex-direction: column; }
    .avatar-side { width: 100%; flex-direction: row; align-items: center; gap: 10px; }
    .self-cam { width: 120px; height: 90px; }
}

.voice-setting {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: #57606a;
}

.voice-select {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid #dbe7f7;
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
}

.rate-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rate-label input[type="range"] { flex: 1 1 auto; }

@keyframes avatarFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.avatar { animation: avatarFloat 4s ease-in-out infinite; }
.book-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0 6px;
}

.book-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2c3e50;
    font-weight: 600;
}

.book-select {
    padding: 6px 10px;
    border: 1px solid #dbe7f7;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    color: #2c3e50;
}

.book-select option:disabled { color: #a0aab4; }
.login-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh; z-index: 999;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #0f766e, #115e59);
    overflow: auto;
}

.login-card {
    width: min(92vw, 360px);
    background: #fff; border-radius: 18px; padding: 26px 22px;
    box-shadow: 0 18px 50px rgba(0,0,0,.25);
    display: flex; flex-direction: column; gap: 12px;
}

.login-logo { font-size: 22px; font-weight: 700; color: #0f766e; text-align: center; }
.login-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #334155; }
.login-field input { padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 15px; }
.login-msg { min-height: 20px; font-size: 13px; color: #c2410c; }

.user-chip {
    margin-left: auto; display: flex; align-items: center; gap: 8px;
    color: #e6fffb; font-size: 13px; white-space: nowrap; flex: 0 0 auto;
}

.user-chip button {
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.55);
    color: #fff; padding: 6px 14px; font-size: 13px;
}

.admin-create { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.admin-create input { padding: 8px 10px; border: 1px solid #dbe7f7; border-radius: 10px; font-size: 14px; flex: 1 1 160px; }

.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-item {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 10px 12px; border: 1px solid #e5eef9; border-radius: 12px; background: #f8fbff;
}
.user-item { flex-wrap: wrap; }
.user-item-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; white-space: nowrap; }
.user-item .hint-text { font-size: 12px; }
.import-row { margin: 10px 0 0; }

@media (max-width: 720px) {
    .app-header { flex-wrap: wrap; gap: 10px; padding: 14px 18px; }
    .user-chip { width: auto; margin-left: auto; }
    .nav-menu { width: 100%; }
}

/* w19: 自动带读状态 */
.word-actions { flex-wrap: wrap; }
.drill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #eaf7f1;
    color: #1f7a5a;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #bfe6d6;
}
.drill-status {
    font-size: 14px;
    color: #4a5b53;
    line-height: 1.5;
}
.pron-status { color: #1f7a5a; }

/* w25: 拼写正确的鼓励词 */
.praise-box {
    text-align: center;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #1f7a5a;
    margin: 4px 0 10px;
    animation: praisePop .45s ease-out;
}
@keyframes praisePop {
    0% { transform: scale(.7); opacity: 0; }
    70% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}


/* ===== 品牌素材：鲸鱼阿来 BlueWhale Arai ===== */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* 页头英文 Logo：白底小卡托住深蓝字标，保证在青绿页头上清晰 */
.brand-logo {
    display: block;
    height: 38px;
    width: auto;
    padding: 4px 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.brand-text {
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex-wrap: nowrap;
    white-space: nowrap;
    min-width: 0;
}

.brand-text .logo {
    font-size: 19px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-text .brand-en {
    font-size: 19px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.brand-text .brand-en::before {
    content: '·';
    margin: 0 8px;
    font-weight: 700;
    opacity: 0.8;
}

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
}

.brand-text {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
    min-width: 0;
}

.login-brand {
    display: block;
    width: 150px;
    height: auto;
    margin: 0 auto 4px;
}

/* 首页主视觉右侧的吉祥物 */
.hero-banner {
    position: relative;
}

.hero-mascot {
    position: absolute;
    left: 44px;
    top: 50%;
    margin-top: -88px;
    width: 176px;
    height: auto;
    pointer-events: none;
    filter: drop-shadow(0 12px 20px rgba(15, 118, 110, 0.2));
    animation: mascotFloat 5.5s ease-in-out infinite;
}

@keyframes mascotFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}

/* 桌面端阿来只做左侧装饰，正文按整张卡片宽度居中（不再用左内边距把文字挤偏） */
@media (min-width: 901px) and (max-width: 1180px) {
    .hero-mascot { width: 140px; left: 20px; margin-top: -70px; }
}

@media (max-width: 900px) {
    .hero-mascot {
        position: static;
        display: block;
        width: 140px;
        margin: 12px auto 0;
    }
}

/* 数字人：吉祥物形象 */
.mascot-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 62%, #e7f2ff 0%, rgba(231, 242, 255, 0) 72%);
    border-radius: 50%;
}

.avatar-mascot {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

/* ===== 阿来分层：口型三帧（闭嘴/半张/大张）+ 表情层 ===== */
.mascot-stage {
    position: relative;
}

.mascot-layers {
    position: relative;
    width: 100%;
    height: 100%;
    /* 基础层先快速退场，避免和表情层两张不同的姿势长时间叠在一起（重影） */
    transition: opacity 0.09s ease-out;
    will-change: opacity;
}

.avatar-mascot.layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.avatar-mascot.base {
    position: relative;
}

.mouth-layer {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.04s linear;
}

.mouth-layer.on {
    opacity: 1;
}

.mascot-stage.expr-on .mascot-layers {
    opacity: 0;
}

/* 表情层：换图时从 0.96 倍轻轻"长"到原尺寸，看起来像换表情而不是硬切 */
.expr-layer {
    opacity: 0;
    transform: scale(0.96);
    transform-origin: 50% 70%;
    pointer-events: none;
    transition: opacity 0.16s ease-out, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
    will-change: opacity, transform;
}

.expr-layer.on {
    opacity: 1;
    transform: scale(1);
}

/* 肢体：说话轻点头、答对跳一下、答错摇头、听你说时身体前倾 */
@keyframes mascotNod {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -2px; }
}

@keyframes mascotJump {
    0% { translate: 0 0; }
    28% { translate: 0 -14px; }
    55% { translate: 0 0; }
    72% { translate: 0 -6px; }
    100% { translate: 0 0; }
}

@keyframes mascotShake {
    0%, 100% { translate: 0 0; }
    20% { translate: -6px 0; }
    45% { translate: 5px 0; }
    70% { translate: -3px 0; }
}

@keyframes mascotLean {
    0%, 100% { translate: 0 0; rotate: 0deg; }
    50% { translate: 3px 0; rotate: -1.5deg; }
}

.mascot-stage.is-talking {
    animation: avatarFloat 4s ease-in-out infinite, mascotNod 0.7s ease-in-out infinite;
}

.mascot-stage.is-listen {
    animation: avatarFloat 4s ease-in-out infinite, mascotLean 2.4s ease-in-out infinite;
}

.mascot-stage.is-happy {
    animation: avatarFloat 4s ease-in-out infinite, mascotJump 0.7s ease-out 1;
}

.mascot-stage.is-oops {
    animation: avatarFloat 4s ease-in-out infinite, mascotShake 0.5s ease-in-out 1;
}

.avatar-mascot.talking {
    animation: mascotTalk 0.34s ease-in-out infinite alternate;
}

/* 说话只轻轻上下点头，不再整体缩放 —— 缩放会让人误以为形象忽大忽小 */
@keyframes mascotTalk {
    from { transform: translateY(0); }
    to { transform: translateY(-3px); }
}

/* 鼓励表情 */
.praise-img {
    display: block;
    width: 132px;
    height: 132px;
    object-fit: contain;
    margin: 8px auto 2px;
    animation: praisePop 0.45s cubic-bezier(0.2, 1.4, 0.5, 1);
}

@keyframes praisePop {
    from { opacity: 0; transform: scale(0.6) rotate(-8deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

/* 窄屏：保证「鲸鱼阿来 AI 英语陪练」仍在一行 */
@media (max-width: 560px) {
    .brand { gap: 7px; }
    .brand-logo { height: 32px; padding: 3px 8px; border-radius: 10px; }
    .brand-text { gap: 7px; }
    .brand-text .logo { font-size: 16px; }
    .brand-text .brand-en { font-size: 16px; letter-spacing: 0.3px; }
    .brand-text .brand-en::before { margin: 0 6px; }
}

/* ===== 开场过渡：首页淡出，练习页先只留阿来 ===== */
.page-section {
    transition: opacity 0.32s ease, transform 0.32s ease;
}

.page-section.fading-out {
    opacity: 0;
    transform: translateY(6px);
}

#practice .practice-topbar,
#practice .word-card,
#practice .practice-instructions {
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.practice-container.intro-focus .word-card,
.practice-container.intro-focus .practice-instructions {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.practice-container.intro-focus .avatar-panel {
    animation: introPop 0.5s ease;
}

@keyframes introPop {
    from { opacity: 0.4; transform: scale(0.985); }
    to { opacity: 1; transform: scale(1); }
}


/* ===== 阿来的过渡飞行 ===== */
.mascot-flyer {
    position: fixed;
    z-index: 80;
    margin: 0;
    padding: 0;
    transform-origin: 0 0;
    pointer-events: none;
    object-fit: contain;
    animation: none !important;
    filter: drop-shadow(0 10px 18px rgba(15, 118, 110, 0.22));
}

body.mascot-flying #home .page-section,
body.mascot-flying #home {
    transition: opacity 0.25s ease;
}

/* ===== 跟读页顶栏：小屏也把「暂停/结束」留在一行，进度条单独一行 ===== */
@media (max-width: 700px) {
    #practice .practice-topbar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    #practice .practice-topbar > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }

    #practice .drill-controls {
        order: 2;
        margin-left: auto;
        flex: 0 0 auto;
    }

    #practice .drill-controls .ghost-btn {
        width: auto;
        padding: 7px 12px;
    }

    #practice .round-progress {
        order: 3;
        flex: 1 1 100%;
        height: 9px;
        max-width: none;
    }
}

/* ===== 登录 / 注册切换 ===== */
.auth-tabs {
    display: flex;
    gap: 6px;
    background: #f1f7f6;
    padding: 4px;
    border-radius: 12px;
}

.auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 0;
    border-radius: 9px;
    font-size: 15px;
    font-family: inherit;
    color: #475569;
    cursor: pointer;
}

.auth-tab.active {
    background: #fff;
    color: #0f766e;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.14);
}

.auth-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.code-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.code-row input {
    flex: 1 1 auto;
    min-width: 0;
}

.code-row .ghost-btn {
    flex: 0 0 auto;
    width: auto;
    padding: 0 14px;
    font-size: 14px;
    white-space: nowrap;
}

.code-row .ghost-btn:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
}

.login-field select {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
}

.login-dev-code {
    font-size: 13px;
    color: #0f766e;
    background: #ecfdf5;
    border: 1px dashed #99f6e4;
    border-radius: 10px;
    padding: 8px 10px;
}

/* ===== 词卡尺寸固定：不管词有多长、释义/状态文案有几行，框的大小始终不变 ===== */
#practice .word-card {
    height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

/* 释义行常驻占位（隐藏时只藏字不塌陷） */
#practice .word-card #chineseMeaning.hidden {
    display: block !important;
    visibility: hidden;
}

/* 状态行预留高度，短文案也不会让整张卡往上缩 */
#practice .word-card .word-actions {
    min-height: 64px;
    align-items: center;
}

#practice .word-card .drill-status {
    display: block;
    max-width: 100%;
}

/* 表扬浮层：绝对定位，不占布局、不改卡片高度 */
#practice .word-card .praise-box,
#practice .word-card .praise-img {
    position: absolute;
    left: 50%;
    margin: 0;
    z-index: 4;
    pointer-events: none;
    animation: praisePopCenter 0.45s cubic-bezier(0.2, 1.4, 0.5, 1);
}

#practice .word-card .praise-box {
    top: 32%;
    transform: translate(-50%, -50%);
    font-size: 42px;
}

#practice .word-card .praise-img {
    top: 68%;
    width: 146px;
    height: 146px;
    transform: translate(-50%, -50%);
}

@keyframes praisePopCenter {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (max-width: 700px) {
    #practice .word-card {
        padding: 24px 16px;
    }
    #practice .word-card .praise-img {
        width: 120px;
        height: 120px;
    }
}

/* ---------- 里程碑 · 徽章墙 ---------- */
.milestone-panel {
    margin-top: 22px;
}

.badge-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 14px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px 12px;
    border-radius: 14px;
    background: #f7fbfa;
    border: 1px solid #e6f0ee;
    text-align: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.badge-item img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 3px 6px rgba(23, 50, 77, 0.14));
}

.badge-item .badge-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}

.badge-item .badge-sub {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.3;
}

.badge-item.got {
    background: linear-gradient(180deg, #fffdf5, #f4fbf8);
    border-color: #f0d79b;
    box-shadow: 0 4px 14px rgba(180, 137, 30, 0.14);
}

.badge-item.got:hover {
    transform: translateY(-2px);
}

.badge-item.locked img {
    opacity: 0.32;
    filter: grayscale(0.85);
}

.badge-item.locked .badge-name {
    color: var(--muted);
}

.badge-item.medal {
    grid-column: span 1;
}

.milestone-panel .milestone-summary {
    font-size: 13px;
    color: var(--muted);
}

.ship-hint {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff8e8;
    border: 1px solid #f3e0b4;
    color: #8a5a09;
    font-size: 13px;
}

/* 注册 / 资料里的收货地址 */
.ship-block {
    margin: 14px 0 4px;
    padding: 14px 16px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    background: #f9fcfb;
    display: grid;
    gap: 10px;
}

.ship-block .ship-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.ship-block .ship-tip {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.ship-block .ship-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ship-block input,
.ship-block textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}

.ship-block textarea {
    min-height: 64px;
    resize: vertical;
}

/* 我的资料页 */
.profile-panel {
    max-width: 640px;
}

.profile-panel .field {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.profile-panel label {
    font-size: 13px;
    color: var(--muted);
}

.profile-panel input,
.profile-panel textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
}

.profile-panel textarea {
    min-height: 70px;
    resize: vertical;
}

.profile-meta {
    display: grid;
    gap: 6px;
    margin: 6px 0 16px;
    font-size: 13px;
    color: var(--muted);
}

.profile-msg {
    margin-top: 10px;
    font-size: 13px;
    color: var(--brand);
    min-height: 18px;
}

/* 管理员看到的地址 */
.user-ship {
    margin-top: 4px;
    font-size: 12px;
    color: #8a5a09;
    background: #fff8e8;
    border-radius: 8px;
    padding: 6px 9px;
    line-height: 1.45;
}

.user-ship.muted {
    color: var(--muted);
    background: #f5f7f8;
}

@media (max-width: 700px) {
    .badge-wall {
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
        gap: 10px;
    }
    .badge-item img {
        width: 62px;
        height: 62px;
    }
    .ship-block .ship-row {
        grid-template-columns: 1fr;
    }
}

.milestone-note {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 14px;
    line-height: 1.6;
}

.ship-block .ship-note {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55;
    margin: 0 0 2px;
}

.ship-block .login-field {
    font-size: 13px;
    color: var(--muted);
    display: grid;
    gap: 6px;
}

/* 未解锁徽章：保留图形轮廓，只做淡化，避免看起来像坏图 */
.badge-item.locked img {
    opacity: 0.55;
    filter: grayscale(0.7);
}

/* ---------- 阿来的里程碑祝贺弹窗 ---------- */
.milestone-pop {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 90;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 380px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(160deg, #ffffff, #f4fbf8);
    border: 1px solid #f0d79b;
    box-shadow: 0 14px 34px rgba(23, 50, 77, 0.18);
    animation: mpIn 0.28s ease-out;
}

@keyframes mpIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.milestone-pop .mp-face {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex: 0 0 auto;
    animation: mpBob 2.4s ease-in-out infinite;
}

@keyframes mpBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.milestone-pop .mp-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 4px;
}

.milestone-pop .mp-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
    margin: 0 0 10px;
}

.milestone-pop .mp-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 已寄出标记与寄送记录 */
.badge-ship {
    margin-top: 2px;
    font-size: 10px;
    color: #8a5a09;
    background: #fff2d1;
    border-radius: 6px;
    padding: 1px 6px;
}

.ship-records {
    margin-top: 14px;
    display: grid;
    gap: 6px;
}

.ship-records-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.ship-record {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: baseline;
    font-size: 12px;
    color: var(--muted);
    background: #f7fbfa;
    border: 1px solid #e6f0ee;
    border-radius: 10px;
    padding: 8px 12px;
}

.ship-record-no {
    font-weight: 600;
    color: var(--brand);
}

/* 管理员登记寄送弹窗 */
.ship-modal {
    position: fixed;
    inset: 0;
    z-index: 95;
    background: rgba(16, 36, 52, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ship-modal-card {
    width: min(460px, 100%);
    background: #fff;
    border-radius: 18px;
    padding: 22px 24px;
    box-shadow: var(--shadow);
}

.ship-modal-card h3 {
    margin-bottom: 6px;
    font-size: 18px;
}

.ship-modal-card .field {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--muted);
}

.ship-modal-card input {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
}

/* 这两个弹层是 flex 布局，必须显式关掉 */
.ship-modal.hidden,
.milestone-pop.hidden {
    display: none !important;
}

.milestone-pop .mp-actions .primary-btn,
.milestone-pop .mp-actions .ghost-btn {
    width: auto;
    flex: 0 0 auto;
    padding: 7px 16px;
    font-size: 13px;
}

/* 复制按钮 */
.copy-btn {
    border: 1px solid #cfe2de;
    background: #fff;
    color: var(--brand);
    font-size: 11px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    vertical-align: middle;
}

.copy-btn:hover {
    background: #eef8f6;
}

.ship-modal-addr {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
    background: #f7fbfa;
    border: 1px solid #e6f0ee;
    border-radius: 10px;
    padding: 8px 10px;
    margin: 0 0 12px;
    line-height: 1.5;
}

.user-ship .copy-btn {
    margin-left: 6px;
}

/* ---------- 时长计费与充值 ---------- */
.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f6f4;
  color: #0f5f57;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.wallet-chip.wallet-low { background: #fdecec; color: #b3261e; }
.wallet-chip .wallet-unit { font-weight: 400; opacity: .75; }
.wallet-chip button { margin-left: 2px; }

.pay-packages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}
.pay-pkg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px;
  border: 1.5px solid #d7e6e3;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.pay-pkg:hover { border-color: #17a398; transform: translateY(-1px); }
.pay-pkg strong { font-size: 17px; color: #0f5f57; }
.pay-pkg span { font-size: 12px; color: #40514e; }
.pay-pkg em { font-style: normal; font-size: 11px; color: #8a9a97; }

.pay-method { display: flex; gap: 16px; font-size: 14px; color: #40514e; margin-bottom: 8px; }
.pay-order { border-top: 1px dashed #d7e6e3; padding-top: 10px; }
.pay-order p { margin: 4px 0; font-size: 14px; }
.pay-qr { display: block; width: 180px; height: 180px; object-fit: contain; margin: 8px auto; border: 1px solid #eee; border-radius: 10px; }

/* 阿来页顶部的剩余时长按钮 */
.talk-left {
  border: 1px solid #cfe6e2;
  background: #eef9f7;
  color: #0f5f57;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.talk-left.empty { background: #fdecec; border-color: #f3c6c6; color: #b3261e; }
