/* 登录 / 法律页 — AWS 风格深色背景 + 白卡片 */
:root {
    --auth-bg: #0b1120;
    --auth-accent: #00c87f;
    --auth-accent-hover: #00BE6F;
    --auth-link: #93c5fd;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #d1d5db;
    --auth-input-bg: #fff; /*选择浏览器历史记录填写内容后input背景色*/
    --auth-card-radius: 28px;
    --auth-bar-h: 52px;
    --auth-bar-px: 20px;
    --auth-logo-h: 32px; /*移动端logo高度*/
}

* { box-sizing: border-box; }

html:has(body.auth-page) {
    overflow-x: hidden;
    max-width: 100%;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
    font-family: "Amazon Ember", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #e2e8f0;
    background: var(--auth-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(37, 99, 235, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, #060b16 0%, #0b1120 40%, #0f172a 100%);
    display: flex;
    flex-direction: column;
}

/* 统一顶栏：移动端 52px / PC 60px（全站一致，可扩展文字等元素） */
.auth-header {
    height: var(--auth-bar-h);
    min-height: var(--auth-bar-h);
    max-height: var(--auth-bar-h);
    padding: 0 var(--auth-bar-px);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}
.auth-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
    height: 100%;
}
.auth-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    line-height: 0;
}
.auth-logo img {
    display: block;
    height: var(--auth-logo-h);
    width: auto;
    max-height: calc(var(--auth-bar-h) - 8px);
}
.auth-header-title {
    font-size: 15px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.auth-header-spacer { flex: 1; min-width: 8px; }

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px 32px;
}

/* 顶栏对齐：移动端 Logo 居中，PC 靠左（登录 / 法律等 auth 页统一） */
.auth-page .auth-header {
    justify-content: center;
}
.auth-page .auth-header-inner {
    justify-content: center;
    width: auto;
    max-width: 100%;
}

/* 登录页：Logo + 卡片靠上；卡片始终水平居中 */
.login-page .auth-top-block {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0 0 24px;
    width: 100%;
}
.login-page .auth-header {
    margin-bottom: 16px;
}
.login-page .auth-main {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100vw;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}
.login-page .auth-footer {
    margin-top: auto;
}

.auth-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 20px 16px 28px;
}
.auth-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 10px;
    font-size: 13px;
    margin-bottom: 12px;
}
.auth-footer-links a {
    color: #cbd5e1;
    text-decoration: none;
}
.auth-footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}
.auth-footer-links .sep {
    color: #475569;
    user-select: none;
}
.auth-copyright {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

/* 登录卡片 */
.login-card {
    width: 100%;
    max-width: min(440px, calc(100vw - 40px));
    background: #fff;
    border-radius: var(--auth-card-radius);
    padding: 32px 28px 28px;
    color: var(--auth-text);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    animation: authFadeUp 0.35s ease;
}

.login-card .card-title {
    margin: 0 0 6px;
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.login-card .card-sub {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--auth-muted);
    line-height: 1.5;
}

/* 进度条 */
.progress-wrap { margin-bottom: 24px; }
.progress-track {
    height: 4px;
    background: #e5e7eb; /* ← 轨道背景色 */
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 33.33%;
    background: linear-gradient(90deg, #00c87f, #00E893);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(0, 200, 127, 0.35);
}
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.progress-steps span.active { color: #B9B9B9; font-weight: 600; }
.progress-steps span.done { color: #16a34a; }

.step-panel { display: none; }
.step-panel.active { display: block; animation: authFadeIn 0.25s ease; }

.form-group { margin-bottom: 18px; }
.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.form-label-row label {
    margin-bottom: 0;
}
.form-label-link {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
}
.form-label-link:hover { text-decoration: underline; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}
.email-readonly {
    padding: 11px 14px;
    background: #f8fafc;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    color: #334155;
    font-size: 14px;
}

.auth-page input[type="email"],
.auth-page input[type="password"],
.auth-page input[type="text"],
.auth-page input[type="tel"],
.auth-page input[type="number"],
.auth-page select,
.auth-page textarea {
    width: 100%;
    max-width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    font-size: 16px;
    color: #0f172a;
    background: var(--auth-input-bg);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-text-size-adjust: 100%;
}
/* 覆盖 Chrome/Edge/Safari 自动填充邮箱/密码时的浅蓝背景 */
.auth-page input:-webkit-autofill,
.auth-page input:-webkit-autofill:hover,
.auth-page input:-webkit-autofill:focus,
.auth-page input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--auth-input-bg) inset;
    box-shadow: 0 0 0 1000px var(--auth-input-bg) inset;
    -webkit-text-fill-color: #0f172a;
    caret-color: #0f172a;
    transition: background-color 99999s ease-out 0s;
}
.auth-page input:focus {
    border-color: #00C87F;
    box-shadow: 0 0 0 3px rgba(0, 200, 127, 0.15);
}
input.code-input {
    text-align: center;
    letter-spacing: 6px;
    font-size: 16px;
    font-weight: 600;
}

@media (min-width: 768px) {
    input.code-input {
        font-size: 22px;
        letter-spacing: 8px;
    }
}

.btn-primary {
    width: 100%;
    padding: 12px 16px;
    margin-top: 8px;
    border: none;
    border-radius: 8px;
    background: var(--auth-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-primary:hover:not(:disabled) { background: var(--auth-accent-hover); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-link {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    border: none;
    background: none;
    color: #2563eb;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
}
.btn-link:hover:not(:disabled) { text-decoration: underline; }
.btn-link:disabled { color: #94a3b8; cursor: not-allowed; }

.msg-box {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
    display: none;
}
.msg-box.error {
    display: block;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}
.msg-box.success {
    display: block;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.card-hint {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
    color: var(--auth-muted);
    text-align: center;
    line-height: 1.6;
}
.card-hint a { color: #2563eb; text-decoration: none; font-weight: 600; }
.card-hint a:hover { text-decoration: underline; }

.captcha-row { display: none; margin-bottom: 16px; }
.captcha-row.show { display: block; }
.captcha-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}
.captcha-box {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
}
.captcha-box input {
    min-width: 0;
    flex: 1;
}
.captcha-box img {
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--auth-border);
    cursor: pointer;
    flex-shrink: 0;
}

/* 法律内容页 */
.legal-card {
    width: 100%;
    max-width: 720px;
    background: #fff;
    border-radius: var(--auth-card-radius);
    padding: 32px 28px;
    color: var(--auth-text);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}
.legal-card h1 {
    margin: 0 0 16px;
    font-size: 1.5rem;
    color: #0f172a;
}
.legal-body {
    font-size: 15px;
    line-height: 1.75;
    color: #334155;
}
.legal-body p { margin: 0 0 12px; }
.legal-back { margin: 24px 0 0; font-size: 14px; }
.legal-back a { color: #2563eb; text-decoration: none; }
.legal-back a:hover { text-decoration: underline; }

@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes authFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (min-width: 768px) {
    :root {
        --auth-bar-h: 60px;
        --auth-bar-px: 48px;
        --auth-logo-h: 32px;   /*PC端logo高度*/
    }

    .auth-header-title {
        font-size: 16px;
    }

    .auth-main {
        padding: 24px 48px 40px;
    }
    .login-card {
        padding: 36px 36px 32px;
    }

    .login-page .auth-header {
        margin-bottom: 20px;
    }
    .auth-page .auth-header {
        justify-content: flex-start;
    }
    .auth-page .auth-header-inner {
        justify-content: flex-start;
        width: 100%;
    }
    .login-page .auth-main {
        padding: 0 48px;
        justify-content: center;
    }
}
