/* FloatVocab 浮词 - 单词动画 H5 样式（TikTok 风格 3-tab App） */

/* 加载项目内楷体字体（与原视频保持一致） */
@font-face {
    font-family: 'STKAITI';
    src: url('../font/STKAITI.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: #000;
    color: #fff;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button {
    padding: 10px 16px;
    background: #4a4a8a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.15s;
    font-family: inherit;
}
button:hover { background: #5a5a9a; }
button:active { background: #3a3a7a; }

/* ==================== App 容器（桌面 480px 居中，移动全屏）==================== */
#app {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #000;
    overflow: hidden;
}

/* ==================== Tab 面板 ==================== */
.tab-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.tab-panel.active {
    display: flex;
    flex-direction: column;
}

/* ==================== Tab 1: Feed（首页动画流）==================== */
#tab-feed {
    background: #000;
}

#feed-container {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #000;
    overflow: hidden;
    touch-action: none;              /* 阻止默认滚动，由 JS 处理滑动 */
    overscroll-behavior: contain;    /* 防止滚动链 */
    display: flex;
    align-items: center;
    justify-content: center;
}

#canvas {
    /* 3:4 竖屏画布，contain 适配，不裁剪 */
    width: min(100%, calc(100dvh * 0.75));
    aspect-ratio: 1080 / 1440;
    height: auto;
    max-height: 100dvh;
    display: block;
    pointer-events: none;            /* 容器接管触摸 */
}

/* 过渡快照层（滑动时用 canvas.toDataURL 淡出过渡）*/
#feed-snapshot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
    z-index: 2;
}
#feed-snapshot.show {
    opacity: 1;
}

/* 加载提示 */
.feed-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 14px;
    z-index: 3;
    display: none;
    background: rgba(0,0,0,0.6);
    padding: 8px 16px;
    border-radius: 6px;
}
.feed-loading.show { display: block; }

/* overlay 容器：不拦截触摸，按钮单独放行 */
.feed-overlay {
    position: absolute;
    z-index: 5;
    pointer-events: none;
}

/* 右侧操作按钮列 */
.feed-overlay-actions {
    right: 12px;
    bottom: 72px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.feed-overlay-actions .feed-btn {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.feed-overlay-actions .feed-btn:active { background: rgba(0,0,0,0.7); }
.feed-overlay-actions .feed-btn.active { color: #ff6b6b; }

/* 顶部信息栏 */
.feed-overlay-top {
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.feed-group-name {
    font-weight: 600;
    background: rgba(0,0,0,0.4);
    padding: 4px 10px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.feed-position {
    color: #ffc0cb;
    font-family: monospace;
    background: rgba(0,0,0,0.4);
    padding: 4px 10px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* 底部当前词 + 滑动提示 */
.feed-overlay-bottom {
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.feed-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
#current-word {
    font-family: 'STKAITI', serif;
    font-size: 15px;
    color: #fff;
    flex: 1;
    min-width: 0;
    word-break: break-word;
    line-height: 1.4;
}
#current-word .ipa {
    color: yellow;
    margin: 0 6px;
    font-family: Arial, sans-serif;
}
#current-word .audio-type-label {
    font-size: 11px;
    color: #aaa;
    margin: 0 2px 0 1px;
    vertical-align: middle;
}
#current-word .feed-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 4px;
    padding: 0;
    border: 1px solid rgba(255, 192, 203, 0.5);
    border-radius: 50%;
    background: rgba(255, 192, 203, 0.18);
    color: #ffc0cb;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
    transition: background 0.2s, transform 0.1s;
}
#current-word .feed-play-btn:hover {
    background: rgba(255, 192, 203, 0.35);
}
#current-word .feed-play-btn:active {
    transform: scale(0.9);
}
/* 底部按钮栏（释义/音型切换） */
.feed-bottom-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.feed-bottom-btn {
    pointer-events: auto;
    padding: 4px 12px;
    border-radius: 14px;
    background: rgba(0,0,0,0.5);
    border: 1.5px solid rgba(255,255,255,0.3);
    color: #ccc;
    font-size: 13px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    transition: transform 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1.2;
}
.feed-bottom-btn:active {
    transform: scale(0.9);
}
#btn-chinese {
    color: #7aa2f4;
    border-color: rgba(122,162,244,0.5);
}
#btn-chinese.active {
    background: rgba(122,162,244,0.3);
    border-color: #7aa2f4;
    color: #fff;
}
.feed-btn-audio-type {
    color: #ffc0cb;
    border-color: rgba(255,192,203,0.4);
}
/* ==================== 左侧认识/不认识按钮 ==================== */
.feed-overlay-left {
    left: 12px;
    bottom: 110px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.feed-overlay-left .feed-btn {
    pointer-events: auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 2px solid;
    color: #fff;
    font-size: 22px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}
.feed-overlay-left .feed-btn:active {
    transform: scale(0.88);
}
#btn-known {
    color: #4ade80;
    border-color: rgba(74,222,128,0.6);
}
#btn-known:active {
    background: rgba(74,222,128,0.25);
}
#btn-unknown {
    color: #f87171;
    border-color: rgba(248,113,113,0.6);
}
#btn-unknown:active {
    background: rgba(248,113,113,0.25);
}
/* 播放按钮（左侧底部，旧样式保留以防其他引用；实际已改用 .feed-center-play） */
.feed-btn-play {
    margin-top: 4px;
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}
/* 居中播放/暂停按钮：纯视觉指示器，点击由 #feed-container 统一处理 */
.feed-center-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    width: 120px;
    height: 120px;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 80px;
    line-height: 1;
    opacity: 0;                       /* 播放中：隐藏 */
    pointer-events: none;             /* 纯视觉，点击穿透到容器 */
    transition: opacity 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.feed-center-play.paused {            /* 暂停时：显示半透明三角 */
    opacity: 0.6;
}
.feed-center-play:active {
    opacity: 0.85;
}
/* 分享按钮（右下，右侧按钮列末尾） */
.feed-btn-share {
    color: #fff;
    border: none;
}
/* 顶部登录状态徽章 */
.feed-user-status {
    background: rgba(0,0,0,0.5);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto;
    max-width: 40%;
    overflow: hidden;
}
.feed-user-status.logged-in {
    background: rgba(74,222,128,0.25);
    color: #4ade80;
}
.feed-user-status .login-link {
    color: #60a5fa;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}
.feed-user-status > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== 今日进度卡片（探索页顶部：时间/单词/短语）==================== */
.study-time-cards {
    display: flex;
    gap: 8px;
    padding: 12px 12px;
    background: #1a1a1a;
}
.study-time-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    border-radius: 12px;
    padding: 10px 10px;
    border: 1px solid rgba(255,255,255,0.08);
    min-width: 0;
}
.study-time-icon {
    font-size: 22px;
    flex-shrink: 0;
}
.study-time-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.study-time-num {
    font-size: 16px;
    font-weight: 700;
    color: #60a5fa;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.study-time-label {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 含进度条的卡片 */
.study-time-goal-card {
    position: relative;
}
/* 独立编辑目标按钮（卡片下方居中胶囊形） */
.study-time-edit {
    display: block;
    margin: 0 auto 12px;
    padding: 6px 18px;
    border-radius: 16px;
    background: rgba(96,165,250,0.12);
    border: 1px solid rgba(96,165,250,0.3);
    color: #60a5fa;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}
.study-time-edit:active {
    background: rgba(96,165,250,0.25);
}
.study-goal-progress {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
    width: 100%;
}
.study-goal-bar {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #4ade80);
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
}

/* ==================== 单词列表展开/收起 ==================== */
.word-list-toggle-bar {
    padding: 0 16px;
    background: #1a1a1a;
}
.word-list-toggle-btn {
    width: 100%;
    padding: 10px;
    background: #252535;
    border: 1px solid #333;
    border-radius: 8px;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.word-list-toggle-btn:active {
    background: #2f2f4a;
    color: #fff;
}
.word-list-toggle-btn.expanded::before {
    content: '🔼 ';
}
.word-list-toggle-btn:not(.expanded)::before {
    content: '📋 ';
}

/* ==================== 页面头部（Tab 2/3 共用）==================== */
.page-header {
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
    background: #1a1a1a;
    border-bottom: 1px solid #222;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.page-header h2 {
    color: pink;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 0 4px red;
    margin: 0;
}
.page-header-action {
    background: none;
    border: none;
    color: #ccc;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s, transform 0.15s;
    line-height: 1;
}
.page-header-action:active {
    background: #333;
    transform: scale(0.92);
}

/* ==================== Tab 2: 发现 ==================== */
#tab-discover, #tab-mine {
    background: #1a1a1a;
    padding: 0 16px 80px;  /* 底部留出 nav 空间 */
}

/* 搜索 + 词表 */
.word-list-header {
    padding: 12px 0;
}
.word-list-header #search {
    width: 100%;
    padding: 8px 12px;
    background: #333;
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
}
.word-list-header #search:focus {
    outline: none;
    border-color: #666;
}

.word-list {
    list-style: none;
}
.word-list li {
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: baseline;
    border-bottom: 1px solid #222;
}
.word-list li:hover {
    background: #2a2a2a;
}
.word-list li.active {
    background: #4a4a8a;
}
.word-list li .num {
    color: #888;
    font-size: 13px;
    margin-right: 8px;
    font-family: monospace;
    min-width: 28px;
    text-align: right;
    flex-shrink: 0;
}
.word-list li .en {
    color: white;
    font-size: 15px;
    font-weight: 500;
}
.word-list li .cn {
    color: #aaa;
    font-size: 12px;
    margin-left: 8px;
    flex: 1;
}
.word-list .empty {
    color: #666;
    text-align: center;
    padding: 20px;
    border-bottom: none;
}

/* ============ 单词列表分页 ============ */
.word-list-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0;
    margin-bottom: 8px;
}
.word-list-pager .pager-btn {
    padding: 6px 14px;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #ccc;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.word-list-pager .pager-btn:hover:not(:disabled) {
    background: #3a3a3a;
    color: #fff;
}
.word-list-pager .pager-btn:active:not(:disabled) {
    background: #4a4a4a;
}
.word-list-pager .pager-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.word-list-pager .pager-info {
    color: #888;
    font-size: 13px;
    font-family: monospace;
    min-width: 60px;
    text-align: center;
}

/* 游戏入口卡片 */
.discover-games, .discover-leaderboard {
    margin-top: 0;
}
.discover-games h3, .discover-leaderboard h3, .mine-section h3 {
    color: #ffc0cb;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}
.game-entry-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #2a2a2a;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    transition: background 0.15s;
    border-left: 3px solid #6a8;
}
.game-entry-card:active { background: #333; }
.game-entry-card .game-icon { font-size: 28px; }
.game-entry-card .game-name { font-size: 15px; font-weight: 600; }
.game-entry-card .game-desc { font-size: 12px; color: #888; margin-top: 2px; }

/* 词库分组卡片 */
.word-library-groups {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.word-lib-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #2a2a2a;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    border-left: 3px solid #7aa2f4;
}
.word-lib-card:active { background: #333; transform: scale(0.97); }
.word-lib-card-icon { font-size: 24px; flex-shrink: 0; }
.word-lib-card-info { flex: 1; min-width: 0; }
.word-lib-card-name { font-size: 14px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.word-lib-card-count { font-size: 11px; color: #888; margin-top: 2px; }
.word-lib-card-arrow { color: #555; font-size: 18px; flex-shrink: 0; }
.word-lib-card-all { border-left-color: #ffc0cb; }

/* 排行榜 */
/* 一级分类切换（学习时间 / 游戏成绩） */
.lb-category {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    background: #1a1a1a;
    border-radius: 10px;
    padding: 3px;
    border: 1px solid #2a2a2a;
}
.lb-cat {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #888;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.lb-cat.active {
    background: #4a4a8a;
    color: #fff;
}
.leaderboard-tabs, .score-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
.lb-tab, .score-tab {
    padding: 6px 12px;
    background: #2a2a2a;
    border: 1px solid #333;
    color: #888;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s;
}
.lb-tab.active, .score-tab.active {
    background: #4a4a8a;
    color: #fff;
    border-color: #5a5a9a;
}
.leaderboard-list, .score-list {
    list-style: none;
}
.leaderboard-list li {
    display: flex;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 1px solid #222;
    font-size: 13px;
}
.leaderboard-list .lb-rank {
    width: 32px;
    color: #888;
    font-family: monospace;
    font-weight: 600;
}
.leaderboard-list .lb-rank.top1 { color: gold; }
.leaderboard-list .lb-rank.top2 { color: #c0c0c0; }
.leaderboard-list .lb-rank.top3 { color: #cd7f32; }
.leaderboard-list .lb-name { flex: 1; color: #6af; }
.leaderboard-list .lb-score { color: #ffc0cb; font-family: monospace; }
.lb-load-more {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: #2a2a2a;
    border: 1px solid #333;
    color: #7aa2f4;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}
.lb-load-more:active { background: #333; }

/* ==================== Tab 3: 我的 ==================== */
.user-area-mine {
    padding: 16px 0;
    border-bottom: 1px solid #222;
    margin-bottom: 16px;
    min-height: 20px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-info .username {
    color: #6af;
    font-weight: 500;
    flex: 1;
    font-size: 16px;
}
.user-info .btn-logout {
    padding: 4px 12px;
    background: #4a3a3a;
    color: #f88;
    border: 1px solid #6a4a4a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.user-info .btn-logout:hover { background: #5a4a4a; }

.btn-login {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #4a7a4a 0%, #3a6a3a 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.btn-login:hover {
    background: linear-gradient(135deg, #5a8a5a 0%, #4a7a4a 100%);
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.stat-card {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 12px 4px;
    text-align: center;
}
.stat-card .stat-num {
    font-size: 20px;
    color: #ffc0cb;
    font-weight: 600;
    font-family: monospace;
}
.stat-card .stat-label {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.mine-section {
    margin-bottom: 24px;
}

/* ==================== 设置列表（iOS 风格） ==================== */
.settings-list {
    background: #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #333;
}
.settings-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px 14px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #222;
    color: #ddd;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    gap: 12px;
}
.settings-item:last-child {
    border-bottom: none;
}
.settings-item:active {
    background: #333;
}
.settings-item-info {
    cursor: default;
}
.settings-item-info:active {
    background: transparent;
}
.settings-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
.settings-label {
    flex: 1;
    color: #ddd;
}
.settings-desc {
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
    margin-right: 4px;
}
.settings-arrow {
    color: #555;
    font-size: 18px;
    flex-shrink: 0;
}
.settings-item-danger .settings-label {
    color: #f87171;
}
.settings-item-danger .settings-icon {
    color: #f87171;
}
.settings-version {
    color: #666;
    font-size: 13px;
    font-family: monospace;
    flex-shrink: 0;
}

/* 成绩记录列表 */
.score-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    border-bottom: 1px solid #222;
    font-size: 13px;
    color: #aaa;
}
.score-list .sc-score {
    color: #ffc0cb;
    font-family: monospace;
}

/* ==================== 底部导航 ==================== */
#bottom-nav {
    flex-shrink: 0;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #1a1a1a;
    border-top: 1px solid #222;
    display: flex;
    z-index: 100;
}
.nav-item {
    flex: 1;
    background: none;
    border: none;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    position: relative;
    transition: color 0.15s;
}
.nav-item.active { color: #ffc0cb; }
.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: #ffc0cb;
    border-radius: 0 0 3px 3px;
}
.nav-icon {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.2s;
}
.nav-item.active .nav-icon {
    transform: scale(1.15);
}
.nav-label {
    font-size: 11px;
    transition: font-weight 0.15s;
}
.nav-item.active .nav-label {
    font-weight: 600;
}
.nav-item:active { background: none; }

/* ==================== 收藏按钮（词表内）==================== */
.btn-favorite {
    background: none;
    border: none;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    margin-left: auto;
    padding: 0 4px;
    transition: color 0.15s;
}
.btn-favorite.active { color: #ff6b6b; }
.btn-favorite:hover { color: #ff8888; }

/* ==================== 响应式适配 ==================== */
/* 桌面端：480px 居中时给两侧加阴影区分 */
@media (min-width: 481px) {
    #app {
        box-shadow: 0 0 40px rgba(0,0,0,0.8);
    }
}

/* 极小屏幕：统计卡片缩小 */
@media (max-width: 360px) {
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
    .stat-card .stat-num { font-size: 18px; }
    .feed-overlay-actions { bottom: 70px; }
    .study-time-cards { gap: 6px; padding: 10px 8px; }
    .study-time-card { padding: 8px; gap: 6px; }
    .study-time-num { font-size: 14px; }
    .study-time-icon { font-size: 18px; }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .word-list li:hover { background: transparent; }
    .word-list li.active { background: #4a4a8a; }
}

/* ==================== 导出按钮（保留兼容）==================== */
.btn-export {
    padding: 6px 12px;
    background: #4a6a4a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
    margin-left: 4px;
}
.btn-export:hover { background: #5a7a5a; }
.btn-export:disabled { background: #555; cursor: not-allowed; }
.btn-export.recording {
    background: #a44;
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ==================== 分享面板（底部滑出，参考抖音） ==================== */
.share-sheet-mask {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0);
    pointer-events: none;
    transition: background 0.25s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.share-sheet-mask.show {
    background: rgba(0,0,0,0.55);
    pointer-events: auto;
}
.share-sheet {
    width: 100%;
    max-width: 480px;
    background: #1a1a1a;
    border-radius: 16px 16px 0 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.share-sheet-mask.show .share-sheet {
    transform: translateY(0);
}
.share-sheet-handle {
    width: 36px;
    height: 4px;
    background: #444;
    border-radius: 2px;
    margin: 6px auto 12px;
}
.share-sheet-header {
    text-align: center;
    margin-bottom: 18px;
}
.share-sheet-title {
    font-size: 14px;
    color: #888;
    font-weight: 500;
}
.share-sheet-grid {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    margin-bottom: 18px;
}
.share-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px;
    flex: 1;
    transition: opacity 0.15s;
}
.share-item:active { opacity: 0.6; }
.share-item-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4a4a8a, #3a3a7a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.share-item-label {
    font-size: 12px;
    color: #ccc;
}
.share-sheet-cancel {
    width: 100%;
    padding: 13px;
    background: #2a2a2a;
    border: 1px solid #333;
    color: #ccc;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s;
}
.share-sheet-cancel:active { background: #333; }

/* ==================== 录制指示器 ==================== */
.recording-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    background: rgba(0,0,0,0.85);
    border: 1px solid #444;
    border-radius: 12px;
    padding: 16px 24px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}
.recording-indicator.show { display: flex; }
.rec-dot {
    width: 10px;
    height: 10px;
    background: #f44;
    border-radius: 50%;
    animation: rec-blink 1s infinite;
}
@keyframes rec-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.rec-text {
    color: #fff;
    font-size: 14px;
    font-family: monospace;
}
.rec-progress-track {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}
.rec-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f44, #f88);
    border-radius: 2px;
    transition: width 0.1s linear;
}

/* ==================== Toast 提示 ==================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3000;
    background: rgba(0,0,0,0.88);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    max-width: 80%;
    text-align: center;
}
.toast.show { opacity: 1; }

/* ==================== 首次点击启用声音提示 ==================== */
.audio-hint {
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    display: none;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.2);
    animation: audio-hint-pulse 2s infinite;
}
.audio-hint.show { display: block; }
@keyframes audio-hint-pulse {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.7; transform: translateX(-50%) scale(1.03); }
}

/* ==================== 探索页分区 ==================== */
.discover-section {
    margin-top: 20px;
    padding: 0 12px;
}
.discover-section:first-of-type {
    margin-top: 12px;
}
.discover-section-title {
    color: #ffc0cb;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* 探索页入口卡片（词库/游戏） */
.discover-entry-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #2a2a2a;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    border-left: 3px solid #7aa2f4;
}
.discover-entry-card:active { background: #333; transform: scale(0.98); }
.discover-entry-icon { font-size: 28px; flex-shrink: 0; }
.discover-entry-info { flex: 1; min-width: 0; }
.discover-entry-title { font-size: 15px; font-weight: 600; color: #fff; }
.discover-entry-desc { font-size: 12px; color: #888; margin-top: 2px; }
.discover-entry-arrow { font-size: 22px; color: #555; flex-shrink: 0; }

/* ==================== 子视图（全屏滑入） ==================== */
.sub-view {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    background: #1a1a1a;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.sub-view.show {
    transform: translateX(0);
}
.sub-view-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #222;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 10;
}
.sub-view-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    flex: 1;
}
.sub-view-back {
    background: none;
    border: none;
    color: #7aa2f4;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
}
.sub-view-back:active { opacity: 0.6; }
.sub-view-body {
    padding: 16px 12px;
}

/* 游戏子视图卡片网格 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 12px;
    background: #2a2a2a;
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    transition: background 0.15s, transform 0.1s;
    border: 1px solid rgba(255,255,255,0.06);
}
.game-card:active { background: #333; transform: scale(0.96); }
.game-card-icon { font-size: 36px; }
.game-card-name { font-size: 14px; font-weight: 600; }
.game-card-desc { font-size: 11px; color: #888; text-align: center; }

/* ==================== 今日学习面板（合并面板 + 内联设置目标）==================== */
.study-panel {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}
.study-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.study-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffc0cb;
    margin: 0;
}
.study-panel-edit {
    padding: 5px 14px;
    border-radius: 14px;
    background: rgba(96,165,250,0.12);
    border: 1px solid rgba(96,165,250,0.3);
    color: #60a5fa;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.study-panel-edit:active { background: rgba(96,165,250,0.25); }
/* 面板内 3 卡片去掉自带 padding/bg，由面板统一控制（避免双层 padding）*/
.study-panel .study-time-cards {
    padding: 0;
    background: transparent;
}

/* ==================== 阶段选择器（横向 chip 滚动）==================== */
.stage-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 8px;
    scrollbar-width: none;
}
.stage-chips::-webkit-scrollbar { display: none; }
.stage-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 16px;
    background: #2a2a2a;
    border: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.stage-chip.active {
    background: rgba(122,162,244,0.2);
    border-color: #7aa2f4;
    color: #fff;
}
.stage-chip-count {
    font-size: 11px;
    color: #888;
    background: rgba(255,255,255,0.08);
    padding: 1px 6px;
    border-radius: 8px;
}
.stage-chip.active .stage-chip-count {
    color: #7aa2f4;
    background: rgba(122,162,244,0.15);
}

/* ==================== 列表无限滚动：哨兵 + 加载尾 ==================== */
.list-sentinel {
    height: 1px;
    width: 100%;
}
.list-end {
    text-align: center;
    color: #555;
    font-size: 12px;
    padding: 16px 0 8px;
}
/* 成绩列表空状态（与 .word-list .empty 一致风格）*/
.score-list .empty {
    color: #666;
    text-align: center;
    padding: 20px;
    border-bottom: none;
}

/* ==================== 我的页入口卡数量徽标 ==================== */
.mine-entry-count {
    background: rgba(255,107,107,0.2);
    color: #ff6b6b;
    font-size: 12px;
    font-weight: 600;
    min-width: 22px;
    text-align: center;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* 今日测试入口卡片 */
.test-entry-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 3px solid #ffc0cb;
}
.test-entry-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
.test-entry-icon { font-size: 28px; flex-shrink: 0; }
.test-entry-title { font-size: 15px; font-weight: 600; color: #fff; }
.test-entry-desc { font-size: 12px; color: #888; margin-top: 2px; line-height: 1.4; }
.test-entry-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    background: #ffc0cb;
    border: none;
    border-radius: 16px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.test-entry-btn:active { opacity: 0.85; }
.test-entry-btn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
}
.test-entry-count {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: rgba(0,0,0,0.25);
    border-radius: 9px;
    font-size: 12px;
    margin-left: 6px;
    padding: 0 5px;
}
.test-entry-count:empty,
.test-entry-count[data-zero="1"] {
    display: none;
}
