﻿/* 登录 / 注册 — 对齐门户 page-container + 边框卡片布局 */

:root {
    --auth-mobile-gutter: 12px;
    --auth-outer-gutter: 12px;
    --auth-surface-border: #e5e7eb;
    --auth-input-border: #e5e7eb;
    --auth-input-border-hover: #d1d5db;
    --auth-radius: 12px;
    --auth-radius-sm: 10px;
    --auth-radius-pill: 999px;
    --auth-shadow: none;
    --auth-input-bg: #fff;
    --auth-primary-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.12);
}

body.auth-layout .site-main-auth {
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
    padding: 0;
}

body.portal-layout.auth-layout.has-tabbar > .site-main-auth {
    padding-bottom: 0;
}

.auth-page.auth-shell.page-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    background: transparent;
}

.auth-page .page-container {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 !important;
    box-sizing: border-box;
}

.auth-page .auth-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: var(--auth-outer-gutter) 0;
    background: transparent;
    box-sizing: border-box;
}

.auth-split {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}

.auth-hero {
    display: none;
}

.auth-panel {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    min-height: 0;
    width: 100%;
    padding: 0;
    background: transparent;
}

.auth-main {
    flex: 0 0 auto;
    width: 100%;
    max-width: 420px;
    margin: auto;
    border: 1px solid var(--auth-surface-border);
    border-radius: var(--auth-radius);
    background: #fff;
    box-shadow: var(--auth-shadow);
    overflow: hidden;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    background: #fff;
    padding: 20px 16px 24px;
    box-sizing: border-box;
}

.auth-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 标题 */
.auth-card-title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text, #111827);
}

.auth-alert,
.auth-page .install-alert {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: var(--auth-radius-sm);
    font-size: 13px;
    line-height: 1.5;
}

.auth-page .install-alert.error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.auth-alert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* 登录方式：灰色胶囊分段 */
.auth-page .auth-method-tabs {
    display: flex;
    gap: 0;
    margin: 0 0 20px;
    padding: 3px;
    background: #f3f4f6;
    border-radius: var(--auth-radius-pill);
}

.auth-page .auth-method-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: var(--auth-radius-pill);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary, #6b7280);
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.auth-page .auth-method-tab.is-active {
    background: #fff;
    color: var(--color-primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.auth-page .auth-method-tab:hover:not(.is-active) {
    color: var(--color-text, #374151);
}

.auth-page .auth-method-tab:focus-visible {
    outline: 2px solid rgba(255, 92, 56, 0.45);
    outline-offset: 2px;
}

.auth-page .form-group {
    margin-bottom: 16px;
}

.auth-page .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary, #6b7280);
}

.auth-page .form-control {
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border: 1px solid var(--auth-input-border);
    border-radius: var(--auth-radius-sm);
    background: var(--auth-input-bg);
    font-size: 14px;
    color: var(--color-text, #111827);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-page .form-control::placeholder {
    color: #9ca3af;
}

.auth-page .form-control:hover {
    border-color: var(--auth-input-border-hover);
}

.auth-page .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 92, 56, 0.1);
}

/* 验证码行：左右分栏，各自带边框 */
.auth-page .input-with-btn {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.auth-page .input-with-btn .form-control {
    flex: 1;
    min-width: 0;
}

.auth-page .input-with-btn .btn-secondary {
    flex-shrink: 0;
    min-width: 108px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--auth-input-border);
    border-radius: var(--auth-radius-sm);
    background: #fff;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s;
}

.auth-page .input-with-btn .btn-secondary:hover:not(:disabled) {
    border-color: var(--auth-input-border-hover);
    background: #fffaf8;
}

.auth-page .input-with-btn .btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-page .btn-primary.btn-block {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 13px 16px;
    border: none;
    border-radius: var(--auth-radius-pill);
    background: linear-gradient(135deg, #ff6b4a 0%, var(--color-primary, #ff5c38) 55%, #f04f2a 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--auth-primary-shadow);
    transition: filter 0.15s, box-shadow 0.15s;
}

.auth-page .btn-primary.btn-block:hover:not(:disabled) {
    filter: brightness(1.03);
    box-shadow: 0 8px 20px rgba(255, 92, 56, 0.3);
}

.auth-page .btn-primary.btn-block:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* 微信登录 */
.auth-alt-login {
    margin-top: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--color-text-muted, #9ca3af);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-surface-border);
}

.auth-divider span {
    flex-shrink: 0;
}

.auth-page .btn-wechat.btn-block {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #07c160;
    border-radius: var(--auth-radius-pill);
    background: #fff;
    color: #07c160;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s;
}

.auth-page .btn-wechat.btn-block:hover {
    background: #f0fdf4;
    color: #07c160;
    text-decoration: none;
}

.auth-wechat-tip {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--color-text-muted, #9ca3af);
    line-height: 1.5;
    text-align: center;
}

.auth-footer-link {
    margin: 24px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--color-text-secondary, #6b7280);
}

.auth-footer-link a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

/* ========== 手机端 ========== */

@media (max-width: 768px) {
    body.auth-layout .site-main-auth {
        padding-left: 0;
        padding-right: 0;
        min-height: 0;
    }

    .auth-page.auth-shell.page-shell {
        max-width: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .auth-page .flow-desktop-bar {
        display: none !important;
    }

    .auth-page .auth-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: var(--auth-outer-gutter) var(--auth-mobile-gutter);
        background: transparent;
    }

    .auth-split {
        flex: 1 1 auto;
        min-height: 0;
    }

    .auth-panel {
        flex: 1 1 auto;
        min-height: 0;
        justify-content: center;
    }

    .auth-main {
        flex: 0 0 auto;
        width: 100%;
        max-width: none;
        margin: auto;
        border: 1px solid var(--auth-surface-border);
        border-radius: var(--auth-radius);
        background: #fff;
    }

    .auth-card {
        padding: 20px 16px 24px;
    }
}

/* ========== PC ========== */

@media (min-width: 769px) {
    body.auth-layout .site-main-auth {
        padding: 0;
        min-height: 0;
    }

    .auth-page.auth-shell.page-shell {
        margin-bottom: 0;
    }

    .auth-page .auth-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: var(--auth-outer-gutter) 0;
        background: transparent;
    }

    .auth-split {
        flex-direction: row;
        flex: 1 1 auto;
        align-items: stretch;
        min-height: 0;
        width: 100%;
        border: 1px solid var(--auth-input-border);
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
    }

    .auth-hero {
        display: flex;
        align-items: center;
        align-self: stretch;
        position: relative;
        flex: 0 0 44%;
        max-width: 44%;
        padding: 40px 36px;
        overflow: hidden;
        color: #fff;
        border-radius: 0;
    }

    .auth-hero-bg {
        position: absolute;
        inset: 0;
        background: linear-gradient(145deg, #c93a3f 0%, var(--color-primary) 35%, #ff7b6b 70%, #ffb088 100%);
        z-index: 0;
    }

    .auth-hero-bg::before {
        content: '';
        position: absolute;
        width: 280px;
        height: 280px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        top: -70px;
        right: -50px;
    }

    .auth-hero-bg::after {
        content: '';
        position: absolute;
        width: 180px;
        height: 180px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.06);
        bottom: -40px;
        left: -30px;
    }

    .auth-hero-content {
        position: relative;
        z-index: 1;
        max-width: 320px;
    }

    .auth-hero-logo {
        display: inline-block;
        font-size: 24px;
        font-weight: 700;
        color: #fff;
        text-decoration: none;
        margin-bottom: 24px;
    }

    .auth-hero-logo:hover {
        color: #fff;
        text-decoration: none;
        opacity: 0.92;
    }

    .auth-hero-title {
        margin: 0 0 12px;
        font-size: 26px;
        font-weight: 700;
        line-height: 1.35;
    }

    .auth-hero-desc {
        margin: 0 0 20px;
        font-size: 14px;
        line-height: 1.6;
        opacity: 0.92;
    }

    .auth-hero-features {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .auth-hero-features li {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
        font-size: 14px;
    }

    .auth-hero-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.18);
        font-size: 16px;
        flex-shrink: 0;
    }

    .auth-panel {
        flex: 1 1 auto;
        align-self: stretch;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        min-height: 0;
        padding: 28px 36px;
        background: #fff;
        border-left: 1px solid var(--auth-surface-border);
    }

    .auth-main {
        flex: 0 0 auto;
        width: 100%;
        max-width: 380px;
        margin: auto;
        border: none;
        border-radius: 0;
        background: transparent;
    }

    .auth-card {
        max-width: 380px;
        padding: 0;
    }

    .auth-card-title {
        font-size: 20px;
        margin-bottom: 22px;
    }
}

/* 门户手机端：与导航同宽 + 统一边距 + 白底卡片边框 */
@media (max-width: 767px) {
    body.portal-layout.auth-layout .auth-page .page-container {
        width: 100%;
        max-width: none !important;
        margin: 0;
        padding: 0 !important;
    }

    body.portal-layout.auth-layout .auth-page,
    body.portal-layout.auth-layout .auth-body {
        background: transparent;
    }

    body.portal-layout.auth-layout .auth-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: var(--auth-outer-gutter) var(--auth-mobile-gutter);
        box-sizing: border-box;
    }

    body.portal-layout.auth-layout .auth-split {
        flex: 1 1 auto;
        min-height: 0;
    }

    body.portal-layout.auth-layout .auth-panel {
        flex: 1 1 auto;
        min-height: 0;
        justify-content: center;
    }

    body.portal-layout.auth-layout .auth-main {
        flex: 0 0 auto;
        margin: auto;
        border: 1px solid var(--auth-surface-border);
        border-radius: var(--auth-radius);
        background: #fff;
    }
}

/* 门户 PC：主体与 .site-inner 同宽，灰底衬托白卡片 */
@media (min-width: 769px) {
    body.portal-layout.auth-layout .auth-page .page-container {
        width: min(
            var(--site-max-width),
            calc(100% - var(--site-gutter) * 2)
        );
        max-width: none !important;
        margin-left: auto;
        margin-right: auto;
        padding: 0 !important;
        box-sizing: border-box;
    }

    body.portal-layout.auth-layout .auth-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: var(--auth-outer-gutter) 0;
    }
}
