/* 登录页 · 对齐 huitunui/app1 Login.tsx */
html, body.login-page {
    width: 100%;
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fafbfc;
    color: var(--text-primary, #1a1d1f);
}

.login-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

/* —— 左侧品牌区 —— */
.login-brand-panel {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(160deg, #e3f0ff 0%, #f8f0f4 40%, #ede7f6 100%);
    overflow: hidden;
}

.login-brand-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.login-brand-orb {
    position: absolute;
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
}

.login-brand-orb-a {
    top: 10%;
    right: 15%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(41, 121, 255, 0.06) 0%, transparent 70%);
}

.login-brand-orb-b {
    bottom: 5%;
    left: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(233, 30, 99, 0.05) 0%, transparent 70%);
}

.login-brand-inner {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 60px;
    max-width: 560px;
    animation: loginFadeUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.login-brand-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.login-brand-mark {
    width: 88px;
    height: 88px;
    border-radius: 19px;
    background: linear-gradient(135deg, #e91e63 0%, #f48fb1 50%, #2979ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(233, 30, 99, 0.3);
    overflow: hidden;
}

.login-brand-mark img {
    width: 62%;
    height: 62%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}

.login-brand-title {
    font-size: 42px;
    font-weight: 700;
    color: #1a1d1f;
    margin: 0 0 12px;
    letter-spacing: 2px;
    line-height: 1.2;
}

.login-brand-sub {
    font-size: 18px;
    color: #6f767e;
    margin: 0 0 8px;
}

.login-brand-divider {
    width: 48px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #2979ff, #e91e63);
    margin: 20px auto;
}

.login-brand-desc {
    font-size: 15px;
    color: #9ba3af;
    line-height: 1.8;
    max-width: 400px;
    margin: 0 auto;
}

.login-brand-tags {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 48px;
    flex-wrap: wrap;
}

.login-brand-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    font-size: 13px;
    color: #6f767e;
}

.login-brand-tag span { color: #2979ff; }

.login-brand-copy {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #b0b8c4;
    z-index: 10;
    white-space: nowrap;
}

/* —— 右侧表单区 —— */
.login-form-panel {
    width: 480px;
    min-width: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 48px;
    background: #fff;
    position: relative;
    z-index: 5;
    overflow-y: auto;
}

.login-form-inner {
    width: 100%;
    max-width: 400px;
    animation: loginSlideIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s both;
}

.login-form-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.login-form-logo .login-brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 12px;
}

.login-form-title {
    text-align: center;
    margin-bottom: 28px;
}

.login-form-title h2 {
    font-size: 26px;
    font-weight: 600;
    color: #1a1d1f;
    margin: 0 0 8px;
}

.login-form-title p {
    font-size: 14px;
    color: #9ba3af;
    margin: 0;
}

.login-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid #efefef;
}

.login-tabs button {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    color: #6f767e;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.login-tabs button.tab-active {
    color: #2979ff;
    border-bottom-color: #2979ff;
    font-weight: 600;
}

.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-size: 13px;
    color: #6f767e;
    margin-bottom: 6px;
    font-weight: 500;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap .field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #b0b8c4;
    font-size: 15px;
    pointer-events: none;
}

.login-input-wrap input {
    width: 100%;
    height: 46px;
    padding: 0 40px 0 42px;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    background: #fff;
    color: #1a1d1f;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input-wrap input:focus {
    outline: none;
    border-color: #2979ff;
    box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.12);
}

.login-input-wrap .clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #f0f2f5;
    color: #6f767e;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

.login-error {
    display: none;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff5f3;
    border: 1px solid rgba(255, 106, 85, 0.35);
    color: #c53030;
    font-size: 13px;
}

#loginBtn {
    width: 100%;
    height: 48px;
    margin-top: 8px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2979ff 0%, #1565c0 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(41, 121, 255, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

#loginBtn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(41, 121, 255, 0.35);
}

#loginBtn:disabled { opacity: 0.7; cursor: wait; }

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: #b0b8c4;
    font-size: 13px;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #efefef;
}

.btn-wechat {
    width: 100%;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    border: 1px solid #b7eb8f;
    background: #f6ffed;
    color: #52c41a;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-wechat:hover { background: #edf9e5; }

.btn-outline {
    width: 100%;
    margin-top: 10px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid #dde4ee;
    background: #fff;
    color: #6f767e;
    font-size: 13px;
    cursor: pointer;
}

.btn-outline:hover { background: #f7f9fc; }

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    font-size: 13px;
}

.login-links button {
    border: none;
    background: transparent;
    color: #2979ff;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.login-links button:hover { text-decoration: underline; }

#qrcodeSection { display: none; }

.qrcode-container {
    text-align: center;
    padding: 8px 0 4px;
}

#qrcode {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8ecf0;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
}

#qrcode iframe {
    display: block;
    width: 200px !important;
    height: 200px !important;
    border: none;
    margin: 0 auto;
}

.qrcode-tip {
    margin-top: 16px;
    font-size: 14px;
    color: #6f767e;
}

.qrcode-status {
    margin-top: 4px;
    font-size: 13px;
    color: #b0b8c4;
}

.login-loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
}

.login-form-card {
    position: relative;
}

.login-loading-overlay.show { display: flex; }

.login-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8ecf0;
    border-top-color: #2979ff;
    border-radius: 50%;
    animation: loginSpin 0.8s linear infinite;
}

body.login-page.qrcode-mode .login-password-fields,
body.login-page.qrcode-mode #loginBtn,
body.login-page.qrcode-mode #wechatBtn,
body.login-page.qrcode-mode .login-divider { display: none !important; }

body.login-page.qrcode-mode #qrcodeSection { display: block !important; }

@keyframes loginFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes loginSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes loginSpin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .login-brand-panel { display: none; }
    .login-form-panel {
        width: 100%;
        min-width: auto;
        padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    }
    .login-brand-title { font-size: 32px; }
}

@media (max-width: 520px) {
    .login-form-title h2 { font-size: 22px; }
    .login-input-wrap input { font-size: 16px; }
}
