/**
 * 微信扫码登录样式
 * 提供美观、现代化的微信扫码登录界面
 * 
 * 作者：AI Assistant
 * 创建时间：2025-10-24
 */

/* ===========================
   微信登录容器（移除样式，让浏览器使用默认样式）
   =========================== */
/* #wechat-login-container 样式已移除，使用默认样式 */

/* ===========================
   微信登录标题（精简）
   =========================== */
.wechat-login-title {
    font-size: 20px;
    font-weight: 500;
    color: #333;
    text-align: center;
    margin-bottom: 15px;
}

/* ===========================
   二维码容器（完全透明，统一颜色，确保与父容器一致）
   =========================== */
#wechat-qrcode-container {
    min-height: 420px !important; /* 足够的高度显示微信官方完整页面（400px iframe + 边距） */
    max-height: 440px !important;
    height: 420px !important; /* 固定高度，防止被压缩 */
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important; /* 强制透明背景，确保与父容器颜色一致 */
    background-color: transparent !important; /* 双重保险，确保透明 */
    border: none !important; /* 移除边框 */
    border-radius: 0 !important; /* 不需要圆角，由外层卡片控制 */
    margin-bottom: 15px;
    position: relative;
    flex-shrink: 0; /* 防止被flex布局压缩 */
    width: 100%; /* 确保宽度 */
    overflow: hidden; /* 裁剪iframe的四个角，形成椭圆形 */
}

/* 二维码包装器（椭圆圆角遮罩，统一颜色） */
.wechat-qrcode-wrapper {
    text-align: center;
    background: transparent !important; /* 透明背景，继承父级深色 */
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0; /* 不需要圆角，由外层卡片控制 */
    overflow: hidden; /* 裁剪iframe的四个角 */
    /* 确保不受全局样式影响 */
    color: initial !important; /* 使用初始颜色，不受全局样式影响 */
    filter: none !important; /* 不使用滤镜 */
    opacity: 1 !important; /* 确保完全不透明 */
}

/* iframe 样式：直接显示微信官方完整页面，通过外层容器实现圆角 */
.wechat-qrcode-iframe {
    width: 300px !important;
    height: 400px !important;
    border: none !important;
    /* 通过外层容器的 overflow: hidden 和 border-radius 实现椭圆形圆角 */
    pointer-events: auto !important; /* 确保可以交互 */
    /* 确保iframe不受全局样式影响，保持微信官方页面的原始样式 */
    /* 注意：iframe 内部的样式我们无法直接修改，因为 iframe 是独立的文档 */
    /* 以下样式只能影响 iframe 元素本身，不能影响 iframe 内部的内容 */
    color: initial !important; /* 使用初始颜色，不受全局样式影响 */
    background: transparent !important; /* 透明背景，不覆盖微信官方页面 */
    filter: none !important; /* 不使用滤镜，保持原始显示 */
    opacity: 1 !important; /* 确保完全不透明 */
    mix-blend-mode: normal !important; /* 正常混合模式 */
    transform: none !important; /* 不使用变换 */
    -webkit-filter: none !important; /* WebKit 浏览器不使用滤镜 */
}

/* 已扫码状态（如果需要，可以添加边框高亮效果） */
#wechat-qrcode-container.scanned .wechat-qrcode-wrapper {
    /* 可以添加边框高亮，但微信官方页面会自己处理状态 */
    /* border: 2px solid #07c160; */
    /* box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1); */
}

/* ===========================
   加载状态（适配深色背景）
   =========================== */
.wechat-loading {
    text-align: center;
    color: #ffffff !important; /* 白色文字，适配深色背景 */
}

.wechat-loading i {
    font-size: 40px;
    margin-bottom: 10px;
}

.wechat-loading p {
    font-size: 14px;
    margin: 10px 0 0 0;
}

/* ===========================
   成功状态
   =========================== */
.wechat-success {
    text-align: center;
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===========================
   过期/错误状态
   =========================== */
.wechat-expired,
.wechat-error {
    text-align: center;
    padding: 40px;
}

.wechat-expired i,
.wechat-error i {
    display: block;
    margin-bottom: 15px;
}

/* ===========================
   状态提示区域（隐藏，不需要）
   =========================== */
.wechat-status-area {
    display: none; /* 隐藏状态提示区域 */
}

#wechat-status-text {
    display: none;
}

#wechat-tips {
    display: none;
}

#wechat-countdown {
    display: none;
}

/* ===========================
   操作按钮区域（适配深色背景，与微信官方页面风格一致）
   =========================== */
.wechat-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    margin-top: 10px;
    border-top: none; /* 移除边框，与微信官方页面风格一致 */
    /* 不设置默认颜色，让子元素自己控制颜色 */
}

#wechat-refresh-btn {
    color: #044093 !important; /* 超链接蓝色，清晰可见 */
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
    font-weight: normal !important; /* 确保字体粗细正常 */
    text-shadow: none !important; /* 不使用文字阴影，保持清晰 */
    opacity: 1 !important; /* 确保完全不透明 */
    text-decoration: none !important; /* 移除下划线，保持超链接样式 */
}

#wechat-refresh-btn:hover {
    color: #0056b3 !important; /* 悬停时稍深的蓝色 */
    opacity: 1 !important; /* 悬停时也保持完全不透明 */
    text-decoration: underline !important; /* 悬停时显示下划线 */
}

#wechat-refresh-btn i {
    margin-right: 4px;
    font-size: 14px;
    color: inherit !important; /* 继承父元素颜色 */
}

#switch-to-password {
    color: #044093 !important; /* 超链接蓝色，清晰可见 */
    cursor: pointer;
    font-size: 13px;
    transition: color 0.3s ease;
    font-weight: normal !important; /* 确保字体粗细正常 */
    text-shadow: none !important; /* 不使用文字阴影，保持清晰 */
    opacity: 1 !important; /* 确保完全不透明 */
    text-decoration: none !important; /* 移除下划线，保持超链接样式 */
}

#switch-to-password:hover {
    color: #0056b3 !important; /* 悬停时稍深的蓝色 */
    opacity: 1 !important; /* 悬停时也保持完全不透明 */
    text-decoration: underline !important; /* 悬停时显示下划线 */
}

/* ===========================
   登录方式切换
   =========================== */
.login-mode-switch {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e6e6e6;
}

#switch-to-wechat {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #07c160 0%, #05a850 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
}

#switch-to-wechat:hover {
    background: linear-gradient(135deg, #05a850 0%, #049840 100%);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.4);
    transform: translateY(-2px);
}

#switch-to-wechat i {
    margin-right: 8px;
    font-size: 18px;
}

/* ===========================
   微信图标样式
   =========================== */
.wechat-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: url('/images/wechat-icon.svg') no-repeat center;
    background-size: contain;
    vertical-align: middle;
    margin-right: 5px;
}

/* 如果没有SVG图标，使用iconfont */
.wechat-icon-text {
    color: #07c160;
    font-size: 20px;
    font-weight: bold;
}

/* ===========================
   响应式设计（紧凑版）
   =========================== */
@media screen and (max-width: 768px) {
    /* #wechat-login-container 样式已移除，使用默认样式 */

    .wechat-login-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    #wechat-qrcode-container {
        min-height: 350px;
        max-height: 380px;
        height: 350px !important;
        border-radius: 0; /* 不需要圆角，由外层卡片控制 */
    }

    .wechat-qrcode-wrapper {
        padding: 0;
        border-radius: 0; /* 不需要圆角，由外层卡片控制 */
    }

    .wechat-qrcode-iframe {
        width: 260px !important;
        height: 340px !important;
        /* 移动端也完整显示，通过外层容器实现圆角 */
    }

    .wechat-actions {
        flex-direction: row;
        gap: 10px;
        padding-top: 10px;
        margin-top: 8px;
        /* 不设置默认颜色，让子元素自己控制颜色 */
    }

    #wechat-refresh-btn {
        font-size: 12px;
        color: #044093 !important; /* 移动端也使用超链接蓝色 */
    }
    
    #wechat-refresh-btn:hover {
        color: #0056b3 !important; /* 移动端悬停也使用稍深的蓝色 */
        text-decoration: underline !important; /* 悬停时显示下划线 */
    }
}

/* ===========================
   动画效果
   =========================== */

/* 旋转动画（用于刷新图标） */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotating {
    animation: rotate 1s linear infinite;
}

/* 脉动动画（用于提示） */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* 滑入动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

/* ===========================
   提示信息样式
   =========================== */
.wechat-help-text {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-top: 15px;
    line-height: 1.6;
}

.wechat-help-text a {
    color: #044093;
    text-decoration: none;
}

.wechat-help-text a:hover {
    text-decoration: underline;
}

/* ===========================
   安全提示
   =========================== */
.wechat-security-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    padding: 10px;
    background: #f0f9ff;
    border-left: 3px solid #044093;
    border-radius: 4px;
}

.wechat-security-tip i {
    color: #044093;
    margin-right: 8px;
    font-size: 16px;
}

.wechat-security-tip span {
    font-size: 12px;
    color: #666;
}

/* ===========================
   暗黑模式支持（可选）
   =========================== */
@media (prefers-color-scheme: dark) {
    /* #wechat-login-container 样式已移除，使用默认样式 */

    .wechat-login-title,
    #wechat-status-text {
        color: #e0e0e0;
    }

    .wechat-login-subtitle,
    #wechat-tips,
    .wechat-help-text {
        color: #999;
    }

    #wechat-qrcode-container {
        background: #1f1f1f;
    }

    .wechat-qrcode-wrapper {
        background: #2b2b2b;
    }

    .wechat-actions {
        border-top-color: #444;
    }

    .login-mode-switch {
        border-top-color: #444;
    }

    .wechat-security-tip {
        background: #1a3a52;
        border-left-color: #4a90e2;
    }

    .wechat-security-tip span {
        color: #b0b0b0;
    }
}

