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

:root {
    /* CPCCE 站点主题色（与 common.css 一致） */
    --ec-brand: #0B3DD2;
    --ec-brand-dark: #000050;
    --ec-brand-light: #2C7EF7;
    --ec-accent: #6AA3F5;
    --ec-accent-bright: #4D8EE8;
    --ec-blue: #0B3DD2;
    --ec-navy: #000050;

    --bg-color: #f5f8fc;
    --card-bg: #ffffff;
    --card-border: rgba(11, 61, 210, 0.12);
    --text-primary: #1d1d1d;
    --text-secondary: #555555;
    --text-muted: #999999;
    --input-border: #e0e6ed;
    --input-bg: #ffffff;
    --primary-color: var(--ec-brand);
    --primary-hover: var(--ec-brand-light);
    --accent-color: var(--ec-brand);
    --accent-glow: rgba(11, 61, 210, 0.14);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 隐藏CMS默认布局，全屏撑满 */
html.member-auth-login,
body.page-container-bg-solid.member-auth-login,
body.member-auth-login {
    background: var(--bg-color) !important;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body.member-auth-login .page-header-top,
body.member-auth-login .page-logo,
body.member-auth-login .page-wrapper-top,
body.member-auth-login .page-wrapper-bottom,
body.member-auth-login .page-container > .page-content-wrapper > .page-content > .margin-top-20:first-child {
    display: none !important;
}

body.member-auth-login .page-container,
body.member-auth-login .page-content-wrapper,
body.member-auth-login .page-content {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    background: transparent !important;
}

body.member-auth-login .page-wrapper {
    background: transparent;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.member-auth-login .margin-top-20 {
    margin-top: 0 !important;
}

/* 核心容器 */
.member-auth-page {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, #f5f8fc 0%, #eaf2fa 55%, #ffffff 100%);
}

.member-auth-has-bg {
    background-image: var(--ec-login-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.member-auth-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.72);
    pointer-events: none;
    z-index: 1;
}

/* 背景呼吸球 */
.ec-auth-blobs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ec-auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    mix-blend-mode: normal;
}

.ec-auth-blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(11, 61, 210, 0.14) 0%, rgba(11, 61, 210, 0) 70%);
    top: -100px;
    left: -100px;
    animation: float-blob-1 25s infinite ease-in-out;
}

.ec-auth-blob-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(166, 216, 103, 0.2) 0%, rgba(166, 216, 103, 0) 70%);
    bottom: -150px;
    right: -150px;
    animation: float-blob-2 30s infinite ease-in-out;
}

.ec-auth-blob-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 76, 151, 0.08) 0%, rgba(0, 76, 151, 0) 70%);
    top: 40%;
    left: 40%;
    animation: float-blob-3 22s infinite ease-in-out;
}

@keyframes float-blob-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, 40px) scale(1.1); }
    66% { transform: translate(-40px, 80px) scale(0.95); }
}

@keyframes float-blob-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-80px, -60px) scale(1.15); }
}

@keyframes float-blob-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(50px, -70px) scale(0.9); }
    80% { transform: translate(-30px, 30px) scale(1.05); }
}

/* 布局 Shell */
.member-auth-shell {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: grid;
    grid-template-columns: 1.1fr 440px;
    gap: 4rem;
    align-items: center;
    flex: 1;
    box-sizing: border-box;
}

/* 左侧 Hero 品牌区 */
.member-auth-hero {
    color: var(--text-primary);
}

.member-auth-logo {
    margin-bottom: 2rem;
}

.member-auth-logo img {
    max-height: 60px;
    max-width: 260px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(11, 61, 210, 0.08));
}

.member-auth-has-bg .member-auth-logo img {
    filter: none;
}

.member-auth-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.25em;
    color: var(--ec-brand);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.member-auth-hero-copy h1 {
    margin: 0 0 1rem;
    font-size: clamp(28px, 3.5vw, 42px);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    background: none;
    -webkit-text-fill-color: currentColor;
}

.member-auth-hero-desc {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.member-auth-role-pills {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.member-auth-role-pills li span {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    color: var(--ec-brand);
    background: rgba(11, 61, 210, 0.06);
    border: 1px solid rgba(11, 61, 210, 0.15);
}

/* 特色卡片列表 */
.member-auth-highlights {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
}

.member-auth-highlights li {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: 0 4px 16px rgba(11, 61, 210, 0.06);
    transition: var(--transition-base);
}

.member-auth-highlights li:hover {
    background: #fff;
    border-color: rgba(11, 61, 210, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(11, 61, 210, 0.1);
}

.highlight-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(11, 61, 210, 0.08);
    border: 1px solid rgba(11, 61, 210, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ec-brand);
    flex-shrink: 0;
}

.highlight-icon-box svg {
    width: 22px;
    height: 22px;
}

.highlight-text-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.highlight-text-box strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.highlight-text-box span {
    font-size: 12px;
    color: var(--text-secondary);
}

.member-auth-ad-banner {
    margin-top: 2rem;
    padding: 8px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(11, 61, 210, 0.06);
}

.member-auth-ad-banner img {
    display: block;
    max-width: 100%;
    border-radius: 10px;
}

/* 右侧表单外层 */
.member-auth-panel-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

/* 登录卡片 */
.member-auth-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(11, 61, 210, 0.08);
    overflow: hidden;
}

.member-auth-card-head {
    padding: 2.25rem 2.25rem 1.5rem;
}

.member-auth-card-head h2 {
    margin: 0 0 0.5rem;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.member-auth-card-head p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 选项卡样式 */
.member-auth-tabs {
    display: flex;
    padding: 0 2.25rem;
    border-bottom: 1px solid #eef2f6;
    gap: 24px;
}

.member-auth-tab {
    flex-shrink: 0;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    transition: var(--transition-base);
    margin-bottom: -1px;
}

.member-auth-tab:hover {
    color: var(--text-primary);
}

.member-auth-tab.active {
    color: var(--ec-brand);
    border-bottom-color: var(--ec-brand);
    font-weight: 600;
}

/* 表单主体 */
.member-auth-body {
    padding: 2rem 2.25rem 2.25rem;
}

.member-auth-form-panel {
    display: none;
}

.member-auth-form-panel.active {
    display: block;
}

.member-auth-field {
    margin-bottom: 20px;
}

.member-auth-field label,
.member-auth-role-select label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 输入框包装器 */
.member-auth-input-wrapper {
    position: relative;
    width: 100%;
}

.member-auth-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition-base);
}

.member-auth-field input,
.member-auth-field select,
.member-auth-role-select select {
    width: 100%;
    height: 48px;
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 0 16px 0 46px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--input-bg);
    box-sizing: border-box;
    transition: var(--transition-base);
    outline: none;
}

/* 为无图标输入调整Padding */
.member-auth-field input.no-icon {
    padding-left: 16px;
}

/* 微信或特定图形验证码中含有 wrapper 而非 icon 时自适应 */
.member-auth-code-row .member-auth-input-wrapper input {
    /* 保留原样 */
}

.member-auth-field input::placeholder {
    color: var(--text-muted);
}

.member-auth-field input:hover,
.member-auth-role-select select:hover {
    border-color: #cbd5e1;
    background: #fafbfc;
}

.member-auth-field input:focus,
.member-auth-role-select select:focus {
    border-color: var(--ec-brand);
    background: #fff;
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* 焦点时光标与图标颜色联动 */
.member-auth-input-wrapper:focus-within .member-auth-input-icon {
    color: var(--ec-brand);
}

/* 密码明文切换按钮 */
.password-toggle-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    width: 20px;
    height: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.password-toggle-btn:hover {
    color: var(--text-primary);
}

.password-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* 自定义下拉选择框 */
.member-auth-role-select {
    margin-bottom: 20px;
}

.member-auth-select-wrapper {
    position: relative;
    width: 100%;
}

.member-auth-select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
    cursor: pointer;
}

.select-chevron {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.select-chevron svg {
    width: 100%;
    height: 100%;
}

/* 记住登录行 */
.remember-forget-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

/* 自定义复选框 */
.member-auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.custom-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-indicator {
    height: 18px;
    width: 18px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--input-border);
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    transition: var(--transition-base);
}

.member-auth-remember:hover .checkbox-indicator {
    border-color: var(--ec-brand);
}

.custom-checkbox:checked ~ .checkbox-indicator {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(11, 61, 210, 0.25);
}

.checkbox-indicator:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox:checked ~ .checkbox-indicator:after {
    display: block;
}

/* 提交按钮 */
.member-auth-submit {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ec-brand) 0%, var(--ec-brand-dark) 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.1em;
    box-shadow: 0 8px 24px rgba(11, 61, 210, 0.35);
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(11, 61, 210, 0.45);
    opacity: 0.95;
}

.member-auth-submit:active {
    transform: translateY(0);
}

/* 验证码与短信行 */
.member-auth-sms-row,
.member-auth-code-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.member-auth-sms-row .member-auth-input-wrapper,
.member-auth-code-row .member-auth-input-wrapper {
    flex: 1;
}

.member-auth-sms-btn {
    flex-shrink: 0;
    min-width: 110px;
    height: 48px;
    border: 1px solid rgba(11, 61, 210, 0.25);
    border-radius: 12px;
    background: rgba(11, 61, 210, 0.04);
    color: var(--ec-brand);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.member-auth-sms-btn:hover:not(:disabled) {
    background: var(--ec-brand);
    color: #fff;
    box-shadow: 0 4px 12px rgba(11, 61, 210, 0.25);
}

.member-auth-sms-btn:disabled,
.member-auth-sms-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(11, 61, 210, 0.15);
    background: #f8fafc;
    color: var(--text-muted);
}

.member-auth-code-row .fc-code img {
    height: 48px;
    border-radius: 10px;
    border: 1px solid var(--input-border);
    cursor: pointer;
}

/* 微信扫码盒子 */
.member-auth-wechat-box {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
}

.member-auth-qr-container {
    position: relative;
    width: 204px;
    height: 204px;
    margin: 0 auto 1.5rem;
    padding: 10px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.member-auth-qr {
    width: 184px;
    height: 184px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-auth-qr canvas,
.member-auth-qr img {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* QR装饰角 */
.qr-border-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 3px solid var(--accent-color);
    pointer-events: none;
}

.qr-top-left { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.qr-top-right { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 12px; }
.qr-bottom-left { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 12px; }
.qr-bottom-right { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }

.member-auth-qr-empty {
    width: 204px;
    height: 204px;
    margin: 0 auto 1.5rem;
    border: 2px dashed #e0e6ed;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fafbfc;
    color: var(--text-muted);
    font-size: 13px;
}

.member-auth-wechat-tip {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.member-auth-wechat-fallback a {
    color: var(--ec-brand);
    font-size: 12px;
    text-decoration: none;
    transition: var(--transition-base);
}

.member-auth-wechat-fallback a:hover {
    color: var(--ec-brand-dark);
    text-decoration: underline;
}

/* 底部功能链接 */
.member-auth-foot {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #eef2f6;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.foot-link {
    color: var(--ec-brand);
    text-decoration: none;
    transition: var(--transition-base);
    font-weight: 500;
}

.foot-link:hover {
    color: var(--ec-brand-dark);
}

.muted-link {
    color: var(--text-secondary);
}

.member-auth-ad-side {
    max-width: 440px;
}

.member-auth-ad-side img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(11, 61, 210, 0.12);
}

/* 注册面板特有：角色Tab切换 */
.register-group-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    padding: 6px;
    border-radius: 14px;
}

.register-group-tabs a {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-base);
}

.register-group-tabs a:hover {
    color: var(--text-primary);
}

.register-group-tabs a.active {
    background: var(--ec-brand);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(11, 61, 210, 0.25);
}

/* 短信登录：身份选择按钮 */
.ec-role-btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    padding: 6px;
    border-radius: 14px;
}
.ec-role-btn {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    line-height: 1.4;
}
.ec-role-btn:hover {
    color: var(--text-primary);
    border-color: rgba(11, 61, 210, 0.2);
    background: #fff;
}
.ec-role-btn.active {
    background: var(--ec-brand);
    color: #fff;
    font-weight: 700;
    border-color: var(--ec-brand);
    box-shadow: 0 4px 12px rgba(11, 61, 210, 0.25);
}

/* 页脚 */
.member-auth-page-footer {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
}

.member-auth-page-footer a {
    color: var(--text-muted);
    margin-left: 12px;
    text-decoration: none;
    transition: var(--transition-base);
}

.member-auth-page-footer a:hover {
    color: var(--text-secondary);
}

/* 注册及单卡片页面容器 */
.member-auth-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 480px;
    margin: auto;
    padding: 4rem 1.5rem;
    box-sizing: border-box;
}

/* 中大型屏幕纵向高度修正 */
@media (min-width: 961px) {
    .member-auth-shell {
        min-height: calc(100vh - 80px);
    }
}

/* 响应式：平板层 */
@media (max-width: 960px) {
    .member-auth-shell {
        grid-template-columns: 1fr;
        max-width: 500px;
        padding: 3rem 1.5rem 1.5rem;
        gap: 2.5rem;
    }

    .member-auth-hero {
        text-align: center;
    }

    .member-auth-logo {
        margin-bottom: 1.5rem;
    }

    .member-auth-hero-copy h1 {
        font-size: 32px;
    }

    .member-auth-highlights {
        display: none; /* 平板隐藏大段介绍，保持简洁 */
    }

    .member-auth-role-pills {
        display: flex;
        justify-content: center;
        margin-top: 12px;
        gap: 6px;
    }

    .member-auth-ad-banner {
        display: none;
    }
    
    .member-auth-ad-side {
        display: none;
    }
}

/* 响应式：手机层 */
@media (max-width: 767px) {
    .member-auth-page {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .member-auth-shell {
        padding: 2rem 1rem 1rem;
        gap: 2rem;
    }

    .member-auth-hero {
        margin-top: 1rem;
    }

    .member-auth-hero-copy h1 {
        font-size: 26px;
    }

    .member-auth-card {
        border-radius: 20px;
    }

    .member-auth-card-head {
        padding: 1.75rem 1.5rem 1.25rem;
    }

    .member-auth-tabs {
        padding: 0 1.5rem;
        gap: 16px;
    }

    .member-auth-body {
        padding: 1.5rem 1.5rem 1.75rem;
    }

    .member-auth-field {
        margin-bottom: 16px;
    }

    .member-auth-field input,
    .member-auth-field select,
    .member-auth-role-select select {
        height: 46px;
        font-size: 15px;
    }
    
    .member-auth-sms-btn {
        height: 46px;
    }
    
    .member-auth-code-row .fc-code img {
        height: 46px;
    }

    .member-auth-submit {
        height: 46px;
        font-size: 15px;
    }

    .member-auth-foot {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .member-auth-page-footer {
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
        font-size: 11px;
    }
}

/* 无障碍：减少动效 */
@media (prefers-reduced-motion: reduce) {
    .ec-auth-blob {
        animation: none !important;
    }
    .member-auth-tab,
    .member-auth-submit,
    .member-auth-highlights li {
        transition: none !important;
    }
}
