* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 20px;
    padding-bottom: 80px; /* 为备案号留出空间 */
}

/* PC端背景 */
@media screen and (min-width: 769px) {
    body {
        background-image: url('../../images/pc.jpg');
    }
}

/* 手机端背景 */
@media screen and (max-width: 768px) {
    body {
        background-image: url('../../images/phone.jpg');
    }
}

/* 白色窗口透明度70%，模糊效果降低一半 */
.container {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(5px); /* 原来是10px，降低一半 */
    -webkit-backdrop-filter: blur(5px);
}

.login-section,
.form-section {
    padding: 40px 30px;
}

h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
}

#qrcode-container {
    text-align: center;
    padding: 20px;
    max-width: 100%;
    box-sizing: border-box;
}

/* 二维码样式 */
#qrcode {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    overflow: hidden;
    position: relative;
}

#qrcode img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #fff;
    margin: auto;
}

/* 打开哔哩哔哩按钮 - 粉色主题 */
.bilibili-btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    margin-top: 20px;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8fa3 50%, #ffb6c1 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 手机端缩小按钮 */
@media screen and (max-width: 768px) {
    .bilibili-btn {
        padding: 10px 16px;
        font-size: 14px;
        margin-top: 12px;
    }
    
    .save-qrcode-btn {
        padding: 10px 16px;
        font-size: 13px;
        margin-top: 12px;
    }
}

/* 超小屏幕按钮优化 */
@media screen and (max-width: 360px) {
    .bilibili-btn,
    .save-qrcode-btn {
        padding: 8px 14px;
        font-size: 12px;
        border-radius: 16px;
    }
}

.bilibili-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.5);
    background: linear-gradient(135deg, #ff5a8f 0%, #ff7a9a 50%, #ffa5b8 100%);
}

.bilibili-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

/* 保存二维码按钮 - 蓝色主题 */
.save-qrcode-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    margin-top: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.save-qrcode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #5568d3 0%, #6a3f90 100%);
}

.save-qrcode-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

.required {
    color: #ff4757;
}

input[type="text"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fafafa;
}

input[type="text"]:focus,
input[type="tel"]:focus,
textarea:focus {
    outline: none;
    border-color: #3498db;
    background: #fff;
}

input[readonly] {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* ===== 备案号样式 ===== */
.footer-beian {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
}

.footer-beian a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    margin: 0 8px;
}

.footer-beian a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-beian .divider {
    color: rgba(255, 255, 255, 0.5);
}

/* 响应式优化 */
@media screen and (max-width: 480px) {
    body {
        padding-bottom: 100px; /* 小屏幕备案号更高 */
    }
    
    .login-section,
    .form-section {
        padding: 30px 20px;
    }

    h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    #qrcode {
        width: 160px;
        height: 160px;
        max-width: 70vw;
        max-height: 70vw;
    }
    
    #qrcode img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    /* 针对竖屏超小屏幕的额外优化 */
    @media screen and (max-width: 360px) and (orientation: portrait) {
        #qrcode {
            width: 140px;
            height: 140px;
            max-width: 65vw;
            max-height: 65vw;
        }
        
        .login-section {
            padding: 20px 15px;
        }
        
        #qrcode-container {
            padding: 15px 10px;
        }
    }
    
    /* 横屏移动端优化 */
    @media screen and (max-width: 768px) and (orientation: landscape) {
        #qrcode {
            width: 140px;
            height: 140px;
            max-width: 40vh;
            max-height: 40vh;
        }
    }
    
    .footer-beian {
        font-size: 10px;
        padding: 10px 5px;
    }
    
    .footer-beian a {
        margin: 0 4px;
    }
}

/* 防止图片被下载的CSS保护 */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

img {
    pointer-events: none;
    -webkit-user-drag: none;
}

/* ===== 左上角按钮容器 ===== */
.top-left-buttons {
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    right: auto !important;
    bottom: auto !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 15px !important;
    z-index: 9999 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 图标按钮基础样式 - 非悬停状态完全透明无装饰 */
.icon-btn {
    position: relative;
    width: 88px;
    height: 88px;
    background: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.icon-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    pointer-events: auto;
    -webkit-user-drag: auto;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* PC端悬停效果 */
@media screen and (min-width: 769px) {
    .icon-btn:hover {
        transform: scale(1.2);
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid #ff6b9d;
        box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.3), 0 8px 30px rgba(0, 0, 0, 0.2);
    }

    .icon-btn:hover img {
        transform: scale(1.1);
    }

    /* 悬停时显示提示框 - 带边框效果 */
    .icon-btn::after {
        content: attr(data-tooltip);
        position: absolute;
        top: 70px;
        left: 50%;
        transform: translateX(-50%) scale(0);
        background: rgba(0, 0, 0, 0.9);
        color: white;
        padding: 8px 16px;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        pointer-events: none;
        border: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .icon-btn:hover::after {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }

    /* 提示框小三角形 - 与边框一致 */
    .icon-btn::before {
        content: '';
        position: absolute;
        top: 64px;
        left: 50%;
        transform: translateX(-50%) scale(0);
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        border-bottom: 7px solid rgba(0, 0, 0, 0.9);
        opacity: 0;
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

    .icon-btn:hover::before {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

/* 手机端样式调整 */
@media screen and (max-width: 768px) {
    .top-left-buttons {
        top: 10px;
        left: 10px;
        gap: 8px;
    }

    .icon-btn {
        width: 72px;
        height: 72px;
        border-radius: 50%;
        border-width: 0;
    }
}

/* ===== 右上角退出登录按钮 ===== */
.top-right-logout {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 9999 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.logout-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 退出图标 - 箭头样式 */
.logout-btn svg {
    width: 26px;
    height: 26px;
}

.logout-btn svg path {
    stroke: #666666;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.logout-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.logout-btn:hover svg path {
    stroke: #333333;
}

.logout-btn:active {
    transform: translateY(0);
}

/* 手机端退出按钮调整 */
@media screen and (max-width: 768px) {
    .top-right-logout {
        top: 10px !important;
        right: 10px !important;
    }

    .logout-btn {
        width: 36px;
        height: 36px;
    }

    .logout-btn svg {
        width: 20px;
        height: 20px;
    }
}