/* ==========================================
   模态框和弹窗样式
   ========================================== */

/* 教学模态窗口样式 */
.tutorial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2300;
    display: none;
    padding: 40px 20px;
}

.tutorial-title {
    color: white;
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.tutorial-close-button {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tutorial-close-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 教学选项卡样式 */
.tutorial-tabs {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
    width: 90%;
    max-width: 520px;
}

.tutorial-tab {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    flex: 1;
    max-width: 180px;
    border-bottom: 3px solid transparent;
}

.tutorial-tab:hover {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.tutorial-tab.active {
    background: rgba(106, 17, 203, 0.35);
    border-bottom: 3px solid #6a11cb;
    color: white;
    font-weight: bold;
}

/* ── Step Card ─────────────────────────────── */
.tutorial-step-container {
    width: 90%;
    max-width: 420px;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.tutorial-step-card {
    width: 100%;
    background: #1e1e32;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(16px);
}

.tutorial-step-card.animate-in {
    animation: stepSlideIn 0.35s ease forwards;
}

@keyframes stepSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tutorial-step-icon {
    font-size: 56px;
    margin-bottom: 18px;
    line-height: 1;
    color: #c9a0ff;
}

.tutorial-step-icon-inline {
    font-size: 24px;
    color: #c9a0ff;
    margin-right: 8px;
}

.tutorial-step-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.tutorial-step-desc {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* ── Navigation Row ────────────────────────── */
.tutorial-nav-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tutorial-nav-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 24px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.tutorial-nav-button:hover:not([disabled]) {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.tutorial-nav-button[disabled] {
    opacity: 0.25;
    cursor: not-allowed;
}

/* ── Dots ──────────────────────────────────── */
.tutorial-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tutorial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.25s ease;
}

.tutorial-dot.active {
    background: #6a11cb;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(106, 17, 203, 0.6);
}

.tutorial-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.45);
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .tutorial-modal {
        padding: 30px 12px;
    }

    .tutorial-title {
        font-size: 22px;
    }

    .tutorial-tab {
        font-size: 13px;
        padding: 8px 10px;
    }

    .tutorial-step-container {
        min-height: 220px;
    }

    .tutorial-step-card {
        padding: 30px 20px;
    }

    .tutorial-step-icon {
        font-size: 44px;
    }

    .tutorial-step-title {
        font-size: 19px;
    }

    .tutorial-step-desc {
        font-size: 14px;
    }
}

/* ── Spotlight Overlay (Basics tab walkthrough) ── */
.tutorial-spotlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    pointer-events: auto;
}

/* The "hole" — transparent box over target, massive box-shadow darkens rest */
.tutorial-spotlight-hole {
    position: fixed;
    z-index: 100000;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
    transition: all 0.35s ease;
    pointer-events: none;
}

/* Tooltip bubble */
.tutorial-spotlight-tooltip {
    position: fixed;
    z-index: 100002;
    width: 85%;
    max-width: 340px;
    background: #19192d;
    border: 1px solid rgba(106, 17, 203, 0.4);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tutorial-spotlight-tooltip.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tutorial-spotlight-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 8px solid rgba(25, 25, 45, 0.95);
}

.spotlight-tip-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.spotlight-tip-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin-bottom: 16px;
}

.spotlight-tip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.spotlight-tip-counter {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

.spotlight-tip-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.spotlight-tip-skip {
    background: none;
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.spotlight-tip-skip:hover {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.3);
}

.spotlight-tip-btn {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.spotlight-tip-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.5);
}

/* ── Card Overlay (for card + divider steps) ──── */
.tutorial-card-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100003;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
}

/* Cards inside card-overlay need constrained sizing */
.tutorial-card-overlay>.tutorial-step-card,
.tutorial-card-overlay>.tutorial-divider-card {
    width: 90%;
    max-width: 360px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Divider section header card */
.tutorial-divider-card {
    width: 90%;
    max-width: 360px;
    background: rgba(30, 30, 50, 0.9);
    border: 1px solid rgba(106, 17, 203, 0.3);
    border-radius: 20px;
    padding: 36px 28px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(16px);
}

.tutorial-divider-card.animate-in {
    animation: stepSlideIn 0.35s ease forwards;
}

.tutorial-divider-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

/* ── Tutorial Progress Bar ──── */
.tutorial-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 100010;
}

.tutorial-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6a11cb, #2575fc);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(106, 17, 203, 0.5);
}

/* ── Tutorial Practice Card ──── */
.tutorial-practice-card {
    background: #1a1a2e;
    border: 1px solid rgba(106, 17, 203, 0.3);
    border-radius: 20px;
    padding: 24px 20px;
    width: 90%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(16px);
}

.tutorial-practice-card.animate-in {
    animation: stepSlideIn 0.35s ease forwards;
}

.tutorial-practice-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.tutorial-practice-header .tutorial-step-icon-inline {
    font-size: 24px;
    color: #c9a0ff;
}

.tutorial-practice-header .tutorial-step-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.tutorial-practice-area {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 24px 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── Meteor Practice ──── */
.tutorial-meteor-zone {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 140px;
    margin-bottom: 16px;
}

.tutorial-static-meteor {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin: 0 auto;
    pointer-events: none;
}

.tutorial-letters-display {
    font-size: 36px;
    color: #e0af00;
    font-weight: bold;
    min-height: 48px;
    letter-spacing: 4px;
    text-shadow: 0 0 10px rgba(224, 175, 0, 0.5);
    margin-bottom: 8px;
}

.tutorial-input-hint {
    font-size: 13px;
    color: rgba(238, 238, 238, 0.6);
    margin-top: 8px;
}

/* ── Pinyin Practice ──── */
.tutorial-target-char {
    font-size: 80px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tutorial-pinyin-slots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    min-height: 60px;
}

.tutorial-pinyin-slot {
    width: 48px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.tutorial-pinyin-slot.filled {
    border-color: rgba(106, 17, 203, 0.5);
    background: rgba(106, 17, 203, 0.15);
    color: #c9a0ff;
}

.tutorial-pinyin-slot.correct {
    border-color: rgba(76, 175, 80, 0.6);
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.tutorial-pinyin-slot.incorrect {
    border-color: rgba(255, 75, 43, 0.6);
    background: rgba(255, 75, 43, 0.2);
    color: #ff8a80;
}

.tutorial-tone-hint {
    font-size: 13px;
    color: rgba(238, 238, 238, 0.6);
}

.tutorial-pinyin-display {
    font-size: 32px;
    font-weight: 600;
    color: #c9a0ff;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 24px;
    min-width: 120px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    letter-spacing: 4px;
}

.tutorial-pinyin-display.correct {
    border-color: rgba(76, 175, 80, 0.6);
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.tutorial-pinyin-display.incorrect {
    border-color: rgba(255, 75, 43, 0.6);
    background: rgba(255, 75, 43, 0.2);
    color: #ff8a80;
}

/* ── Complete Card ──── */
.tutorial-complete-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.tutorial-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.tutorial-action-btn-time {
    background: linear-gradient(135deg, #33cc33, #1a991a);
    color: white;
    box-shadow: 0 4px 15px rgba(51, 204, 51, 0.4);
}

.tutorial-action-btn-time:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(51, 204, 51, 0.5);
}

.tutorial-action-btn-learn {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.4);
}

.tutorial-action-btn-learn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(106, 17, 203, 0.5);
}

.tutorial-action-btn-guide {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: white;
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.4);
}

.tutorial-action-btn-guide:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(106, 17, 203, 0.5);
}

/* ── Language Selection Screen ──── */
.tutorial-lang-select {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100020;
    background: linear-gradient(135deg, #000033 0%, #0a0a2e 50%, #000033 100%);
    background-size: 200% 200%;
    animation: langBgShift 8s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

@keyframes langBgShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tutorial-lang-select-exit {
    opacity: 0;
}

.tutorial-lang-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.tutorial-lang-greeting {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(20px);
    animation: langFadeUp 0.6s ease forwards;
}

.tutorial-lang-subtitle {
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(15px);
    animation: langFadeUp 0.6s ease 0.15s forwards;
}

.tutorial-lang-btn-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 280px;
}

.tutorial-lang-btn {
    width: 100%;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transform: translateY(20px);
    animation: langFadeUp 0.5s ease forwards;
}

.tutorial-lang-btn:hover {
    background: rgba(106, 17, 203, 0.2);
    border-color: rgba(106, 17, 203, 0.5);
    transform: scale(1.03);
}

.tutorial-lang-btn:active {
    transform: scale(0.97);
}

.tutorial-lang-btn-label {
    font-size: 20px;
    font-weight: 700;
}

.tutorial-lang-btn-sub {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.45);
}

@keyframes langFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Tutorial Help Center Button ──── */
.tutorial-help-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    background: rgba(9, 132, 227, 0.15);
    border: 1px solid rgba(9, 132, 227, 0.3);
    border-radius: 12px;
    color: #74b9ff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.tutorial-help-btn:hover {
    background: rgba(9, 132, 227, 0.25);
    border-color: rgba(9, 132, 227, 0.5);
}

.tutorial-help-btn ion-icon {
    font-size: 18px;
}

/* ── Tutorial Mobile Adjustments ──── */
@media screen and (max-width: 768px) {
    .tutorial-target-char {
        font-size: 60px;
        margin-bottom: 12px;
    }
    .tutorial-letters-display {
        font-size: 28px;
    }
    .tutorial-practice-card {
        max-width: 95%;
        padding: 20px 16px;
    }
    .tutorial-static-meteor {
        width: 90px;
        height: 90px;
        font-size: 28px;
    }
}

/* 词库管理器样式 */
.word-library-manager {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(to bottom, #28283c, #141428);
    border-radius: 15px;
    padding: 0;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    z-index: 3000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 100px rgba(51, 204, 51, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(70, 230, 70, 0.3);
}

.word-library-manager.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.library-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: linear-gradient(to right, #145014, #0a280a);
    border-bottom: 1px solid rgba(51, 204, 51, 0.3);
}

.library-manager-header h2 {
    color: #eeffee;
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.library-manager-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.library-manager-close:hover {
    color: white;
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
}

.library-manager-tutorial-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.library-manager-tutorial-btn:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

.library-manager-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 词库列表样式 */
.library-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.library-list::-webkit-scrollbar {
    width: 8px;
}

.library-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.library-list::-webkit-scrollbar-thumb {
    background: rgba(51, 204, 51, 0.4);
    border-radius: 4px;
}

.library-list::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 204, 51, 0.6);
}

.library-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    background: rgba(40, 40, 60, 0.4);
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid rgba(80, 80, 120, 0.3);
    overflow: hidden;
}

.library-item:hover {
    background: rgba(60, 60, 100, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-color: rgba(51, 204, 51, 0.4);
}

.library-item-content {
    flex: 1;
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.library-item-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(51, 204, 51, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.library-item-content:hover::after {
    opacity: 1;
}

.library-item.active {
    background: linear-gradient(to right, rgba(20, 60, 20, 0.7), rgba(30, 90, 30, 0.5));
    border-left: 4px solid #33cc33;
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.3);
}

.library-name {
    flex: 1;
    font-weight: bold;
    color: white;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.library-info {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-left: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
}

.library-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-right: 15px;
}

.library-current-tag {
    background: #33cc33;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.library-delete {
    background: transparent;
    color: rgba(255, 100, 100, 0.8);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.library-delete:hover {
    background: rgba(255, 50, 50, 0.2);
    color: rgba(255, 120, 120, 1);
    border-color: rgba(255, 100, 100, 0.5);
}

/* 上传区域样式 */
.upload-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid rgba(100, 200, 100, 0.2);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.library-name-input {
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid rgba(100, 200, 100, 0.3);
    background: rgba(40, 40, 60, 0.4);
    color: white;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
}

.library-name-input:focus {
    border-color: #33cc33;
    background: rgba(40, 60, 40, 0.5);
    box-shadow: 0 0 10px rgba(51, 204, 51, 0.3);
}

.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-upload-button {
    padding: 10px 18px;
    background: linear-gradient(to bottom, #2196F3, #1976D2);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.file-upload-button:hover {
    background: linear-gradient(to bottom, #1E88E5, #1565C0);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.file-name {
    flex: 1;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* 导入/导出区域 */
.import-export-section {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid rgba(100, 200, 100, 0.2);
}

.export-button,
.import-button {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.export-button {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
}

.export-button:hover {
    background: linear-gradient(135deg, #AB47BC, #8E24AA);
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

.import-button {
    background: linear-gradient(135deg, #3F51B5, #303F9F);
    color: white;
}

.import-button:hover {
    background: linear-gradient(135deg, #5C6BC0, #3949AB);
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

/* 按钮容器 */
.button-container {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.ai-convert-button {
    padding: 12px 22px;
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.25s ease;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.ai-convert-button:hover {
    background: linear-gradient(135deg, #FF8A50, #FFA726);
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

.upload-button {
    padding: 12px 22px;
    background: linear-gradient(135deg, #33cc33, #1a991a);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.25s ease;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.upload-button:hover:not([disabled]) {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

.upload-button[disabled] {
    background: linear-gradient(135deg, #999, #777);
    color: #ddd;
    cursor: not-allowed;
    box-shadow: none;
}

/* 游戏结束界面样式 - 绿色主题 */
.time-game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    /* 游戏结束界面层级 - 高于移动端导航栏(10000) */
}

.time-game-over-content {
    background: linear-gradient(to bottom, #1e321e, #0f230f);
    /* 深绿色渐变背景 */
    border-radius: 20px;
    padding: 40px;
    /* 增加内边距 */
    text-align: center;
    width: 70%;
    /* 使用具体宽度百分比 */
    max-width: 800px;
    /* 设定一个最大像素宽度 */
    min-width: 500px;
    /* 设定一个最小像素宽度，防止过窄 */
    max-height: 85vh;
    /* 略微增加最大高度 */
    backdrop-filter: blur(5px);
    /* 轻微模糊效果 */
    box-shadow: 0 0 20px rgba(51, 204, 51, 0.7);
    /* 绿色阴影 */
    border: 1px solid rgba(51, 204, 51, 0.3);
    /* 绿色边框 */
    margin: 0 auto;
    /* 居中显示 */
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    /* 防止外层容器滚动 */
}

/* 大屏幕设备进一步优化 */
@media screen and (min-width: 1200px) {
    .time-game-over-content {
        width: 60%;
        max-width: 900px;
    }
}

.time-game-over h1 {
    color: #eeffee;
    /* 词库管理器标题颜色 */
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(51, 204, 51, 0.4);
    /* 绿色文字阴影 */
}

.time-final-score-container {
    font-size: 24px;
    margin: 20px 0;
    color: white;
}

.time-final-score-value {
    color: #FFD700;
    font-weight: bold;
    font-size: 48px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    margin-left: 10px;
}

.time-wrong-words {
    padding: 20px 0 0 0;
    /* 移除顶部padding，因为标题现在在外面 */
    margin: 0;
    /* 减少margin，因为标题现在单独管理间距 */
    max-height: 200px;
    overflow-y: auto !important;
    flex-shrink: 1 !important;
    /* 允许错词容器被压缩 */
}

/* 独立的错词标题样式 - 不再是 .time-wrong-words 的子元素 */
.time-game-over-content>h3 {
    color: #FFD700;
    margin-bottom: 15px;
    margin-top: 20px;
    /* 与上方元素的间距 */
    font-size: 20px;
    text-align: left;
    /* 标题左对齐 */
    padding: 0 20px;
    /* 添加左右padding与内容对齐 */
    flex-shrink: 0 !important;
    /* 防止标题被压缩 */
}

.time-wrong-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-wrong-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.time-wrong-item:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 215, 0, 0.3);
}

.time-wrong-item.marked-wrong {
    background: rgba(255, 100, 100, 0.2);
    border-color: rgba(255, 100, 100, 0.5);
}

/* 游戏结束界面的按钮容器 */
.game-over-buttons-container {
    display: flex;
    justify-content: center;
    /* 居中按钮 */
    align-items: center;
    /* 垂直对齐，如果按钮高度不一 */
    flex-wrap: wrap;
    /* 允许按钮在空间不足时换行 */
    gap: 15px;
    /* 按钮之间的间距，略微减小以适应三个按钮 */
    margin-top: 30px;
    /* 与上方元素的间距 */
}

.time-restart-btn {
    background: linear-gradient(135deg, #33cc33, #1a991a);
    /* 词库管理器按钮绿色渐变 */
    border: none;
    color: white;
    padding: 15px 45px;
    /* 增加按钮的padding使其更大一些 */
    border-radius: 30px;
    font-size: 20px;
    /* 增大字体 */
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    /* 给按钮一个最小宽度 */
    box-shadow: 0 0 15px rgba(51, 204, 51, 0.7);
    /* 悬停时更亮的绿色阴影 */
    font-weight: bold;
}

.time-restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(51, 204, 51, 0.7);
    /* 悬停时更亮的绿色阴影 */
}

/* 排行榜按钮样式 - 与重启按钮类似 */
.time-leaderboard-btn {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    /* 橙色渐变 */
    border: none;
    color: white;
    padding: 15px 45px;
    border-radius: 30px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.5);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.time-leaderboard-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.7);
}

.time-submit-score-btn {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    padding: 15px 45px;
    border: none;
    border-radius: 30px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    font-weight: bold;
}

.time-submit-score-btn:hover:not([disabled]) {
    background: linear-gradient(135deg, #FFB74D, #FB8C00);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.time-submit-score-btn[disabled] {
    background: linear-gradient(135deg, #999, #777);
    color: #ddd;
    cursor: not-allowed;
    opacity: 0.5;
}

/* 新增：游戏结束界面提示文本样式 - 固定在底部 */
.time-game-over-hint {
    font-size: 0.85em;
    color: #c0c0c0;
    /* 浅灰色，不那么突出 */
    text-align: center;
    margin: 15px 10px 20px 10px;
    /* 与错词容器和按钮的间距 */
    padding: 10px;
    /* 增加内边距使其更容易看到 */
    font-style: italic;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* 添加顶部分隔线 */
    background: rgba(0, 0, 0, 0.2);
    /* 轻微背景，使其更明显 */
    border-radius: 8px;
    position: relative;
    /* 确保不会被其他元素覆盖 */
    flex-shrink: 0;
    /* 防止提示文本被压缩 */
}

/* Library View Button */
.library-view {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
    transition: background-color 0.2s;
}

.library-view:hover {
    background-color: #1976D2;
}

/* Word List Modal */
.word-list-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.word-list-modal.show {
    opacity: 1;
    visibility: visible;
}

.word-list-content {
    background-color: #1a1a2e;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.word-list-modal.show .word-list-content {
    transform: scale(1);
}

.word-list-header {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #16213e;
    border-radius: 10px 10px 0 0;
}

.word-list-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
}

.word-list-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.word-list-close:hover {
    color: #fff;
}

.word-list-items {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}


.word-list-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #333;
    color: #e0e0e0;
}


.word-list-item:last-child {
    border-bottom: none;
}

.word-list-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.word-char {
    font-size: 20px;
    font-weight: bold;
    color: #4CAF50;
    margin-right: 15px;
    min-width: 40px;
}

.word-pinyin {
    color: #aaa;
    font-size: 14px;
    flex: 1;
}

.word-display {
    color: #fff;
    font-size: 16px;
    flex: 1;
}

.word-list-footer {
    padding: 10px 20px;
    border-top: 1px solid #333;
    text-align: right;
    color: #888;
    font-size: 12px;
    background-color: #16213e;
    border-radius: 0 0 10px 10px;
}

/* Edit Mode Styles */
.word-list-edit-btn {
    background: none;
    border: 1px solid #4CAF50;
    color: #4CAF50;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 15px;
    transition: all 0.2s;
}

.word-list-edit-btn:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

.word-list-edit-btn.active {
    background-color: #4CAF50;
    color: white;
}

.word-add-form {
    display: flex;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid #333;
    gap: 10px;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
}

.word-add-input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px;
    border-radius: 4px;
    flex: 1;
    min-width: 80px;
    /* Ensure inputs don't get too small */
}

.word-add-input:focus {
    border-color: #4CAF50;
    outline: none;
}

.word-add-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
}

.word-add-btn:hover {
    background-color: #45a049;
}

/* Flat Button Styles */
.word-search-btn,
.word-delete-btn {
    background: none;
    border: 1px solid transparent;
    /* Transparent border for layout stability */
    cursor: pointer;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 4px;
    margin-left: 10px;
    transition: all 0.2s;
    text-decoration: none;
}

.word-search-btn {
    color: #aaa;
    border-color: rgba(255, 255, 255, 0.2);
}

.word-search-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.word-delete-btn {
    color: #ff6666;
    border-color: rgba(255, 100, 100, 0.5);
}

.word-delete-btn:hover {
    background-color: rgba(255, 100, 100, 0.1);
    color: #ff4444;
    border-color: #ff4444;
}

/* Add Library Button */
.add-library-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
    width: 100%;
    transition: background-color 0.2s;
}

.add-library-btn:hover {
    background-color: #45a049;
}

/* Mobile Optimization */
@media (max-width: 600px) {
    .word-add-form {
        flex-direction: column;
    }

    .word-add-input {
        width: 100%;
        margin-bottom: 5px;
    }

    .word-add-btn {
        width: 100%;
    }

    .word-list-item {
        flex-wrap: wrap;
    }

    .word-search-btn,
    .word-delete-btn {
        margin-top: 5px;
        margin-left: auto;
        /* Push to right on wrap */
    }
}