* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 30px;
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.login-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qq {
    background-color: #12b7f5;
}

.qq:hover {
    background-color: #0e9ad0;
}

.wechat {
    background-color: #07c160;
}

.wechat:hover {
    background-color: #06a954;
}

.qrcode-container {
    margin-top: 20px;
}

.qrcode-container img {
    max-width: 200px;
    margin: 20px auto;
}

.qrcode-tip {
    margin: 15px 0;
    color: #666;
}

.back-btn {
    padding: 8px 15px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
}

.hidden {
    display: none;
}

/* 游戏选择表单样式 */
.selection-form {
    margin: 20px 0;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.select-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    font-size: 14px;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #45a049;
}

/* 卡密显示样式 */
.card-list {
    margin: 20px 0;
}

.card-item {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
    text-align: left;
}

.card-code {
    font-size: 16px;
    font-weight: bold;
    font-family: monospace;
    margin-bottom: 5px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    -ms-word-break: break-all;
    word-break: break-word;
}

.card-expire {
    font-size: 12px;
    color: #666;
}

/* 按钮间距 */
.back-btn + .back-btn {
    margin-left: 10px;
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.btn-group .submit-btn,
.btn-group .back-btn {
    flex: 1;
    margin: 0 5px;
}

/* 状态提示样式 */
.status-tip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.authenticating {
    color: #1aad19;
}

.status-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.authenticating .status-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #1aad19;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px;
}

/* 为iframe容器添加相对定位，以便状态提示可以正确定位 */
#qrcode-image > div {
    position: relative;
}

/* 游戏信息显示 */
.game-info {
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 12px;
    margin-bottom: 15px;
    text-align: left;
}

.game-info p {
    margin: 5px 0;
    color: #333;
}

.game-info strong {
    display: inline-block;
    width: 60px;
}

/* 搜索框样式 */
.search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    font-size: 14px;
    margin-bottom: 10px;
}

/* 区服选择列表样式 */
select[size] {
    height: auto;
    overflow-y: auto;
    max-height: 300px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

select[size] option {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
}

select[size] option:hover {
    background-color: #f5f5f5;
}

/* 确认框样式 */
.confirm-box {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.confirm-tip {
    margin: 20px 0;
    color: #555;
    font-size: 16px;
}

/* 无角色提示样式 */
.no-role-box {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    margin-top: 15px;
}

.no-role-box p {
    margin-bottom: 10px;
    color: #555;
}

.no-role-box ul {
    margin: 0 0 20px 20px;
    color: #666;
}

.no-role-box ul li {
    margin-bottom: 5px;
}

/* 错误消息样式 */
.error-message {
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fdf2f2;
    border-left: 4px solid #e74c3c;
    border-radius: 3px;
}

/* 成功消息样式 */
.success-message {
    color: #2ecc71;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #eafaf1;
    border-left: 4px solid #2ecc71;
    border-radius: 3px;
}

/* 通知消息样式 */
.notice-message {
    color: #3498db;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #ebf5fb;
    border-left: 4px solid #3498db;
    border-radius: 3px;
}

/* 充值说明样式 */
.recharge-note {
    font-size: 14px;
    color: #7f8c8d;
    margin: 10px 0 20px;
    padding: 8px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* Toast消息样式 */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    text-align: center;
    max-width: 80%;
}

.toast-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 触摸反馈样式 */
.touch-active {
    opacity: 0.7;
    transform: scale(0.98);
}

/* 重要提示样式 */
.important-notice {
    background-color: #ffebee;
    border: 2px solid #f44336;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.warning-title {
    color: #d32f2f;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.warning-message {
    color: #c62828;
    font-weight: bold;
    line-height: 1.5;
}

/* 响应式设计 - 移动端适配 */
@media screen and (max-width: 768px) {
    .container {
        width: 100%;
        max-width: 100%;
        padding: 15px;
    }
    
    .card {
        padding: 20px;
        border-radius: 8px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .login-btn {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    /* 增大移动设备上的点击区域 */
    .back-btn, .submit-btn {
        padding: 12px 15px;
        font-size: 16px;
        min-height: 44px; /* 确保足够的触摸区域 */
    }
    
    /* 相邻按钮之间的间距 */
    .back-btn + .back-btn {
        margin-left: 8px;
    }
    
    /* 表单元素更大更易点击 */
    .select-input, .search-input {
        font-size: 16px;
        padding: 12px;
        height: 44px;
    }
    
    /* 区服选择的高度调整 */
    select[size] {
        max-height: 250px;
    }
    
    select[size] option {
        padding: 12px;
    }
    
    /* 确保表单组的间距 */
    .form-group {
        margin-bottom: 20px;
    }
    
    /* 卡密显示样式调整 */
    .card-item {
        padding: 12px;
    }
    
    .card-code {
        font-size: 14px;
        word-break: break-all;
    }
    
    /* 移动端表单特别优化 */
    /* 提高表单元素的可点击性 */
    input, select, button {
        font-size: 16px !important; /* 防止iOS缩放 */
    }
    
    /* 增强可见性 */
    .card-code {
        font-size: 15px;
        background-color: #f0f0f0;
        padding: 10px;
        border-radius: 4px;
        border-left: 3px solid #4CAF50;
    }
    
    /* 优化区服搜索体验 */
    .search-input {
        margin-bottom: 15px;
        border: 1px solid #ccc;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    /* 改进表单布局 */
    .form-group label {
        margin-bottom: 8px;
        font-size: 15px;
    }
}

/* 触摸优化 */
@media (hover: none) {
    /* 去除悬停效果，改为触摸时的反馈 */
    .login-btn:active, .submit-btn:active, .back-btn:active {
        opacity: 0.8;
        transform: scale(0.98);
    }
    
    /* 增强触摸反馈 */
    .select-input:focus, .search-input:focus {
        border-color: #4CAF50;
        box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
    }
}

/* 移动端按钮布局优化 */
@media screen and (max-width: 480px) {
    /* 小屏幕上按钮改为垂直堆叠 */
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .back-btn + .back-btn {
        margin-left: 0;
        margin-top: 10px;
    }
}
