/**
 * Logo与文字重叠问题修复
 * 针对小屏幕设备的logo保护方案
 * 版本: 1.0.0
 */

/* 基础logo保护 */
.logo-container {
    position: relative !important;
    z-index: 1000 !important;
    flex-shrink: 0 !important; /* 防止logo被压缩 */
    min-width: 120px !important; /* 确保logo最小宽度 */
}

/* 导航栏文字适配 */
@media screen and (max-width: 768px) {
    /* 方案1: 缩短文字长度 */
    .nav-text-long {
        display: none !important;
    }
    
    .nav-text-short {
        display: inline !important;
    }
    
    /* 导航栏布局优化 */
    .main-navigation {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 8px 15px !important;
    }
    
    .site-branding {
        flex-shrink: 0 !important;
        max-width: 140px !important;
    }
    
    .site-branding img {
        max-width: 100% !important;
        height: auto !important;
        max-height: 40px !important;
    }
    
    /* 导航菜单适配 */
    .primary-navigation {
        flex: 1 !important;
        margin-left: 10px !important;
        overflow: hidden !important;
    }
    
    .menu-item {
        font-size: 14px !important;
        margin: 0 5px !important;
    }
    
    .menu-item a {
        padding: 8px 6px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 80px !important;
    }
}

/* 更小屏幕处理 */
@media screen and (max-width: 480px) {
    .logo-container {
        min-width: 100px !important;
    }
    
    .site-branding {
        max-width: 120px !important;
    }
    
    .site-branding img {
        max-height: 35px !important;
    }
    
    /* 文字进一步缩短 */
    .menu-item a {
        font-size: 12px !important;
        max-width: 60px !important;
        padding: 6px 4px !important;
    }
    
    /* 隐藏次要菜单项 */
    .menu-item.secondary {
        display: none !important;
    }
    
    /* 使用汉堡菜单 */
    .mobile-menu-toggle {
        display: block !important;
        background: none !important;
        border: none !important;
        font-size: 18px !important;
        cursor: pointer !important;
    }
    
    .primary-navigation.mobile-hidden {
        display: none !important;
    }
}

/* 超小屏幕 (320px及以下) */
@media screen and (max-width: 320px) {
    .site-branding {
        max-width: 100px !important;
    }
    
    .site-branding img {
        max-height: 30px !important;
    }
    
    /* 只显示必要文字 */
    .menu-item:not(.essential) {
        display: none !important;
    }
    
    .menu-item.essential a {
        font-size: 11px !important;
        max-width: 50px !important;
    }
}

/* 抽奖页面特定优化 */
.page-lucky-draw {
    /* logo在抽奖页面的特殊处理 */
    .robot-image {
        position: relative !important;
        z-index: 5 !important;
    }
    
    .prize-name {
        position: relative !important;
        z-index: 3 !important;
        /* 确保文字不会覆盖logo */
        margin-top: 5px !important;
        padding: 0 2px !important;
    }
    
    /* 如果文字过长，使用省略号 */
    .prize-name {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }
}

/* 多语言文字处理 */
@media screen and (max-width: 480px) {
    .lang-content.de {
        /* 德语通常较长，需要特殊处理 */
        font-size: 90% !important;
    }
    
    .lang-content.zh {
        /* 中文相对紧凑 */
        font-size: 95% !important;
    }
    
    .lang-content.en {
        /* 英语居中 */
        font-size: 92% !important;
    }
}

/* 垂直布局优化 - 当水平空间不足时 */
@media screen and (max-width: 375px) {
    .navigation-vertical {
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .site-branding {
        margin-bottom: 8px !important;
        max-width: 150px !important;
    }
    
    .primary-navigation {
        margin-left: 0 !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .menu-item {
        display: inline-block !important;
        margin: 2px 4px !important;
    }
}

/* 文字优先级设置 */
.text-priority-high {
    z-index: 100 !important;
}

.text-priority-medium {
    z-index: 50 !important;
}

.text-priority-low {
    z-index: 10 !important;
}

/* logo保护区域 */
.logo-protection-zone {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    pointer-events: none !important;
    z-index: 999 !important;
}

/* 文字背景保护 */
@media screen and (max-width: 480px) {
    .text-with-background {
        background: rgba(255, 255, 255, 0.9) !important;
        border-radius: 3px !important;
        padding: 2px 4px !important;
        backdrop-filter: blur(2px) !important;
    }
    
    .text-with-shadow {
        text-shadow: 
            1px 1px 2px rgba(0, 0, 0, 0.8),
            -1px -1px 2px rgba(255, 255, 255, 0.8) !important;
    }
}

/* 动态字体大小 */
@media screen and (max-width: 320px) {
    .dynamic-text {
        font-size: clamp(10px, 2.5vw, 14px) !important;
    }
}

@media screen and (min-width: 321px) and (max-width: 480px) {
    .dynamic-text {
        font-size: clamp(11px, 3vw, 16px) !important;
    }
}

/* 智能换行处理 */
.smart-wrap {
    word-break: break-word !important;
    hyphens: auto !important;
    line-height: 1.2 !important;
}

/* 关键内容保护 */
.critical-content {
    position: relative !important;
    z-index: 1001 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 4px !important;
    padding: 4px 6px !important;
    margin: 2px 0 !important;
} 