/* vocab.css */
body {
    overflow: hidden;
}

#portal-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#app {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header Tweaks */
.vocab-header {
    background: rgba(5, 5, 10, 0.85);
    border-bottom: 1px solid var(--vocab-color, #00f0ff);
    margin-bottom: 20px;
}

.vocab-header h1 .badge {
    background: var(--vocab-color, #00f0ff);
    color: #000;
}

.vocab-selector-container {
    display: flex;
    align-items: center;
    margin: 0 20px;
}

.cyber-select {
    background: rgba(10, 15, 20, 0.8);
    color: var(--vocab-color, #00f0ff);
    border: 1px solid var(--vocab-color, #00f0ff);
    padding: 8px 15px;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
    transition: all 0.3s ease;
}

.cyber-select:hover, .cyber-select:focus {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
    background: rgba(0, 240, 255, 0.1);
}

.cyber-select option {
    background: #0a0f14;
    color: #fff;
    font-weight: normal;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 15px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
}

/* Main UI */
.vocab-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.word-card {
    position: relative; /* 作为收藏按钮的绝对定位容器参考点 */
    width: 100%;
    max-width: 600px;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 240, 255, 0.05);
    border: 2px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.1);
    margin-bottom: 50px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.word-display {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 15px var(--vocab-color, #00f0ff);
    letter-spacing: 5px;
}

.word-pronunciation {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.5rem;
    color: #888;
    margin-top: 10px;
}

/* Options */
.options-container {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 800px;
    justify-content: center;
}

.option-btn {
    flex: 1;
    min-height: 120px;
    height: auto;
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.option-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.3);
    margin-right: 20px;
    flex-shrink: 0;
}

.option-text {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: #ddd;
    line-height: 1.4;
    word-break: break-all;
    text-align: left;
    flex-grow: 1;
}

/* Interactions */
.option-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--vocab-color, #00f0ff);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 240, 255, 0.2);
}

.option-btn:hover .option-text {
    color: #fff;
}

.option-btn:hover .option-label {
    color: var(--vocab-color, #00f0ff);
}

/* Animations */
.correct {
    background: rgba(0, 255, 0, 0.2) !important;
    border-color: #00ff00 !important;
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.5) !important;
    animation: flash-green 0.3s;
}

.incorrect {
    background: rgba(255, 0, 60, 0.2) !important;
    border-color: #ff003c !important;
    box-shadow: 0 0 40px rgba(255, 0, 60, 0.5) !important;
    animation: glitch-shake 0.3s;
}

@keyframes flash-green {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glitch-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

@media (max-width: 768px) {
    body, html {
        overflow-y: auto;
        overflow-x: hidden;
    }
    .word-display {
        font-size: 2.5rem;
    }
    .options-container {
        flex-direction: column;
    }
    .option-btn {
        min-height: 100px;
        height: auto;
    }
}

/* ==========================================
   沉浸式全屏样式 (Fullscreen Immersive Mode)
   ========================================== */
body.fullscreen-active .vocab-header {
    margin-bottom: 0;
    border: none !important;
    background: transparent !important;
    backdrop-filter: none !important; /* 解除包含块陷阱 */
    overflow: visible !important; /* 防止裁剪内部悬浮元素 */
    box-shadow: none !important;
    transition: all 0.4s ease;
}

/* 在全屏模式下彻底隐藏背后的操作按钮区域 */
body.fullscreen-active .header-top {
    display: none !important;
}

/* 将数据面板 (stats-bar) 悬浮显示。
   使用 top: 80px 确保它完全避开 Mac 系统菜单栏（下拉时约30px）以及浏览器的全屏提示框（约50px）。
   完全脱离“半隐”区域，保持完美居中。 */
body.fullscreen-active .stats-bar {
    position: fixed !important;
    top: 80px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    padding: 15px 40px !important;
    white-space: nowrap !important; /* 防止文字换行 */
    background: rgba(10, 15, 30, 0.95) !important;
    backdrop-filter: blur(12px);
    border: 2px solid rgba(0, 240, 255, 0.5) !important;
    border-radius: 40px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.2), inset 0 0 15px rgba(0, 240, 255, 0.1);
    margin: 0 !important;
}

/* 在全屏模式下隐藏不需要贴顶的账户信息和占位符，保留 stats-bar */
body.fullscreen-active .header-bottom > div:not(.stats-bar) {
    display: none !important;
}

body.fullscreen-active .header-bottom {
    position: static !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
}

body.fullscreen-active .vocab-main {
    padding: 0;
}

body.fullscreen-active .word-card {
    height: 40vh;
    max-width: 900px;
    margin-bottom: 80px;
    border-width: 3px;
}

body.fullscreen-active .word-display {
    font-size: 7rem;
    letter-spacing: 8px;
}

body.fullscreen-active .word-pronunciation {
    font-size: 2rem;
}

body.fullscreen-active .options-container {
    max-width: 1000px;
}

body.fullscreen-active .option-btn {
    min-height: 180px;
}

body.fullscreen-active .option-label {
    font-size: 3rem;
}

body.fullscreen-active .option-text {
    font-size: 2.2rem;
}

/* ==========================================
   Mission Control & Gamification Animations
   ========================================== */

@keyframes pulse-border {
    0% { box-shadow: 0 0 5px rgba(255, 0, 255, 0.5); }
    50% { box-shadow: 0 0 15px rgba(255, 0, 255, 1); }
    100% { box-shadow: 0 0 5px rgba(255, 0, 255, 0.5); }
}

@keyframes level-up-flash {
    0% { background: transparent; }
    50% { background: rgba(255, 0, 255, 0.4); box-shadow: inset 0 0 50px #ff00ff; }
    100% { background: transparent; }
}

.level-up-active {
    animation: level-up-flash 1s ease-out;
}

@keyframes xp-gain {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-30px) scale(1.5); opacity: 0; }
}

.xp-floater {
    position: absolute;
    color: #ff00ff;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    font-size: 1.5rem;
    text-shadow: 0 0 10px #ff00ff;
    pointer-events: none;
    z-index: 1000;
    animation: xp-gain 1s forwards ease-out;
}

.mission-item {
    transition: transform 0.2s, box-shadow 0.2s;
}

.mission-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.mission-item.completed {
    border-left-color: #00ff00 !important;
}

.mission-item.completed .cyber-btn {
    background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
    color: #000;
    border-color: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

/* Critical XP Floater */
.xp-floater.critical {
    font-size: 3rem;
    color: #ff3333;
    text-shadow: 0 0 20px #ff3333, 0 0 40px #ff0000;
    z-index: 1001;
    animation: xp-gain-critical 1.2s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes xp-gain-critical {
    0% { transform: translateY(0) scale(0.5); opacity: 1; }
    30% { transform: translateY(-40px) scale(1.2); opacity: 1; }
    100% { transform: translateY(-80px) scale(1.5); opacity: 0; }
}

/* Screen Shake */
@keyframes shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-3px, -3px) rotate(-1deg); }
    20%, 40%, 60%, 80% { transform: translate(3px, 3px) rotate(1deg); }
}

.shake-active {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* Neon Ripple Effect on buttons */
.cyber-btn {
    position: relative;
    overflow: hidden;
}

.neon-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
    box-shadow: 0 0 15px rgba(255,255,255,0.8);
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Campaign Badge - subtle circular progress at bottom-left */
.campaign-badge {
    position: fixed;
    bottom: 18px;
    left: 18px;
    width: 44px;
    height: 44px;
    z-index: 1000;
    cursor: default;
    transition: opacity 0.4s ease;
    opacity: 0.5;
    filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.25));
}

.campaign-badge:hover {
    opacity: 0.85;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.4));
}

.campaign-badge-content {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #00f0ff;
    font-family: 'Orbitron', sans-serif;
    pointer-events: none;
}

.campaign-badge-details {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: max-content;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-family: 'Orbitron', monospace;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform: translateY(6px);
    border: 1px solid rgba(0, 240, 255, 0.2);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
}

.campaign-badge:hover .campaign-badge-details {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   单词银行 (Word Bank) 金霓虹尊贵视觉系统
   ========================================== */

/* 1. 悬浮星标收藏按钮 */
.collect-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 2.2rem;
    cursor: pointer;
    color: rgba(0, 240, 255, 0.55); /* 更改为高对比度赛博青色半透明，确保极致可见 */
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
    z-index: 50;
    outline: none;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.collect-btn:hover {
    color: rgba(255, 215, 0, 0.6);
    transform: scale(1.18);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.collect-btn.active {
    color: #ffd700;
    text-shadow: 0 0 15px #ffd700, 0 0 30px rgba(255, 215, 0, 0.6);
    transform: scale(1.22) rotate(360deg);
}

/* 收藏瞬间弹性微缩放动效 */
@keyframes collect-pop {
    0% { transform: scale(1); }
    45% { transform: scale(1.5) rotate(15deg); }
    70% { transform: scale(1.15) rotate(-10deg); }
    100% { transform: scale(1.22) rotate(0deg); }
}

.collect-btn.pop-effect {
    animation: collect-pop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ==========================================
   战役模式"上一题"回看按钮（青色霓虹风）
   ========================================== */
.last-word-btn {
    position: absolute;
    bottom: 14px;
    left: 14px;                     /* 单词卡左下角（与右上角 ⭐ 对角） */
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: #00f0ff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.3);
    text-shadow: 0 0 4px rgba(0, 240, 255, 0.6);
    font-size: 1.05rem;
    z-index: 50;
    transition: all 0.2s ease;
    outline: none;
}
.last-word-btn:hover:not(:disabled) {
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.7);
    transform: scale(1.08);
}
.last-word-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    box-shadow: none;
}
.last-word-btn.active {
    background: rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.9);
    border-color: rgba(0, 240, 255, 0.8);
}
.last-word-btn.active i {
    transform: scaleX(-1);   /* 翻转让图标"返回"方向更明显 */
    transition: transform 0.2s ease;
}

/* 回看模式下 AB 选项视觉变灰（不可点） */
.option-btn.reviewing {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.55);
}

/* 2. 单词银行黄金主题弹窗 */
.word-bank-theme {
    border-color: #ffd700 !important;
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.25) !important;
}

.gold-badge {
    background: #ffd700 !important;
    color: #000 !important;
    box-shadow: 0 0 12px #ffd700 !important;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
}

/* 3. 赛博精美数据表单 (Golden Translucent Table) */
.gold-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Noto Sans SC', sans-serif;
}

.gold-table th {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    font-family: 'Orbitron', 'Noto Sans SC', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.gold-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.gold-table tr.word-row:hover {
    background: rgba(255, 215, 0, 0.06);
}

.gold-table tr.word-row:hover td {
    color: #fff;
}

/* 4. 折叠式中英双语例句卡片 (Bilingual Sentence Card) */
.sentence-card {
    background: rgba(255, 215, 0, 0.02);
    border: 1px dashed rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 15px 20px;
    margin: 8px 10px 15px 10px;
    box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.02);
    transition: all 0.35s ease;
}

.sent-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sent-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sent-en-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.sent-en {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.05rem;
    color: #f0f5ff;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
}

.sent-cn {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    text-align: left;
}

.sent-highlight {
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.45);
}

/* 例句播放按钮 */
.play-sent-btn {
    background: transparent;
    border: none;
    color: rgba(0, 240, 255, 0.7);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.25s;
    padding: 2px 5px;
}

.play-sent-btn:hover {
    color: #00f0ff;
    transform: scale(1.2);
    text-shadow: 0 0 8px #00f0ff;
}

/* 例句拉取Loading动画 */
.sent-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,215,0,0.2);
    border-radius: 50%;
    border-top-color: #ffd700;
    animation: gold-spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes gold-spin {
    to { transform: rotate(360deg); }
}

/* 5. 黄金警告及一年锁闭弹窗样式 (1-Year Lock Info Modal) */
.lock-modal-content {
    text-align: center;
    padding: 20px;
}

.lock-icon-container {
    font-size: 4rem;
    color: #ffd700;
    text-shadow: 0 0 25px #ffd700;
    margin-bottom: 15px;
    animation: lock-pulse 2s infinite ease-in-out;
}

@keyframes lock-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; text-shadow: 0 0 35px #ffd700, 0 0 50px rgba(255,215,0,0.5); }
}

.lock-title {
    font-family: 'Orbitron', 'Noto Sans SC', sans-serif;
    font-size: 1.6rem;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    margin-bottom: 15px;
}

.lock-detail-box {
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
}

.lock-countdown {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: #ff3c00;
    text-shadow: 0 0 15px #ff3c00;
    font-weight: bold;
    margin-top: 8px;
}

/* 单词银行专属优化：限制宽度并提供滚动保障 */
#word-bank-modal.cyber-auth {
    width: 800px;
    max-width: 95vw;
}

.word-bank-content {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 修复：安全关闭保险库按钮文字错位 */
#close-word-bank-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    line-height: 1.2;
    padding: 10px 24px;
    min-height: 40px;
    font-size: 0.9rem;
}

.gold-table {
    width: 100%;
    table-layout: fixed;
}

.gold-table th, .gold-table td {
    word-break: break-all;
    white-space: normal;
}

/* 桌面端列宽分配 */
@media (min-width: 769px) {
    .gold-table th:nth-child(1), .gold-table td:nth-child(1) { width: 22%; }
    .gold-table th:nth-child(2), .gold-table td:nth-child(2) { width: 18%; }
    .gold-table th:nth-child(3), .gold-table td:nth-child(3) { width: 32%; }
    .gold-table th:nth-child(4), .gold-table td:nth-child(4) { width: 14%; }
    .gold-table th:nth-child(5), .gold-table td:nth-child(5) { width: 14%; }
}

/* 移动端/窄屏自适应：表格转换为精美卡片流 */
@media (max-width: 768px) {
    #word-bank-modal.cyber-auth {
        width: 95vw;
        max-height: 90vh;
    }
    
    .gold-table, 
    .gold-table thead, 
    .gold-table tbody, 
    .gold-table tr.word-row, 
    .gold-table td {
        display: block;
        width: 100%;
    }
    
    .gold-table thead {
        display: none; /* 隐藏表头 */
    }
    
    .gold-table tr.word-row {
        background: rgba(255, 215, 0, 0.02);
        border: 1px solid rgba(255, 215, 0, 0.15);
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 12px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    }
    
    .gold-table td {
        border: none;
        padding: 4px 0 !important;
        text-align: left !important;
        max-width: none !important;
        white-space: normal !important;
    }
    
    /* 卡片结构布局 */
    .gold-table td:nth-child(1) {
        font-size: 1.25rem;
        display: inline-block;
        width: auto;
        margin-right: 10px;
    }
    
    .gold-table td:nth-child(2) {
        font-size: 0.95rem;
        display: inline-block;
        width: auto;
    }
    
    .gold-table td:nth-child(3) {
        font-size: 0.95rem;
        color: #ddd;
        margin-top: 4px;
        margin-bottom: 4px;
    }
    
    .gold-table td:nth-child(4) {
        font-size: 0.8rem;
        color: #666;
        margin-bottom: 8px;
    }
    
    .gold-table td:nth-child(4)::before {
        content: "存入时间: ";
    }
    
    .gold-table td:nth-child(5) {
        padding-top: 8px !important;
        border-top: 1px dashed rgba(255, 255, 255, 0.08);
    }
    
    .gold-table td:nth-child(5) div {
        justify-content: flex-start !important;
    }
    
    /* 展开的例句行响应式处理 */
    .gold-table tr.sentence-row {
        display: block;
        width: 100%;
        margin-top: -8px;
        margin-bottom: 15px;
    }
    
    .gold-table tr.sentence-row td {
        display: block;
        width: 100% !important;
        padding: 0 !important;
    }
}


