﻿/* 登录 / 注册页 ------------------------------------------------------------
   只被 _AuthLayout 使用。不依赖 layui：按钮、输入框、卡片全部自己画，
   变量沿用 site.css 里的 --jt-*，所以换主色时这两页跟着变。 */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    /* box-sizing 必须是 border-box，否则 100vh + 上下内边距会多出一条滚动条 */
    box-sizing: border-box;
    min-height: 100vh;
    padding: 28px 18px;
    background:
        radial-gradient(1000px 520px at 12% -10%, #e8eeff 0%, rgba(232, 238, 255, 0) 60%),
        radial-gradient(820px 460px at 100% 0%, #eef7ff 0%, rgba(238, 247, 255, 0) 55%),
        var(--jt-bg, #f6f8fc);
}

.auth-wrap {
    width: 100%;
    max-width: 404px;
}

.auth-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--jt-ink-3, #6b7280);
}

.auth-home:hover {
    color: var(--jt-primary, #3366e5);
}

.auth-card {
    padding: 30px 28px 26px;
    border: 1px solid var(--jt-line, #e6eaf2);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px -34px rgba(21, 43, 96, .45);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--jt-ink, #161c2d);
}

.auth-title {
    margin: 0 0 4px;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--jt-ink, #161c2d);
}

.auth-sub {
    margin: 0 0 20px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--jt-ink-3, #6b7280);
}

.auth-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.auth-field > i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: var(--jt-ink-3, #6b7280);
    pointer-events: none;
}

.auth-field input {
    flex: 1 1 auto;
    width: 100%;
    height: 44px;
    padding: 0 12px 0 39px;
    border: 1px solid var(--jt-line, #e6eaf2);
    border-radius: 9px;
    background: #fff;
    font-size: 14px;
    color: var(--jt-ink, #161c2d);
    transition: border-color .16s, box-shadow .16s;
}

.auth-field input::placeholder {
    color: #a8b0c0;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--jt-primary, #3366e5);
    box-shadow: 0 0 0 3px rgba(59, 110, 246, .12);
}

.auth-field--code input {
    padding-right: 8px;
    /* 验证码只有大写字母和数字：统一显示成大写，用户一眼看得出自己输的是 B 还是 b。
       服务端比对已经忽略大小写，这里纯粹是让"看到的样子"和"实际判定"一致。
       字距拉开一点，4 个字符不会挤成一团看不清自己打了什么 */
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.auth-canvas {
    flex: 0 0 auto;
    /* 宽高比交给图片自己保持：验证码是服务端出的 PNG，
       写死宽高会在窄屏（下面的 media query 收窄）时被压扁 */
    width: auto;
    height: 44px;
    display: block;
    border: 1px solid var(--jt-line, #e6eaf2);
    border-radius: 9px;
    background: #f7f9fd;
    cursor: pointer;
}

.auth-canvas:hover {
    border-color: #c9d6f2;
}

.auth-err {
    min-height: 18px;
    margin: 2px 0 10px;
    font-size: 12.5px;
    line-height: 1.5;
    color: #c02b2b;
}

.auth-btn {
    display: block;
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 9px;
    background: var(--jt-primary, #3366e5);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .16s, transform .06s;
}

.auth-btn:hover {
    background: var(--jt-primary-dark, #2b57d0);
}

.auth-btn:active {
    transform: translateY(1px);
}

.auth-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.auth-alt {
    margin: 16px 0 0;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
    color: var(--jt-ink-3, #6b7280);
}

.auth-alt a {
    color: var(--jt-primary, #3366e5);
    font-weight: 500;
}

.auth-alt a:hover {
    text-decoration: underline;
}

.auth-note {
    margin: 14px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: #a8b0c0;
}

@media (max-width: 420px) {
    .auth-card {
        padding: 24px 18px 20px;
        border-radius: 14px;
    }

    /* 只收高度，宽度按比例跟着走，避免把验证码压变形 */
    .auth-canvas {
        height: 40px;
        width: auto;
    }
}

/* 字段之间的小字说明：昵称不必填真名、密码规则。
   margin-top 取负值吃掉 .auth-field 的下边距，否则和输入框离得太远 */
.auth-tip {
    margin: -6px 0 12px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--jt-ink-3, #6b7280);
}

/* 密码强度条。注意 [hidden] 必须显式 display:none，
   否则 flex 会盖掉浏览器对 hidden 属性的默认处理 */
.auth-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -2px 0 10px;
}

.auth-strength[hidden] {
    display: none;
}

.auth-strength__bar {
    flex: 1 1 auto;
    height: 4px;
    overflow: hidden;
    border-radius: 2px;
    background: #eef1f7;
}

.auth-strength__bar i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 2px;
    background: #d9534f;
    transition: width .18s ease, background .18s ease;
}

.auth-strength__text {
    flex: 0 0 auto;
    min-width: 26px;
    font-size: 12px;
    color: var(--jt-ink-3, #6b7280);
    text-align: right;
}

.auth-strength.is-weak .auth-strength__bar i {
    width: 33%;
    background: #d9534f;
}

.auth-strength.is-mid .auth-strength__bar i {
    width: 66%;
    background: #e0a93a;
}

.auth-strength.is-strong .auth-strength__bar i {
    width: 100%;
    background: #2f9e5e;
}

/* 成功 / 失败气泡。site.css 里有一份，但登录注册页只加载 base+icons+auth 三个文件，
   不复制过来的话 .jt-toast 只是个没有样式的 div——注册成功了用户也看不到任何反馈 */
.jt-toast {
    position: fixed;
    top: 22px;
    left: 50%;
    z-index: 9999;
    max-width: min(78vw, 420px);
    padding: 10px 18px;
    border-radius: 6px;
    background: rgba(28, 33, 46, .93);
    color: #fff;
    font-size: 13.5px;
    line-height: 1.5;
    text-align: center;
    transform: translate(-50%, -12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s, transform .18s;
}

.jt-toast.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}

.jt-toast--err {
    background: rgba(180, 38, 38, .95);
}

.jt-toast--ok {
    background: rgba(26, 127, 69, .95);
}

/* hidden 属性兜底：auth.css 里没有 site.css 那条全局规则 */
[hidden] {
    display: none !important;
}

/* <a> 当按钮用：.auth-btn 是给 <button> 写的，a 标签不会自动垂直居中文字 */
.auth-btn--link {
    box-sizing: border-box;
    line-height: 44px;
    text-align: center;
    text-decoration: none;
}

.auth-btn--link:hover {
    background: var(--jt-primary-dark, #2b57d0);
}

/* 找回密码提交成功后的「邮件已发出」面板 */
.auth-done {
    padding: 6px 0 4px;
    text-align: center;
}

.auth-done__icon {
    display: block;
    margin: 0 auto 14px;
    font-size: 36px;
    color: var(--jt-primary, #3366e5);
}

.auth-done__title {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--jt-ink, #161c2d);
}

.auth-done__text {
    margin: 0 0 22px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--jt-ink-3, #6b7280);
}

/* 底部「忘记密码 · 注册」中间那个分隔点 */
.auth-sep {
    margin: 0 8px;
    color: #c3c9d6;
}

/* 注册页的协议勾选。用 flex 让勾选框顶对齐——
   文案换行时勾选框不会漂到中间去 */
.auth-agree {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 2px 0 14px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--jt-ink-2, #4a5468);
}

.auth-agree input {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 2px 0 0;
    accent-color: var(--jt-primary, #3366e5);
    cursor: pointer;
}

.auth-agree label {
    cursor: pointer;
}

.auth-agree a {
    color: var(--jt-primary, #3366e5);
    text-decoration: none;
}

.auth-agree a:hover {
    text-decoration: underline;
}

/* ---------- 账号页（/Home/Account） ---------- */

.auth-meta {
    margin: 18px 0 22px;
    border-top: 1px solid var(--jt-line, #e6e9f0);
}

.auth-meta__row {
    display: flex;
    gap: 12px;
    align-items: baseline;
    margin: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--jt-line, #e6e9f0);
    font-size: 14px;
}

.auth-meta__k {
    flex: 0 0 84px;
    color: var(--jt-ink-3, #666e7d);
}

.auth-meta__v {
    flex: 1 1 auto;
    color: var(--jt-ink, #161c2d);
    word-break: break-all;
}

.auth-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.6;
}

.auth-badge--ok {
    background: #e8f6ec;
    color: #1e6b34;
}

.auth-badge--no {
    background: #fdf1e3;
    color: #8a5200;
}

.auth-tip {
    margin: 0 0 18px;
    color: var(--jt-ink-3, #666e7d);
    font-size: 13px;
    line-height: 1.7;
}
