/* ======================================================================
 *  认证页样式（auth.css）v8 — 参考 logamee.com 登录页
 *  极简：白底无装饰 / 小圆角(5-6px) / 实色深蓝主色 / 大柔和投影
 * ====================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2D2D2D;
    background: #ffffff;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

/* ===== 整体布局 ===== */
.auth-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.auth-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.auth-scroll {
    flex: 1;
    overflow-y: auto;
}

.auth-container {
    width: 100%;
    padding: 0 16px;
}

.auth-row {
    display: flex;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 64px 0 40px;
    position: relative;
}

/* ===== 顶部栏：语言 + 主题切换（右上角，透明不压背景） ===== */
.auth-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 24px;
    z-index: 10;
    background: transparent;
}
.auth-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.auth-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 400;
    color: #666666;
    background: #ffffff;
    border: 1px solid #E5E5E5;
    border-radius: 9999px;
    transition: all 0.2s;
    cursor: pointer;
}
.auth-lang-btn:hover {
    background: #f8fafc;
    border-color: #D4D4D4;
    color: #333333;
}
.auth-lang-btn svg { width: 14px; height: 14px; }

/* ===== Logo + 欢迎语（卡片顶部，居中） ===== */
.auth-brand {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    color: #0f172a;
    transition: opacity 0.2s;
}
.auth-brand:hover { opacity: 0.85; }

.auth-brand-logo {
    width: 55px;
    height: 55px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1D3663;
}
.auth-brand-logo img {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
}
.auth-brand-name {
    font-family: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    color: #666666;
    letter-spacing: 0.04em;
}

/* ===== 卡片：400px 宽 / 小圆角 / 大柔和投影 ===== */
.auth-card-wrap {
    width: 100%;
    max-width: 400px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}
.auth-card {
    width: 100%;
    background: #ffffff;
    padding: 56px 56px 40px;
    border-radius: 6px;
    border: 1px solid #E9E9EC;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: cardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== 右侧装饰区：竖排口号 + 红色印章（仅桌面端显示） ===== */
.auth-aside {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 16px 0;
    margin-left: 48px;
    pointer-events: none;
}
.auth-aside-slogan {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-family: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.35em;
    color: #0f172a;
    line-height: 1.4;
    white-space: nowrap;
    margin-left: 150px;
}
.auth-aside-stamp-mark {
    writing-mode: vertical-rl;


    font-size: 16px;
    font-weight: 700;
    color: rgba(185, 28, 28, 0.9);

    white-space: nowrap;
    padding: 10px 5px;

    margin-left: 75px;
}

/* ===== 卡片头部 ===== */
.auth-card-head {
    text-align: center;
    margin-bottom: 24px;
}
.auth-card-head h1 {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 0;
    color: #0f172a;
    letter-spacing: 0.02em;
}

/* ===== 表单 ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.auth-label {
    font-size: 13.6px;
    font-weight: 500;
    color: #2D2D2D;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.auth-label-link {
    font-size: 12px;
    font-weight: 400;
    color: #264783;
}
.auth-label-link:hover { text-decoration: underline; }

.auth-input {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #D6D9DF;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input::placeholder { color: #94a3b8; font-size: 14px; }
.auth-input:hover { border-color: #CBD5E1; }
.auth-input:focus {
    border-color: #264783;
    box-shadow: 0 0 0 1px #264783;
}
.auth-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px #ef4444;
}

/* 密码框 */
.auth-pwd-wrap { position: relative; }
.auth-pwd-wrap .auth-input { padding-right: 40px; }
.auth-pwd-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    border-radius: 5px;
    display: grid;
    place-items: center;
    color: #666666;
    transition: all 0.15s;
}
.auth-pwd-toggle:hover {
    background: #f1f5f9;
    color: #333333;
}
.auth-pwd-toggle svg { width: 18px; height: 18px; }

/* 验证码按钮 */
.auth-code-row {
    display: flex;
    gap: 12px;
}
.auth-code-row .auth-input { flex: 1; }
.auth-code-btn {
    flex-shrink: 0;
    height: 46px;
    min-width: 120px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    color: #1D3663;
    background: #ffffff;
    border: 1px solid #1D3663;
    border-radius: 5px;
    transition: all 0.15s;
}
.auth-code-btn:hover:not(:disabled) {
    background: #1D3663;
    color: #ffffff;
}
.auth-code-btn:disabled {
    color: #94a3b8;
    background: #f8fafc;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

/* 图形验证码 */
.auth-captcha-row {
    display: flex;
    gap: 12px;
}
.auth-captcha-row .auth-input { flex: 1; }
.auth-captcha-img {
    flex-shrink: 0;
    width: 120px;
    height: 46px;
    border: 1px solid #D6D9DF;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s;
}
.auth-captcha-img:hover { border-color: #264783; }

/* Checkbox */
.auth-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    cursor: pointer;
    padding-top: 4px;
}
.auth-check input[type=checkbox] {
    margin-top: 3px;
    width: 14px;
    height: 14px;
    accent-color: #1D3663;
    cursor: pointer;
    flex-shrink: 0;
}
.auth-check a { color: #264783; }
.auth-check a:hover { text-decoration: underline; }

/* Submit：实色深蓝，无渐变 */
.auth-submit {
    height: 44px;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    background: #1D3663;
    border-radius: 5px;
    transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}
.auth-submit:hover:not(:disabled) { background: #264783; }
.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.auth-submit svg {
    width: 16px;
    height: 16px;
    transition: transform 0.15s;
}
.auth-submit:hover svg { transform: translateX(2px); }

/* 字段错误 */
.auth-field-err {
    font-size: 12px;
    color: #ef4444;
    min-height: 0;
}
.auth-field-err:not(:empty) { margin-top: 2px; }

/* ===== 卡片底部 ===== */
.auth-card-foot {
    margin-top: 28px;
    padding-top: 0;
    text-align: center;
    font-size: 12px;
    color: #666666;
}
.auth-card-foot a {
    color: #264783;
    font-weight: 500;
    margin-left: 4px;
}
.auth-card-foot a:hover { text-decoration: underline; }

/* 其他登录方式 */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0 16px;
    font-size: 12px;
    color: #666666;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E5E5E5;
}
.auth-social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 0;
}
.auth-social-item {
    width: 41px;
    height: 41px;
    border-radius: 9999px;
    background: rgba(7, 193, 96, 0.1);
    border: 1px solid rgba(7, 193, 96, 0.2);
    display: grid;
    place-items: center;
    transition: all 0.15s;
}
.auth-social-item:hover {
    border-color: #07C160;
    background: rgba(7, 193, 96, 0.15);
}
.auth-social-item svg {
    width: 24px;
    height: 24px;
}
.auth-social-desc {
    text-align: center;
    font-size: 12px;
    color: #666666;
    margin: 16px 0 24px;
}

/* ===== 步骤条 ===== */
.auth-steps {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}
.auth-step {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
.auth-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}
.auth-step.is-active { color: #1D3663; }
.auth-step.is-active .auth-step-num {
    background: #1D3663;
    color: #fff;
}
.auth-step.is-done { color: #1D3663; }
.auth-step.is-done .auth-step-num {
    background: #1D3663;
    color: #fff;
}
.auth-step-name { white-space: nowrap; }
.auth-step-line {
    width: 32px;
    height: 2px;
    background: #e2e8f0;
    margin: 0 6px;
    transition: background 0.2s;
}

/* 步骤面板 */
.auth-step-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
    animation: fadeInUp 0.3s ease;
}
.auth-step-panel.is-active { display: flex; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-step-actions {
    display: flex;
    gap: 10px;
}
.auth-step-actions .auth-submit { flex: 1; }
.auth-step-back {
    width: 44px;
    height: 46px;
    border-radius: 5px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    display: grid;
    place-items: center;
    transition: all 0.15s;
}
.auth-step-back:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.auth-step-back svg { width: 18px; height: 18px; }

/* 邮箱预览 */
.auth-mail-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f0f4ff;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    font-size: 14px;
    color: #334155;
}
.auth-mail-preview-icon {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: #1D3663;
    color: #fff;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.auth-mail-preview-icon svg { width: 14px; height: 14px; }
.auth-mail-preview-text { flex: 1; word-break: break-all; color: #0f172a; }
.auth-mail-preview-edit {
    font-size: 13px;
    color: #1D3663;
    font-weight: 500;
    cursor: pointer;
}
.auth-mail-preview-edit:hover { text-decoration: underline; }

/* 成功页 */
.auth-success {
    text-align: center;
    padding: 12px 0;
}
.auth-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-success-icon svg { width: 32px; height: 32px; }
@keyframes successPop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}
.auth-success h2 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}
.auth-success p {
    font-size: 14px;
    color: #64748b;
}

/* ===== Toast ===== */
.auth-toast-wrap {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}
.auth-toast {
    min-width: 280px;
    max-width: 360px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #1D3663;
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    font-size: 14px;
    color: #334155;
    display: flex;
    gap: 10px;
    pointer-events: auto;
    animation: toastIn 0.2s ease;
}
.auth-toast.is-success { border-left-color: #16a34a; }
.auth-toast.is-error   { border-left-color: #ef4444; }
.auth-toast.is-info    { border-left-color: #1D3663; }
.auth-toast-icon { flex-shrink: 0; }
.auth-toast-icon svg { width: 20px; height: 20px; }
.auth-toast-body { flex: 1; }
.auth-toast-body strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 2px;
}
.auth-toast-body div { font-size: 13px; }
.auth-toast.dev-code {
    margin-top: 6px;
    padding: 6px 10px;
    background: #fef3c7;
    border-radius: 5px;
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 16px;
    font-weight: 700;
    color: #b45309;
    letter-spacing: 4px;
    text-align: center;
}
.auth-toast.is-leaving { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(16px); }
}

/* ===== 深色模式（与 theme-toggle.css 变量配合） ===== */
:root[data-theme="dark"] .auth-wrap { background: #0f172a; }
:root[data-theme="dark"] body { background: #0f172a; }

:root[data-theme="dark"] .auth-topbar { background: transparent; }
:root[data-theme="dark"] .auth-lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.10);
    color: #9ca3af;
}
:root[data-theme="dark"] .auth-lang-btn:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #e5e7eb;
}

:root[data-theme="dark"] .auth-card {
    background: rgba(15, 23, 42, 0.90);
    border-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
}
:root[data-theme="dark"] .auth-brand { color: #e5e7eb; }
:root[data-theme="dark"] .auth-brand-logo { color: #8eb0e0; }
:root[data-theme="dark"] .auth-brand-name { color: #94a3b8; }
:root[data-theme="dark"] .auth-aside-slogan { color: #e5e7eb; }
:root[data-theme="dark"] .auth-aside-stamp-mark {
    color: rgba(248, 113, 113, 0.85);
    box-shadow: none;
}
:root[data-theme="dark"] .auth-card-head h1 { color: #e5e7eb; }

:root[data-theme="dark"] .auth-label { color: #cbd5e1; }
:root[data-theme="dark"] .auth-label-link { color: #8eb0e0; }
:root[data-theme="dark"] .auth-input {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
}
:root[data-theme="dark"] .auth-input:hover { border-color: rgba(255, 255, 255, 0.20); }
:root[data-theme="dark"] .auth-input:focus {
    border-color: #8eb0e0;
    box-shadow: 0 0 0 1px #8eb0e0;
}
:root[data-theme="dark"] .auth-pwd-toggle { color: #9ca3af; }
:root[data-theme="dark"] .auth-pwd-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}

:root[data-theme="dark"] .auth-code-btn {
    color: #8eb0e0;
    border-color: #8eb0e0;
    background: transparent;
}
:root[data-theme="dark"] .auth-code-btn:hover:not(:disabled) {
    background: #8eb0e0;
    color: #0f172a;
}
:root[data-theme="dark"] .auth-code-btn:disabled {
    color: #475569;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}
:root[data-theme="dark"] .auth-captcha-img {
    border-color: rgba(255, 255, 255, 0.12);
    opacity: 0.9;
}
:root[data-theme="dark"] .auth-captcha-img:hover { border-color: #8eb0e0; }

:root[data-theme="dark"] .auth-check { color: #94a3b8; }
:root[data-theme="dark"] .auth-check a,
:root[data-theme="dark"] .auth-card-foot a { color: #8eb0e0; }

:root[data-theme="dark"] .auth-submit { background: #1d3663; }
:root[data-theme="dark"] .auth-submit:hover:not(:disabled) { filter: brightness(1.15); background: #1d3663; }

:root[data-theme="dark"] .auth-step-back {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.10);
    color: #9ca3af;
}
:root[data-theme="dark"] .auth-step-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}

:root[data-theme="dark"] .auth-step { color: #475569; }
:root[data-theme="dark"] .auth-step-num { background: rgba(255, 255, 255, 0.06); color: #64748b; }
:root[data-theme="dark"] .auth-step-line { background: rgba(255, 255, 255, 0.08); }
:root[data-theme="dark"] .auth-step.is-active,
:root[data-theme="dark"] .auth-step.is-done { color: #8eb0e0; }
:root[data-theme="dark"] .auth-step.is-active .auth-step-num,
:root[data-theme="dark"] .auth-step.is-done .auth-step-num {
    background: #8eb0e0;
    color: #0f172a;
}

:root[data-theme="dark"] .auth-divider::before,
:root[data-theme="dark"] .auth-divider::after { background: rgba(255, 255, 255, 0.10); }
:root[data-theme="dark"] .auth-divider,
:root[data-theme="dark"] .auth-social-desc,
:root[data-theme="dark"] .auth-card-foot { color: #64748b; }

:root[data-theme="dark"] .auth-success h2 { color: #e5e7eb; }
:root[data-theme="dark"] .auth-success p { color: #94a3b8; }

:root[data-theme="dark"] .auth-mail-preview {
    background: rgba(142, 176, 224, 0.10);
    border-color: rgba(142, 176, 224, 0.20);
    color: #cbd5e1;
}
:root[data-theme="dark"] .auth-mail-preview-text { color: #e5e7eb; }
:root[data-theme="dark"] .auth-mail-preview-icon { background: #8eb0e0; color: #0f172a; }
:root[data-theme="dark"] .auth-mail-preview-edit { color: #8eb0e0; }

:root[data-theme="dark"] .auth-toast {
    background: #131c31;
    border-color: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}
:root[data-theme="dark"] .auth-toast-body strong { color: #e5e7eb; }

/* ===== 响应式 ===== */
@media (min-width: 1024px) {
    .auth-row {
        flex-direction: row;
        gap: 56px;
    }
    .auth-aside { display: flex; }
}

@media (max-width: 1023px) {
    .auth-aside { display: none; }
    .auth-card {
        padding: 40px 32px 32px;
    }
}

@media (max-width: 520px) {
    .auth-topbar { height: 52px; padding: 0 16px; }
    .auth-container { padding: 0 12px; }
    .auth-row { padding-top: 56px; }
    .auth-card { padding: 32px 24px 24px; }
    .auth-card-head { margin-bottom: 20px; }
    .auth-brand-logo { width: 40px; height: 40px; }
    .auth-brand-logo img { width: 40px; height: 40px; }
    .auth-toast-wrap {
        top: 12px; right: 12px; left: 12px;
    }
    .auth-toast {
        min-width: 0;
        max-width: 100%;
    }
}
