.fab-container {
    position: fixed;
    right: 20px !important;
    bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 10000;
}

.fab-main-split {
	position: relative;
    overflow: hidden !important; 
    display: flex;
    align-items: stretch;
    display: flex;
    align-items: stretch;
    background: rgba(8, 12, 28, 0.94) !important;
    border: 1.5px solid rgba(0, 242, 255, 0.85) !important;
    border-radius: 4px;
    backdrop-filter: blur(20px) saturate(1.6) !important;
    height: 44px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.75), 0 0 30px rgba(0,242,255,0.5) !important;
    overflow: hidden;
    z-index: 10001;
}

.split-left {
    display: flex;
    align-items: center;
    padding: 0 15px;
    cursor: pointer;
    border-right: 1px solid rgba(0,242,255,0.2);
    flex: 1;
}
.split-left:hover { background: rgba(0,242,255,0.1); }

.split-left .emoji {
    display: inline-block;
    font-size: 20px;
    margin-right: 8px;
    transform-origin: left center;
    animation: bookFloat 3s ease-in-out infinite; 
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.fab-main-split:hover .split-left .emoji,
.active .split-left .emoji {
    animation-play-state: paused; 
    transform: perspective(400px) rotateY(-35deg) scale(1.2) translateY(-2px);
    filter: drop-shadow(0 0 8px #ffcc00);
}
.split-left .text {
    font-family: 'Orbitron', sans-serif !important;
    color: #ffcc00 !important;
    font-weight: 900 !important;
    font-size: 15px !important;
    text-shadow: 0 0 8px #ffcc00, 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000 !important;
}

.split-right {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    cursor: pointer;
    color: #00f2ff;
}
.split-right:hover { background: rgba(0,242,255,0.2); }
.split-right svg { width: 22px; height: 22px; transition: 0.3s; }

.active .split-right svg { transform: rotate(90deg); }

.fab-menu {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.25s ease;
    align-items: flex-end !important;

    background: rgba(0, 0, 0, 0.35) !important;   
    border: none !important;
    border-radius: 10px;
    padding: 10px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.fab-container.active .fab-menu {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}
@supports (-webkit-touch-callout: none) {
    .fab-menu {
        background: rgba(0, 0, 0, 0.45) !important;
    }
}
.menu-item {
    background: #fff;
    color: #000 !important;
    text-decoration: none;
    padding: 12px 10px; 
    font-weight: 900;
    font-size: 11px;
    font-family: 'Orbitron', sans-serif;
    width: 195px; 
    box-sizing: border-box; 
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-left: 6px solid #ffcc00;
    border-right: 6px solid #ffcc00;
    
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden; 
}

.menu-item:hover {
    background: #f8f8f8;
    transform: scale(1.02);
}
.menu-item.chest-mega-btn {
    background: linear-gradient(135deg, #e6b800 0%, #ffcc00 100%) !important;
    border: none !important;
    color: #1a1a1a !important;
    transform: skewX(-10deg) !important;
    width: 195px !important;
    padding: 14px 0 !important;
    margin-bottom: 12px !important;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

.menu-item.chest-mega-btn:hover {
    transform: skewX(-10deg) scale(1.06) !important;
}

.chest-mega-btn .inner-content { transform: skewX(10deg); }
.mega-icon {
    display: inline-block;
    font-size: 30px;
    margin-bottom: 4px;
    transform-origin: center center; 
    perspective: 500px; 
    animation: bookFlipClean 3s ease-in-out infinite;
}
@keyframes bookFlipClean {
    0%, 100% {
        transform: rotateY(0deg) translateY(0);
    }
    30% {
        transform: rotateY(-45deg) translateY(-3px) scale(1.05);
    }
    60% {
        transform: rotateY(-10deg) translateY(-1px);
    }
}
.mega-text { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 11.5px; background: rgba(255,255,255,0.35); padding: 3px 10px; border-radius: 4px; }

.menu-item.danger-zone { border-left-color: #ff4444; border-right-color: #ff4444; }

.has-submenu { 
    cursor: pointer; 
    padding: 0 !important; 
    overflow: hidden; 
}

.submenu-title {
    padding: 12px 25px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

.submenu-content {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #f1f1f1;
    animation: fadeInSub 0.3s ease-out;
}
@keyframes fadeInSub {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.has-submenu.open {
    border-bottom: 2px solid #ffcc00 !important;
}

.has-submenu.open .submenu-content { 
    display: flex !important; 
}

.sub-item { 
    display: block !important;
    width: 100%;
    padding: 12px 0 !important; 
    color: #444 !important; 
    font-size: 10px; 
    text-decoration: none; 
    border-bottom: 1px solid #ddd; 
    text-align: center;
    box-sizing: border-box;
    transition: background 0.2s;
}

.sub-item:last-child {
    border-bottom: none;
}

.sub-item:hover { 
    background: #ffcc00 !important; 
    color: #000 !important; 
}

.menu-item.has-submenu {
    height: auto !important; 
    min-height: 44px;
}

.menu-item .en {
    font-size: 10px; 
    letter-spacing: -0.3px;
    line-height: 1.2;
    word-break: break-word; 
    max-width: 100%;
}

.menu-item .zh {
    font-size: 11px;
    letter-spacing: 0.5px;
}
.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; 
    
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(0, 242, 255, 0.4) 50%, 
        transparent 100%
    );
    animation: scanMove 2s linear infinite; 
    pointer-events: none;
    z-index: 5; 
}
@keyframes scanMove {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}
@keyframes bookFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-4px) rotate(-2deg);
    }
}
.zh-mode .en, .en .zh { display: none; }
.zh-mode .zh { display: inline; }