/* 禁止页面滚动 */
html, body {
    height: 100%;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-tap-highlight-color: transparent; /* 移除点击高亮 */
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    padding: 20px;
    transition: background 0.5s ease;
    touch-action: none; /* 阻止触摸事件 */
}

.container {
    width: 90%;
    max-width: 450px;
    max-height: 90vh; /* 限制最大高度 */
    overflow-y: auto; /* 允许容器内部滚动 */
    -webkit-overflow-scrolling: touch; /* 平滑滚动 */
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
    transition: all 0.3s ease;
}

/* 隐藏滚动条 */
.container::-webkit-scrollbar {
    display: none;
}

.logo {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-text {
    color: white;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.logo-highlight {
    color: #ffcc00;
    font-weight: 800;
}

.input-container {
    position: relative;
    margin-bottom: 30px;
}

input {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    color: #333;
}

input:focus {
    outline: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(37, 117, 252, 0.4);
    transform: translateY(-2px);
}

input::placeholder {
    color: #888;
}

.qrcode-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    min-height: 0;
    background: transparent;
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
}

.qrcode-container.active {
    min-height: 260px;
    padding: 15px;
    max-height: 300px;
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

#qrcode {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: transparent;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

#qrcode img {
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    background: transparent;
    padding: 0;
    max-width: 100%;
    height: auto;
    transition: all 0.3s ease;
}

#qrcode img:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.placeholder {
    display: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 18px;
    text-align: center;
    padding: 40px 20px;
}

.loading {
    display: none;
    color: white;
    margin-top: 20px;
    font-size: 17px;
}

.loading-dots:after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.error-message {
    display: none;
    color: #ff6b6b;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 14px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.library-check {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    margin-top: 10px;
}

.success {
    color: #51cf66;
    font-weight: 600;
}

.save-guide {
    display: none;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    background: rgba(0, 0, 0, 0.25);
    padding: 12px;
    border-radius: 10px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hint {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.5;
}

.footer {
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 20px;
        border-radius: 20px;
    }
    
    .logo-text {
        font-size: 24px;
    }
    
    input {
        padding: 14px 18px;
    }
    
    .qrcode-container.active {
        min-height: 220px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}