/* ZengWenFeng修改：移动端随机安全键盘（分类 Tab + 每类内随机，按键加大便于点击） */
.sk-input-wrap {
    position: relative;
}

.sk-input-wrap input {
    padding-right: 44px;
    box-sizing: border-box;
}

.grxx-bd .sk-input-wrap {
    margin-top: 10px;
}

.grxx-bd .sk-input-wrap input {
    margin-top: 0;
}

.sk-eye-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 5;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.sk-eye-btn::before {
    content: "";
    width: 22px;
    height: 22px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
}

.sk-eye-btn.sk-eye-off::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E");
}

.sk-eye-btn.sk-eye-on::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231278b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

#secureKeyboard {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    background: #e8e8ed;
    border-top: 1px solid #c7c7cc;
    padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
    display: none;
    z-index: 99999;
    touch-action: manipulation;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

/* ZengWenFeng：键盘区禁止横向撑出视口，按键必须换行 */
#secureKeyboard .sk-keys {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap !important;
    overflow-x: hidden;
}

/* ZengWenFeng：与 mobile 登录页 .tancqu（fixed 居中）配合——键盘打开时改为贴顶+限高+内部滚动，才能看到验证码 */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body.sk-keyboard-open {
    overflow-x: hidden;
}

/* 个人信息等全宽页：iOS 真机聚焦时锁定 body，避免页面被顶偏/挤到左侧 */
body.sk-keyboard-open.sk-scroll-host-mode {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    -webkit-transform: none !important;
    overflow: hidden !important;
}

/* 内联样式由 secure-keyboard.js 优先写入；此处不设 !important，避免覆盖 JS 精确计算 */
body.sk-keyboard-open .tancqu {
    top: auto;
    bottom: calc(var(--sk-kb-height, 300px) + 8px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    max-height: calc(100dvh - var(--sk-kb-height, 300px) - 16px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ZengWenFeng：键盘打开时压缩顶部 logo，多留出表单可视区域 */
body.sk-keyboard-open .tancqu .logo-img {
    position: relative !important;
    top: 0 !important;
    margin-bottom: 6px;
}

body.sk-keyboard-open .tancqu .logo-img img {
    max-height: 48px;
    width: auto;
}

/* ZengWenFeng：验证码行避免 60% + 浮动 超出白框导致右侧被裁掉 */
body.sk-keyboard-open .yzmk {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

body.sk-keyboard-open .yzmk input {
    width: auto !important;
    flex: 1 1 0;
    min-width: 0;
}

body.sk-keyboard-open .yzmk .fr {
    float: none !important;
    flex: 0 0 auto;
}

/* 个人信息等全宽页面：键盘打开时仅底部留白滚动，不做居中弹层定位 */
body.sk-keyboard-open .sk-kb-scroll-host,
body.sk-scroll-host-mode .sk-kb-scroll-host {
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    transform: none !important;
    -webkit-transform: none !important;
    overflow-x: hidden;
}

body.sk-keyboard-open .sk-kb-scroll-host .sk-input-wrap {
    width: 100%;
    box-sizing: border-box;
}

body.sk-keyboard-open .sk-kb-scroll-host .sk-input-wrap input {
    width: 100%;
    box-sizing: border-box;
}

/* 分类 Tab：数字 / 大写 / 小写 / 符号 */
.sk-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.sk-tab {
    flex: 1;
    padding: 10px 4px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #c7c7cc;
    border-radius: 8px;
    background: #fff;
    color: #333;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sk-tab:active {
    background: #f0f0f0;
}

.sk-tab.sk-tab-active {
    background: #007aff;
    border-color: #007aff;
    color: #fff;
}

/* 按键区：按分类换列数，数字少用大格；字母/符号自动换行 */
.sk-keys {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 100px;
}

.sk-keys-num .sk-key-char {
    flex: 0 0 calc(18% - 6px);
    max-width: 56px;
    height: 48px;
    font-size: 22px;
}

.sk-keys-upper .sk-key-char,
.sk-keys-lower .sk-key-char {
    flex: 0 0 calc(12.5% - 6px);
    min-width: 36px;
    height: 44px;
    font-size: 17px;
}

.sk-keys-sym .sk-key-char {
    flex: 0 0 calc(16.66% - 6px);
    min-width: 32px;
    height: 44px;
    font-size: 16px;
}

.sk-key-char {
    border: none;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    font-weight: 600;
    color: #1c1c1e;
    padding: 0 2px;
}

.sk-key-char:active {
    background: #d1d1d6;
    transform: scale(0.97);
}

.sk-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0;
}

.sk-fn-row .sk-fn {
    flex: 1;
    max-width: none;
}

.sk-fn {
    min-height: 46px;
    border: none;
    border-radius: 8px;
    background: #d1d1d6;
    font-size: 15px;
    font-weight: 600;
    color: #1c1c1e;
    padding: 0 12px;
}

.sk-fn:active {
    background: #b8b8bd;
}
