/* 重置默认样式，防止页面自带边距导致居中偏移 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* 默认的浅色模式背景 */
    background-color: #ededed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* 添加过渡效果，让切换更平滑 */
    transition: background-color 0.3s ease;
}

/* 核心：二维码容器 */
.qrcode-wrapper {
    /* 宽度设为屏幕宽度的 85%，留出舒适的边距 */
    width: 85vw;
    /* 限制最大宽度，防止在大屏手机或平板上过大 */
    max-width: 350px;
    
    /* 增加一点阴影，让二维码像卡片一样浮起来，体验更好 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: white;
    padding: 10px; /* 给图片加一点白边，防止贴边难识别 */
    border-radius: 8px; /* 圆角，更美观 */
    /* 添加过渡效果 */
    transition: all 0.3s ease;
}

/* 核心：图片本身 */
.qrcode-img {
    /* 宽度 100%，让图片填满容器，高度自动按比例计算 */
    width: 100%;
    height: auto;
    
    /* 确保图片显示清晰 */
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* 文字部分 */
.title {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
    font-weight: bold;
    text-align: center;
    /* 添加过渡效果 */
    transition: color 0.3s ease;
}

.footer-tip {
    margin-top: 20px;
    font-size: 14px;
    color: #888;
    text-align: center;
    /* 添加过渡效果 */
    transition: color 0.3s ease;
}

/* ========== 深色模式样式 ========== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a; /* 深色背景 */
    }
    
    .qrcode-wrapper {
        background: #2d2d2d; /* 深色容器背景 */
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* 更深的阴影 */
    }
    
    /* 添加深色边框 */
    .qrcode-img {
        border: 1px solid #444; /* 添加深色边框 */
    }
    
    .title {
        color: #f0f0f0; /* 浅色文字 */
    }
    
    .footer-tip {
        color: #aaa; /* 稍暗的辅助色 */
    }
}