/**
 * 分辨率保护 CSS 样式 - 强制最小宽度实现
 */

/* 通知条样式 */
.resolution-guard-notification {
    position: fixed;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: #fff;
    z-index: 999998;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: none;
}

.resolution-guard-notification.top {
    top: 0;
}

.resolution-guard-notification.bottom {
    bottom: 0;
}

.resolution-guard-notification-content {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 12px;
}

.resolution-guard-notification-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resolution-guard-notification-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.resolution-guard-notification-message {
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

.resolution-guard-notification-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    margin-left: 16px;
    flex-shrink: 0;
}

.resolution-guard-notification-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 移动端自动缩放支持 */
body.resolution-guard-mobile-scale {
    min-width: 1920px !important;
    /* transform: scale(var(--mobile-scale, 0.2)); */
    /* transform-origin: 0 0; */
    /* width: calc(100% / var(--mobile-scale, 0.2)); */
}

/* iOS微信浏览器和Safari的替代缩放方案 */
.resolution-guard-alternative-scale {
    /* 不iOS设备不使用CSS transform，完全依赖viewport缩放 */
    /* 这样可以避免缩放回弹问题 */
    transform: none !important;
    -webkit-transform: none !important;
    zoom: normal !important;
    width: 100%;
    height: 100%;
}

/* 移动设备特殊处理 - 合并到上面的规则中避免重复 */

body.resolution-guard-alternative-scale {
    min-width: 1920px !important;
    touch-action: pan-y pinch-zoom;
    /* 确保不使用transform */
    transform: none !important;
    -webkit-transform: none !important;
    /* 允许内容在用户缩放时适应 */
    overflow-x: auto;
    overflow-y: auto;
}

html {
    overflow-x: auto !important;
}

/* 移动端缩放时隐藏通知条 - 通过JavaScript控制 */
/* 注释掉媒体查询，改用JS动态控制
body.resolution-guard-mobile-scale .resolution-guard-notification,
body.resolution-guard-alternative-scale .resolution-guard-notification {
    display: none !important;
}
*/

/* 响应式设计 */
@media (max-width: 600px) {
    .resolution-guard-notification-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 16px;
    }

    .resolution-guard-notification-close {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
    .resolution-guard-notification {
        background: #1a202c;
        border-bottom: 2px solid #fff;
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    .resolution-guard-notification-close {
        transition: none;
    }
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .resolution-guard-notification {
        background: linear-gradient(135deg, #2d3748, #1a202c);
    }
}

/* 打印时隐藏 */
@media print {
    .resolution-guard-notification {
        display: none !important;
    }

    /* 打印时取消缩放 */
    .resolution-guard-mobile-scale {
        transform: none !important;
        width: auto !important;
        height: auto !important;
    }
}


/* 辅助功能 */
.resolution-guard-notification:focus-within {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

/* 动画效果 */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.resolution-guard-notification.top {
    animation: slideDown 0.3s ease-out;
}

.resolution-guard-notification.bottom {
    animation: slideUp 0.3s ease-out;
}