/* CSS Document
 * 新版登录页专用样式（login.html / en/login.html）
 * 适用于：login.html / en/login.html（登录）、verify.html / en/verify.html（谷歌验证码 2FA）
 *
 * 说明：
 *   1. 本文件与旧版 basic.css / basic-en.css 完全隔离，登录页不再引用那两个文件
 *   2. 顶部「公共基础」部分是从 basic.css / basic-en.css 中挑出登录页真正依赖的规则
 *      （弹窗、Toast、Loading、语言下拉、通用按钮、表单校验错误等），
 *      用户中心 / 隐私条款 / 忘记密码等与登录页无关的样式未搬入，仍由 basic.css 负责
 *   3. 中英文差异统一用 html[lang] 区分，无需再单独维护 basic-en.css
 */

/* ===== 公共基础 ===== */
body, h1, h2, h3, h4, h5, h6, p, dl, dt, dd, ul, ol, li, fieldset, button, input, textarea, th, td { margin: 0; padding: 0; }
body { font: 12px/1.8 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; color: #333; text-align: center; }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active { -webkit-transition-delay: 99999s; -webkit-transition: color 99999s ease-out, background-color 99999s ease-out; }
ul, ol, li { list-style: none; }
a { text-decoration: none; color: #666; }
a:hover { text-decoration: none; color: #333; }
fieldset, img { border: none; }
button, input, select, textarea { font-size: 100%; }
table { border-collapse: collapse; border-spacing: 0; }
h1, h2, h3 { font-size: 15px; }
em { font-style: normal; }
input[type="text"], input[type="password"], input[type="button"], input[type="submit"], input[type="reset"], input[type="number"], button, select { -webkit-appearance: none; }
select:focus, input:focus { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-user-modify: read-write-plaintext-only; outline: none; }
.clearfix { zoom: 1; }
.clearfix:after { display: block; clear: both; height: 0; content: "\0020"; }
html, body { width: 100%; height: 100%; }

.input-button { cursor: pointer; display: inline-block; border: none; background-color: #e8363f; padding: 8px 15px; border-radius: 2px; color: #fff; font-size: 14px; }
.error { color: #e8363f; }

/*--loading--*/
.loading-box { display: none; position: fixed; z-index: 89; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); }
.loading-con { position: absolute; z-index: 99; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); left: 50%; top: 50%; margin: -100px 0 0 -40px; display: inline-block; border-radius: 4px; width: 90px; height: 90px; background: #fff; }
.loading-con i { display: block; margin: 5px auto 0 auto; border-radius: 4px; width: 60px; height: 60px; background: #fff url("../images/loading.gif") no-repeat center center; background-size: 60% auto; }
.loading-con p { margin-top: -10px; color: #666; }

/*--language-box--*/
/* 位置与 .login-main-top 内的语言按钮贴合：按钮 28px 高、容器 64px、右侧留白 20px，故按钮底边在 46px */
.language-box { display: none; z-index: 999999; position: fixed; right: 23px; top: 51px; padding: 5px 0; background-color: #fff; border-radius: 2px; box-shadow: 0 1px 3px 0 rgba(10, 16, 34, .1); }
.language-box li a { display: block; padding: 3px 13px; }
.language-box li a:hover { background-color: #ddd; }
.language-box i { display: inline-block; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 8px solid #fff; position: absolute; left: 15px; top: -5px; }

/*--toast--*/
.t-box { display: none; }
.t-box::after { display: block; content: ''; position: fixed; left: 0; top: 0; z-index: 998; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5) }
.t-con { box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); border-radius: 4px; padding: 50px 0; z-index: 999; background-color: #fff; width: 400px; position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); -moz-transform: translate(-50%, -50%); -webkit-transform: translate(-50%, -50%); -o-transform: translate(-50%, -50%); }
.t-con .btn-close { right: 10px; top: 10px; position: absolute; display: inline-block; width: 30px; height: 30px; background: url("../images/icon-x.png") no-repeat center center; background-size: 40% auto; }
.t-con h3.tit { margin-bottom: 10px; }
.t-con .icon-success { display: inline-block; width: 50px; height: 50px; background: #ff3f3f url("../images/icon-ok.png") no-repeat center center; background-size: 80% auto; border-radius: 100%; }
.t-con .icon-fail { display: inline-block; width: 36px; height: 36px; background: #ff3f3f url("../images/icon-err.png") no-repeat center center; background-size: 80% auto; border-radius: 100%; }
.t-con .result-tips { font-weight: normal; margin: 5px 0; font-size: 14px; }
.t-con .button-li { text-align: center; }
.toast .btn-msg-close { right: 15px; top: 15px; position: absolute; display: inline-block; width: 30px; height: 30px; background: url("../images/icon-x.png") no-repeat center center; background-size: 40% auto; }

/*--web3 弹窗--*/
.dialog-style { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: #000000b3; z-index: 9; }
.dialog-web3-box { width: 440px; padding: 30px 30px 25px 30px; background-color: #fff; position: absolute; top: 50%; left: 50%; margin: -240px 0 0 -250px; border-radius: 4px }
.dialog-web3-box .title { font-size: 20px; font-weight: bold; margin-bottom: 20px; padding: 0 20px; }
.dialog-web3-box .content { font-size: 13px; color: #333; }
.dialog-web3-box .retry { display: inline-block; border: 1px solid #ddd; background-color: #f8f8f8; padding: 2px 10px; border-radius: 4px; margin-top: 10px; cursor: pointer; }
.dialog-web3-box .content label.icon-email { display: inline-block; width: 20px; height: 20px; background: url(../images/icon-login-email.png) no-repeat left center; background-size: 100%; position: relative; top: 5px; }
.dialog-web3-box .content label.icon-vcode { display: inline-block; width: 20px; height: 20px; background: url(../images/icon-login-code.png) no-repeat left center; background-size: 100%; position: relative; top: 5px; }
.dialog-web3-box .content .input-style { margin-left: 10px; font-size: 13px; height: 100%; background: none; border: none; width: 340px; }
.dialog-web3-box .content .input-box { width: 400px; border-bottom: 1px solid #eee; padding: 10px 0; margin: 0 auto; margin-bottom: 15px; }
.dialog-web3-box .content .input-box .send-vcode { display: inline-block; color: #e8363f; font-size: 13px; position: absolute; right: 60px; margin-top: 4px; cursor: pointer; }
.dialog-web3-box .content .reminder { margin-bottom: 15px; }
.dialog-web3-box .content .register-btn-style { display: inline-block; color: #666666; font-size: 14px; margin-top: 20px; border-bottom: 1px solid #ddd; cursor: pointer; }
.dialog-web3-box .content .btn-line-box { margin: 20px 0 15px 0; padding-bottom: 20px; border-bottom: 1px dotted #ddd; }
.dialog-web3-box .content .button-box input { cursor: pointer; border: none; background: #e8363f; color: #fff; padding: 10px 25px; border-radius: 2px; font-size: 15px; }
.dialog-web3-box .content .bind-tips { text-align: left; color: #999; }
.dialog-web3-box .content .bind-tips .bind-exist { display: inline-block; font-size: 14px; color: #e8363f; border-bottom: 1px solid #e8363f; margin-left: 40px; cursor: pointer; }
.dialog-web3-box .btn-close { right: 15px; top: 15px; position: absolute; display: inline-block; width: 30px; height: 30px; background: url(../images/icon-x.png) no-repeat center center; background-size: 40% auto; }

/*--英文版弹窗尺寸（原 basic-en.css）--*/
html[lang="en"] .dialog-web3-box { width: 455px; margin: -240px 0 0 -257px; }
html[lang="en"] .dialog-web3-box .content .bind-tips { word-break: break-word; }
html[lang="en"] .dialog-web3-box .content .bind-tips .bind-exist { margin-left: 0; }

/* ===== 新版登录页 ===== */
/* ===== 基础布局 ===== */
.login-page, .login-page * { box-sizing: border-box; }
.login-page { display: flex; width: 100%; min-height: 100vh; text-align: left; background: #fafafa; color: #1f2329; }
.login-page button,
.login-page input,
.login-page select,
.login-page textarea { font-family: inherit; }
.login-page a { color: inherit; }

/* ===== 左侧品牌区（背景图沿用原有素材） ===== */
.login-visual { position: relative; flex: 0 0 50%; max-width: 50%; min-height: 100vh; background: #14171a url("https://cdn.slowmist.com/assets/images/bg.jpg") no-repeat center center; background-size: cover; overflow: hidden; }
.login-visual-logo { position: absolute; left: clamp(20px, 2.2vw, 32px); top: clamp(10px, 2vw, 10px); z-index: 2; display: block; }
.login-visual-logo img { display: block; width: clamp(110px, 10vw, 150px); }
.login-visual-slogan { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: 2; padding: 0 clamp(24px, 4.8vw, 72px); }
.login-visual-slogan h1 { margin: 0; color: #fff; font-size: clamp(26px, 3.7vw, 52px); font-weight: 700; line-height: 1.22; letter-spacing: .5px; text-transform: uppercase; }
.login-visual-slogan p { margin-top: clamp(14px, 1.8vw, 22px); color: rgba(255, 255, 255, .72); font-size: 13px; line-height: 1.6; }
.login-visual-copyright { position: absolute; left: clamp(24px, 2.2vw, 72px); bottom: clamp(18px, 2.4vw, 28px); z-index: 2; margin: 0; color: rgba(255, 255, 255, .45); font-size: 12px; }

/* ===== 右侧登录区 ===== */
.login-main { position: relative; flex: 1 1 50%; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 76px 24px 44px; background: #fafafa; }
.login-main-top { position: absolute; left: 0; right: 0; top: 0; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.login-scope { display: flex; align-items: center; margin: 0; color: #8a9099; font-size: 12px; }
.login-scope i { flex: none; width: 5px; height: 5px; margin-right: 8px; border-radius: 50%; background: #e8363f; }
/* margin-left:auto 让语言按钮始终靠右，与该行有几个元素无关（无 service 提示时也不会跑到左边） */
.login-main-top .language { position: static; margin-left: auto; }
.login-main-top .language a { display: block; padding: 0 10px; height: 28px; line-height: 26px; color: #1f2329; font-size: 13px; background: #fff; border: 1px solid #dcdfe3; border-radius: 4px; }
.login-main-top .language a:hover { color: #1f2329; border-color: #c6cad0; }
.login-main-top .language a i { display: inline-block; width: 6px; height: 4px; margin-left: 4px; position: relative; top: -2px; background: url("../images/icon-language-more2.png") no-repeat 0 0; background-size: 100% auto; }

.login-card { width: 100%; max-width: clamp(340px, 31vw, 400px); }

/* 品牌 Logo */
.login-brand { display: flex; justify-content: center; margin-bottom: 22px; }
.login-brand .icon-login { width: 100%; max-width: 190px; }
.login-brand .icon-login img { display: block; width: 100%; }

/* Tab */
.login-tabs { display: flex; padding: 4px; background: #f0f1f2; border-radius: 8px; }
.login-tab { flex: 1 1 0; min-width: 0; height: 34px; padding: 0 4px; border: 0; border-radius: 6px; background: transparent; color: #8a9099; font-size: 14px; line-height: 34px; white-space: nowrap; cursor: pointer; transition: all .2s ease; }
.login-tab:hover { color: #4a5058; }
.login-tab.is-active { background: #fff; color: #1f2329; font-weight: 600; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }

/* 错误提示 */
.login-alert .err-box { margin-top: 14px; padding: 8px 12px; border: 1px solid #fbd0d3; border-radius: 6px; background: #fef4f4; color: #e8363f; font-size: 12px; line-height: 1.5; text-align: left; word-break: break-word; }
.login-alert .err-box a { color: #e8363f; text-decoration: underline; }

/* ===== 表单 ===== */
.login-pane { display: none; }
.login-pane.is-active { display: block; }
.form-login { margin: 0; }

.login-field { display: flex; flex-wrap: nowrap; align-items: center; min-height: 44px; margin-top: 12px; padding: 0 14px; background: #fff; border: 1px solid #e8eaed; border-radius: 8px; transition: border-color .2s ease, box-shadow .2s ease; }
.login-field:focus-within { border-color: #e8363f; box-shadow: 0 0 0 3px rgba(232, 54, 63, .08); }
.login-field-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 10px; color: #b3b8bf; }
.login-field-icon svg { display: block; width: 18px; height: 18px; }
.login-field .input-text { flex: 1 1 auto; min-width: 0; height: 42px; padding: 0; border: 0; background: transparent; color: #1f2329; font-size: 14px; }
.login-field .input-text::placeholder { color: #b3b8bf; }
.login-pane .error { display: block; padding-left: 2px; color: #e8363f; font-size: 12px; line-height: 1.4; text-align: left; }
.login-pane #username-error, .login-pane #password-error { margin-top: 5px; }

.login-row-extra { display: flex; justify-content: flex-end; margin-top: 10px; }
.login-link { color: #8a9099; font-size: 13px; }
.login-link:hover { color: #e8363f; text-decoration: underline; }

/* 主按钮 */
.login-btn-primary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; margin-top: 14px; padding: 0; border: 0; border-radius: 8px; background: #e8363f; color: #fff; font-size: 15px; font-weight: 500; cursor: pointer; transition: background .2s ease; }
.login-btn-primary:hover { background: #d92a33; }
.login-btn-primary.is-disabled { opacity: .6; cursor: not-allowed; }
.login-btn-primary:disabled { background: #8d7d7f; cursor: not-allowed; }
.login-btn-primary:disabled .login-btn-arrow { transform: none; }
.login-btn-primary[hidden] { display: none; }
.login-btn-arrow { flex: none; width: 14px; height: 14px; transition: transform .2s ease; }
.login-btn-primary:hover .login-btn-arrow { transform: translateX(3px); }

/* 验证码第二步：输入邮箱验证码（同页内切换，不跳转） */
/* 注意：隐藏规则限定在 .login-card 内，避免影响同用本文件的 2FA 页（verify.html） */
.login-card .login-back,
.login-card .login-code-title,
.login-card .login-otp,
.login-card .login-otp-tips,
.login-card .login-signup-tip,
.login-card .js-code-submit { display: none; }
.login-card.is-code-step .login-brand,
.login-card.is-code-step .login-tabs,
.login-card.is-code-step .login-field-email,
.login-card.is-code-step .js-send-code { display: none; }
.login-card.is-code-step .login-back { display: inline-flex; }
.login-card.is-code-step .login-code-title { display: block; }
.login-card.is-code-step .login-otp { display: block; }
.login-card.is-code-step .login-otp-tips { display: flex; }
.login-card.is-code-step .login-signup-tip { display: block; }
.login-card.is-code-step .js-code-submit { display: flex; }

.login-back { align-items: center; gap: 6px; margin-bottom: 34px; color: #1f2329; font-size: 14px; cursor: pointer; }
.login-back svg { display: block; width: 15px; height: 15px; }
.login-back:hover { color: #e8363f; }
.login-code-title { margin: 0 0 20px; color: #1f2329; font-size: 24px; font-weight: 600; line-height: 1.3; }

.login-otp { position: relative; }
.login-otp-box { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.login-otp-cell { display: flex; align-items: center; justify-content: center; height: 58px; background: #fff; border: 1px solid #e8eaed; border-radius: 8px; color: #1f2329; font-size: 22px; font-weight: 600; transition: border-color .2s ease, box-shadow .2s ease; }
.login-otp-cell.is-filled { border-color: #d5d8dd; }
.login-otp-cell.is-active { border-color: #e8363f; box-shadow: 0 0 0 3px rgba(232, 54, 63, .08); }
.login-otp .input-text { position: absolute; left: 0; top: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; color: transparent; opacity: 0; }
.login-otp .input-text::selection { background: transparent; }
.login-otp .error { position: static; margin: 8px 0 0; color: #e8363f; font-size: 12px; line-height: 1.4; text-align: left; }

.login-otp-tips { align-items: center; justify-content: space-between; margin-top: 16px; font-size: 13px; }
.login-otp-tips .tips-text { color: #8a9099; }
.login-resend { color: #e8363f; cursor: pointer; }
.login-resend.is-disabled { color: #b3b8bf; cursor: default; }
.login-signup-tip { margin: 14px 0 0; color: #8a9099; font-size: 13px; text-align: center; }

/* 分割线 */
.login-divider { display: flex; align-items: center; margin: 22px 0 12px; color: #8a9099; font-size: 13px; }
.login-divider::before,
.login-divider::after { content: ""; flex: 1 1 auto; height: 1px; background: #e6e8eb; }
.login-divider span { flex: none; padding: 0 12px; }

/* Web3 登录 / 第三方登录：左侧圆形图标 + 右侧文字 */
.login-web3 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 12px; justify-items: start; }
.login-social { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 12px; justify-items: start; }
.login-outline-btn,
.login-social-btn { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 0; border: 0; background: transparent; color: #1f2329; font-size: 13px; line-height: 1.4; white-space: nowrap; cursor: pointer; }
.login-outline-btn .icon-metemask,
.login-outline-btn .icon-connect,
.login-social-btn img { flex: none; display: inline-block; width: 34px; height: 34px; border-radius: 100%; background-color: #fff; box-shadow: 0 1px 5px -2px rgba(2, 2, 2, .2); }
.login-outline-btn .icon-metemask,
.login-outline-btn .icon-connect { background-image: url("../images/web3-login-logo.png"); background-repeat: no-repeat; background-size: 26px; }
.login-outline-btn .icon-metemask { background-position: 4px 4px; }
.login-outline-btn .icon-connect { background-position: 4px -23px; }
.login-social-btn img { object-fit: contain; }

/* 隐私条款 */
.login-privacy { margin: 30px 0 0; color: #8a9099; font-size: 12px; text-align: center; }
.login-privacy a { color: #1f2329; }
.login-privacy a:hover { color: #e8363f; text-decoration: underline; }

/* ===== 响应式 ===== */
@media screen and (max-width: 900px) {
    .login-page { flex-direction: column; }

    /* 顶部品牌区：加高以容纳三行标语 */
    .login-visual { flex: none; max-width: 100%; min-height: 0; height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 20px; }
    .login-visual-logo { left: 16px; top: 14px; }
    .login-visual-logo img { width: clamp(104px, 27vw, 140px); }
    .login-visual-slogan { position: static; transform: none; padding: 0; text-align: center; }
    .login-visual-slogan h1 { font-size: clamp(20px, 5.4vw, 30px); line-height: 1.35; }
    .login-visual-slogan p { margin-top: 10px; font-size: clamp(10px, 2.7vw, 13px); }
    .login-visual-copyright { display: none; }

    /* 表单区：上移内容，减少上下留白 */
    .login-main { min-height: 0; padding: 52px 20px 28px; justify-content: flex-start; }
    .login-main-top { height: 48px; padding: 0 18px; }
    /* 手机端隐藏「正在登录 xx」提示，顶部只保留语言切换 */
    .login-scope { display: none; }
    .login-main-top .language { position: fixed; right: 14px; top: 14px; margin-left: 0; z-index: 999; }
    .login-main-top .language a { color: #fff; border-color: rgba(255, 255, 255, .7); background: rgba(0, 0, 0, 0); }
    .login-main-top .language a:hover { color: #fff; border-color: #fff; }
    .login-main-top .language a i { background-image: url("../images/icon-language-more.png"); }
    .language-box { top: 50px; right: 18px; }
    .login-brand { margin-bottom: 18px; }

    /* 窄屏下 Tab 文案（英文较长）自动缩字号，保持单行不折行 */
    .login-tab { padding: 0 2px; font-size: clamp(11px, 3.4vw, 14px); }
}

@media screen and (max-width: 480px) {
    .login-visual { height: 224px; }
    .login-card { max-width: 100%; margin-top: 10px; }
    .login-main-top { height: 44px; }
    .login-main { padding: 45px 35px 20px; }
    .login-social { grid-template-columns: repeat(2, 1fr); }
    .login-visual-slogan { padding-top: 35px; }
    .login-visual-slogan p { font-size: 10px; }

    /* 公共组件随窄屏收缩 */
    html[lang="zh-CN"] .dialog-web3-box,
    html[lang="en"] .dialog-web3-box { width: 330px; margin: -156px 0 0 -195px; }
    .dialog-web3-box .content .bind-tips .bind-exist { margin-left: 0; }
    .toast .t-con { width: 80%; }
    .toast .t-con { padding: 50px 20px; }
}

/* ===== 2FA 页（verify.html / en/verify.html）=====
   与登录页共用同一套布局，仅多一条说明文案 */
.login-code-desc { margin: 0 0 28px; color: #8a9099; font-size: 13px; line-height: 1.6; word-break: break-word; }

/* 结果提示页（邮件已发送 / 操作成功 / 链接失效） */
.login-result-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 52px; height: 52px; margin: 0 0 22px; border-radius: 100%; background: #e8363f; }
.login-result-icon svg { width: 26px; height: 26px; }
