/* 底部导航栏样式（微信小程序显示） */

/* ============================================================
   顶部网站导航栏（仅 H5 网页环境显示，微信小程序中隐藏）
   ============================================================ */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 45px;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(102, 126, 234, 0.12);
}
/* 默认隐藏，非小程序时由 JS 开启 */
body:not(.is-wechat-mini-program).has-topbar .topbar {
    display: flex;
}
body.has-topbar {
    padding-top: 52px;
}
/* 小程序环境绝不显示 */
body.is-wechat-mini-program .topbar {
    display: none !important;
}

.topbar .topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}
.topbar .topbar-logo img {
    height: 34px;
    width: auto;
    display: block;
}
.topbar .topbar-name {
    font-size: 16px;
    font-weight: 700;
    color: #2b2d42;
    font-family: 'Ma Shan Zheng', 'PingFang SC', sans-serif;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
/* 二维码（悬浮可放大） */
.topbar .topbar-qr {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px;
}
.topbar .topbar-qr > img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: block;
    border: 1px solid #e6e8f0;
}
.topbar .topbar-qr-label {
    font-size: 11px;
    color: #8a8f9c;
    white-space: nowrap;
}
/* 二维码弹层：桌面 hover 展开；移动端无 hover，由 nav.js 点按切换 .qr-open 展开。
   展开后弹层 pointer-events 恢复 auto，大图可触摸 → 微信里长按即可识别二维码。 */
.topbar .topbar-qr-pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    padding: 8px 8px 6px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid #e6e8f0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.25s ease;
    pointer-events: none;
    text-align: center;
    z-index: 1000;
}
.topbar .topbar-qr:hover .topbar-qr-pop,
.topbar .topbar-qr.qr-open .topbar-qr-pop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.topbar .topbar-qr-pop .topbar-qr-big {
    width: 160px;
    height: 160px;
    object-fit: contain;
    display: block;
    border-radius: 6px;
    background: #fff;
}
.topbar .topbar-qr-pop .topbar-qr-tip {
    display: block;
    font-size: 11px;
    color: #8a8f9c;
    padding-top: 5px;
    white-space: nowrap;
}

.topbar .topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    transition: all 0.25s ease;
    white-space: nowrap;
}
.topbar .topbar-user:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.45);
}
.topbar .topbar-user:active {
    transform: translateY(0);
}
.topbar .topbar-user .topbar-user-icon {
    font-size: 14px;
}

/* 移动端：隐藏文字名与二维码标签，保持简洁 */
@media (max-width: 480px) {
    .topbar {
        height: 48px;
        padding: 0 12px;
    }
    body.has-topbar {
        padding-top: 48px;
    }
    .topbar .topbar-logo img {
        height: 30px;
    }
    .topbar .topbar-name {
        display: none;
    }
    .topbar .topbar-qr-label {
        display: none;
    }
    .topbar .topbar-right {
        gap: 8px;
    }
    .topbar .topbar-user {
        padding: 6px 12px;
        font-size: 12px;
    }
}

        /* ================= 底部导航栏（仅微信小程序显示） ================= */
        .sidebar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            display: none;
            justify-content: space-around;
            align-items: center;
            background: rgba(255, 255, 255, 0.92);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            z-index: 1000;
            height: 62px;
            padding: 0 8px;
            border-top: none;
            border-radius: 22px 22px 0 0;
            box-shadow: 0 -4px 24px rgba(31, 45, 61, 0.08), 0 -1px 0 rgba(31, 45, 61, 0.05);
        }

        /* 仅在微信小程序环境下显示底部导航栏 */
        body.is-wechat-mini-program .sidebar {
            display: flex;
        }

        /* ============ 小程序底部导航的让位（2026-09-14） ============
           .sidebar 是 fixed 的（62px，≤480px 58px），会原样盖住页面最底部
           ~58px 的内容：36spell 虚拟键盘最底下的「大/小写」「空格」键、
           test.html 结算卡的「重新开始」按钮都正好在这一段里。
           给 body 补让位高度，让内容能滚到栏之上；只在
           is-wechat-mini-program 下生效，H5 端零影响。

           ⚠️ 只写 padding-bottom 不够：一批页面是
           「html,body{height:100%} + body{box-sizing:border-box}」
           （36spell.css + 36spell-disney.css 就是这么叠的），padding 会被
           100% 高度整个吸收，文档一毫米都不会变高。所以再补一条
           min-height: calc(100vh + 栏高) —— min-height 大于 height 时生效，
           文档被真实撑高，多出来的那一段正好是栏后的空白。
           每个属性都「先写死值、再写 env() 版本」：老 X5 内核不认 env()
           时整条 calc 作废，前一条兜底。 */
        body.is-wechat-mini-program {
            padding-bottom: 62px;
            min-height: calc(100vh + 62px);
        }
        body.is-wechat-mini-program {
            padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
            min-height: calc(100vh + 62px + env(safe-area-inset-bottom, 0px));
        }

        .side-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            padding: 6px 8px;
            font-size: 12px;
            flex: 1;
            max-width: 25%;
            position: relative;
            user-select: none;
            transition: transform 0.25s ease;
            cursor: pointer;
        }

        /* 增大点击区域 */
        .side-item::before {
            content: '';
            position: absolute;
            top: -8px;
            left: 0;
            right: 0;
            bottom: -8px;
        }

        .side-item:active {
            transform: scale(0.92);
        }

        .side-item .icon {
            font-size: 22px;
            margin-bottom: 4px;
            color: #94a3b8;
            transition: color 0.25s ease, transform 0.25s ease;
        }

        /* 悬停/选中态：靛蓝主题色 + 轻微上浮 */
        .side-item:hover .icon,
        .side-item.active .icon {
            color: #667eea;
            transform: translateY(-2px);
        }

        .side-item .text {
            font-size: 11px;
            color: #64748b;
            font-weight: 500;
            letter-spacing: 0.3px;
            transition: color 0.25s ease, font-weight 0.25s ease;
        }

        .side-item:hover .text,
        .side-item.active .text {
            color: #667eea;
            font-weight: 600;
        }

        /* 选中态底部指示条 */
        .side-item.active::after {
            content: '';
            position: absolute;
            bottom: 2px;
            left: 50%;
            transform: translateX(-50%);
            width: 18px;
            height: 3px;
            border-radius: 3px;
            background: linear-gradient(90deg, #667eea, #764ba2);
        }

        /* ================= 测试子菜单（上滑面板） ================= */
        .sub-menu {
            position: fixed;
            bottom: -100%;
            left: 0;
            right: 0;
            background: #ffffff;
            box-shadow: 0 -8px 32px rgba(31, 45, 61, 0.12);
            padding: 22px 18px;
            transition: bottom 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
            z-index: 999;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
            border-radius: 24px 24px 0 0;
            opacity: 0;
            pointer-events: none;
        }

        .sub-menu.active {
            bottom: 62px;
            opacity: 1;
            pointer-events: auto;
        }

        /* 桌面端样式调整 */
        @media (min-width: 481px) {
            .sub-menu.active {
                bottom: 62px;
            }
        }

        .sub-menu .side-item1,
        .sub-menu .side-item2,
        .sub-menu .side-item3,
        .sub-menu .side-item4 {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            text-decoration: none;
            padding: 18px 14px;
            border-radius: 16px;
            background: #f8fafc;
            color: #334155;
            font-weight: 600;
            font-size: 16px;
            border: 1.5px solid #e2e8f0;
            transition: all 0.25s ease;
        }

        .sub-menu .side-item1 i,
        .sub-menu .side-item2 i,
        .sub-menu .side-item3 i,
        .sub-menu .side-item4 i {
            font-size: 18px;
            color: #667eea;
        }

        .sub-menu .side-item1:hover,
        .sub-menu .side-item2:hover,
        .sub-menu .side-item3:hover,
        .sub-menu .side-item4:hover {
            transform: translateY(-3px);
            background: #eef2ff;
            border-color: #667eea;
            color: #667eea;
            box-shadow: 0 6px 16px rgba(102, 126, 234, 0.18);
        }

        .close-btn {
            position: absolute;
            top: 12px;
            right: 14px;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: #94a3b8;
            cursor: pointer;
            grid-column: span 2;
            justify-self: end;
            border-radius: 50%;
            background: #f1f5f9;
            transition: all 0.25s ease;
            line-height: 1;
        }

        .close-btn:hover {
            color: #ef4444;
            background: #fee2e2;
            transform: rotate(90deg);
        }
        
    
.pk {
    position: relative;
    display: block;
    margin: 5px auto;
    
    /* 红色系渐变 - 最适合PK的配色 */
    background: linear-gradient(145deg, #FF4757, #E84118);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 5px 15px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    
    /* 3D立体阴影效果 */
    box-shadow: 
        0 3px 0 #C23616,
        0 4px 6px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 0 rgba(0,0,0,0.2);
    
    transition: all 0.1s ease;
    transform: translateY(0);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 30px;
}

.pk:active {
    transform: translateY(3px);
    box-shadow: 
        0 0px 0 #C23616,
        0 2px 3px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.pk:hover {
    background: linear-gradient(145deg, #FF5E7D, #FF3E4D);
    box-shadow: 
        0 4px 0 #C23616,
        0 5px 8px rgba(0,0,0,0.25),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 0 rgba(0,0,0,0.2);
}



.pk::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    border-radius: 6px 6px 0 0;
    pointer-events: none;
}
       
.language-assessment-btn {
    position: relative;
   
    
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.3s;
     transform: translateY(2px); /* 下移2像素 */
}

.language-assessment-btn:hover {
    background-color: #45a049;
}

.language-assessment-btn:active {
    transform: scale(0.95);
}

/* 加载状态样式 */
.language-assessment-btn.loading {
    background-color: #666;
    cursor: progress;
}

.language-assessment-btn.loading::after {
    content: "...";
    margin-left: 5px;
}

/* 控制容器样式 */

.control-bar {
    display: flex !important; /* 强制覆盖其他样式 */
    flex-direction: row;     /* 水平排列 */
    align-items: center;      /* 垂直居中 */
    justify-content: center;  /* 水平居中 */
    gap: 15px;               /* 按钮间距 */
    margin: 10px 0;
}



/* 音素播放按钮微调 */
.speaker-icon1 {
    margin-top: -2px;
    transform: scale(0.9);
}
.hollow-house {
  color: #94a3b8;
  font-size: 22px;
}
.hollow-bars {
  color: #94a3b8;
  font-size: 22px;
}

.hollow-user {
  color: #94a3b8;
  font-size: 22px;
}

.hollow-weixin {
  color: #07C160; /* 保持微信品牌绿 */
  font-size: 22px;
}



/*ad*/
        /* 主色调定义 */
        .cilaoda-ad-overlay {
            --cilaoda-primary: #FF5252;
            --cilaoda-secondary: #4FC3F7;
            --cilaoda-accent: #FFD54F;
            --cilaoda-text: #333;
            --cilaoda-light: #FFF;
        }
        
        .cilaoda-ad-overlay {
            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: 999999999;
        }
        
        .cilaoda-ad-box {
            background: white;
            border-radius: 20px;
            width: 30%;
            min-width: 220px;
            max-width: 280px;
            padding: 15px;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            position: relative;
            border: 1px solid rgba(255, 82, 82, 0.2);
        }
        
        .cilaoda-title-container {
            position: relative;
            margin: 5px 0 15px;
        }
        
        .cilaoda-title-decoration {
            position: relative;
            height: 25px;
            margin: 10px 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .cilaoda-title-decoration::before,
        .cilaoda-title-decoration::after {
            content: '';
            flex: 1;
            height: 2px;
            background: linear-gradient(90deg, transparent, var(--cilaoda-primary), transparent);
        }
        
        .cilaoda-title-decoration::before {
            margin-right: 10px;
        }
        
        .cilaoda-title-decoration::after {
            margin-left: 10px;
        }
        
        .cilaoda-title-decoration span {
            display: inline-block;
            width: 25px;
            height: 25px;
            background: linear-gradient(135deg, var(--cilaoda-accent), #FFAB40);
            border-radius: 50%;
            position: relative;
            transform: rotate(45deg);
            box-shadow: 0 2px 8px rgba(255, 82, 82, 0.3);
        }
        
        .cilaoda-title-decoration span::before,
        .cilaoda-title-decoration span::after {
            content: '';
            position: absolute;
            width: 8px;
            height: 8px;
            background: var(--cilaoda-primary);
            border-radius: 50%;
        }
        
        .cilaoda-title-decoration span::before {
            top: 4px;
            left: 4px;
        }
        
        .cilaoda-title-decoration span::after {
            bottom: 4px;
            right: 4px;
        }
        
        .cilaoda-ad-title {
            font-size: 28px;
            font-weight: bold;
            color: var(--cilaoda-primary);
            font-family: 'Ma Shan Zheng', cursive;
            letter-spacing: 1px;
            text-shadow: 2px 2px 4px rgba(255, 82, 82, 0.2);
            background: linear-gradient(to right, var(--cilaoda-primary), #FF8E8E);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        
        .cilaoda-ad-content {
            margin: 10px 0;
        }
        
        .cilaoda-content-line {
            font-size: 15px;
            margin: 5px 0;
            line-height: 1.5;
        }
        
        .cilaoda-special-highlight {
            color: white;
            font-weight: bold;
            font-size: 16px;
            background: linear-gradient(135deg, var(--cilaoda-accent), #FF8E8E);
            padding: 6px 15px;
            border-radius: 30px;
            display: inline-block;
            box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
            position: relative;
            overflow: hidden;
        }
        
        .cilaoda-special-highlight::after {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent 45%, rgba(255,255,255,0.3) 50%, transparent 55%);
            animation: cilaoda-shine 3s infinite;
            z-index: 0;
        }
        
        @keyframes cilaoda-shine {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }
        
        .cilaoda-normal-text {
            color: var(--cilaoda-text);
            position: relative;
            padding: 0 8px;
            font-size: 13px;
        }
        
        .cilaoda-normal-text::before, 
        .cilaoda-normal-text::after {
            content: '✦';
            position: absolute;
            color: var(--cilaoda-accent);
            font-size: 12px;
        }
        
        .cilaoda-normal-text::before {
            left: -5px;
        }
        
        .cilaoda-normal-text::after {
            right: -5px;
        }
        
        .cilaoda-ad-button {
            padding: 12px;
            border-radius: 50px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            border: none;
            background: linear-gradient(135deg, var(--cilaoda-primary), #FF8E8E);
            color: white;
            margin: 10px 0;
            width: 100%;
            font-family: 'Ma Shan Zheng', cursive;
            transition: all 0.3s;
            box-shadow: 0 4px 10px rgba(255, 82, 82, 0.3);
        }
        
        .cilaoda-ad-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(255, 82, 82, 0.4);
        }
        
        .cilaoda-countdown-container {
            margin-top: 15px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        
        .cilaoda-countdown-text {
            font-size: 12px;
            color: #777;
            font-weight: bold;
            margin-bottom: 5px;
        }
        
        .cilaoda-countdown-bar {
            width: 100%;
            height: 5px;
            background-color: #f0f0f0;
            border-radius: 3px;
            overflow: hidden;
            position: relative;
        }
        
        .cilaoda-countdown-progress {
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            width: 100%;
            background: linear-gradient(90deg, var(--cilaoda-primary), #FF8E8E);
            transition: width 1s linear;
        }
        
        .cilaoda-close-icon {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 25px;
            height: 25px;
            cursor: pointer;
            opacity: 0.7;
            transition: all 0.3s;
        }
        
        .cilaoda-close-icon:hover {
            opacity: 1;
            transform: rotate(90deg);
        }
        
        .cilaoda-close-icon::before, 
        .cilaoda-close-icon::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 15px;
            height: 2px;
            background: var(--cilaoda-primary);
        }
        
        .cilaoda-close-icon::before {
            transform: translate(-50%, -50%) rotate(45deg);
        }
        
        .cilaoda-close-icon::after {
            transform: translate(-50%, -50%) rotate(-45deg);
        }
        
        /* 仅手机端显示 */
        @media (min-width: 768px) {
            .cilaoda-ad-overlay {
                display: none;
            }
        }
        
            /* 移动端适配 */
        @media (max-width: 480px) {
            .sidebar {
                height: 58px;
                border-radius: 20px 20px 0 0;
            }

            /* 让位量跟着栏高走（58px + 安全区；同样先写死值兜底老内核） */
            body.is-wechat-mini-program {
                padding-bottom: 58px;
                min-height: calc(100vh + 58px);
            }
            body.is-wechat-mini-program {
                padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
                min-height: calc(100vh + 58px + env(safe-area-inset-bottom, 0px));
            }

            .side-item .icon {
                font-size: 20px;
            }

            .side-item .text {
                font-size: 10px;
            }

            .sub-menu.active {
                bottom: 58px;
            }

            .sub-menu .side-item1,
            .sub-menu .side-item2,
            .sub-menu .side-item3,
            .sub-menu .side-item4 {
                font-size: 14px;
                padding: 16px 10px;
            }
        }

        /* ============ 训练按钮 + 控制栏小屏适配 ============
           合并"测试"/"练习套件"为单一"训练"按钮后，控制栏只剩 1 枚训练按钮。
           这里专门处理：超窄屏下控制按钮不要挤压变形、自动换行 + 缩小。 */
        @media (max-width: 480px) {
            .control-bar {
                flex-wrap: wrap; /* 允许按钮换行，避免溢出 */
                gap: 8px;
                margin: 8px 0;
            }
            .control-center {
                gap: 8px;
                flex-wrap: wrap;
                justify-content: center;
            }
            /* 单按钮训练主按钮：紧凑显示 */
            .control-btn.train-btn {
                padding: 8px 14px;
                font-size: 13px;
                border-radius: 18px;
            }
            .control-btn.train-btn .train-btn-icon {
                font-size: 13px;
            }
            .control-btn.train-btn .train-btn-chevron {
                font-size: 9px;
            }
        }
        @media (max-width: 360px) {
            .control-btn.train-btn {
                padding: 7px 12px;
                font-size: 12px;
            }
        }
