/* Imports - must precede all other rules per CSS spec */
/* animate.min.css 已移除（login.css 自带 @keyframes fadeIn，无需再引） */
/* 自研内联 SVG 图标层（close-circle / warning）：登录页不加载 base.css，
   由本文件 @import 一份，页面侧不再单独挂 <link>（2026-10-17 批㊻／批㊻-H，接线纪律＝只动这三个 CSS）。
   ⚠ 本层的 .pb-ico 没有字体兜底——这条 @import 掉了，登录横幅的图标会直接不可见。
   ⚠ 附带代价（已知，纪律下无解）：404.html／500.html／error.html 也只挂 reset.css＋本文件，
     三页各 0 个 <svg>、0 个 .pb-ico，却都被这条转引带走 9,502 B（本机未开 gzip）。
     要消掉得把这两枚登录专用语义搬进 login.css 本体（代价＝图标层不再单一文件），未点单。 */
@import url("pb-icons.css?v=20261018.0001");

/* ========== Local Fonts（与 index.css 同源，登录页不引 index.css 需单独声明） ========== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Noto Sans SC';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/noto-sc-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Noto Sans SC';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/noto-sc-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Noto Sans SC';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/noto-sc-700.woff2') format('woff2');
}

/* ========== CSS Variables ========== */
:root {
    color-scheme: light;
    --bg-page: #F0F2F5;
    --bg-brand: #E8EEFB;
    --bg-card: #FFFFFF;
    --bg-input: #F7F7F8;
    --border-card: #E8ECF2;
    --border-input: #E0E4ED;
    --text-primary: #0C0A09;
    --text-muted: #64748B;
    /* 对齐后台 light-modern 设计令牌：科技蓝 #0485f7（＝ --pb-primary 默认值）+ 靛蓝 #6366F1 */
    --accent: #0485f7;
    --accent-hover: #0373e0;
    --accent-grad: linear-gradient(135deg, #6366F1, var(--accent));
    --accent-shadow: rgba(4, 133, 247, 0.28);
    --accent-focus: rgba(4, 133, 247, 0.12);
    --shadow-card-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-card-md: 0 4px 12px rgba(15, 23, 42, 0.05);
    --shadow-card-lg: 0 12px 32px rgba(15, 23, 42, 0.04);
    --font-sans: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
    --transition: all 0.2s ease;
}

/* 盒模型 */
*,
*:before,
*:after {
    box-sizing: border-box;
}

/* 重置 */
input, button, select, textarea {
    outline: none;
    border: none;
}
textarea {
    resize: none;
}
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-input) inset;
}
input::placeholder {
    color: var(--text-muted);
    opacity: 0.4;
}
input::-ms-clear { display: none; }
input::-ms-reveal { display: none; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

::selection { background: rgba(4, 133, 247, 0.15); }

/* ========== Keyframes ========== */
@keyframes fadeSlideLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes subtlePulse {
    0%, 100% { box-shadow: 0 4px 12px var(--accent-shadow); }
    50%      { box-shadow: 0 4px 24px var(--accent-shadow), 0 0 0 4px rgba(4, 133, 247, 0.08); }
}

@keyframes bgShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========== Base ========== */
html, body {
    width: 100%;
    height: 100%;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-page);
    font-family: var(--font-sans);
    overflow-x: hidden;
    /* 防止 iOS 橡皮筋效果导致背景露出 */
    position: relative;
}

a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    /* 移动端扩大点击区域 */
    -webkit-tap-highlight-color: transparent;
}
a:hover { color: var(--text-primary); }

/* ========== Page ========== */
#page {
    width: 100%;
    min-height: 100%;
    /* 移动端安全区域适配 */
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ========== Split Layout ========== */
.login-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh; /* 动态视口高度，移动端更准确 */
}

/* ========== Brand Area (Left) ========== */
.brand-area {
    flex: 0 0 58%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 100px 0 120px;
    background:
            /* 左上主光晕：靛蓝→透明 */
            radial-gradient(720px 480px at 18% 12%, rgba(99, 102, 241, 0.22), transparent 65%),
            /* 右下辅光晕：科技蓝 */
            radial-gradient(560px 420px at 85% 88%, rgba(4, 133, 247, 0.16), transparent 65%),
            /* 细网格纹理：40px 见方，极淡 */
            linear-gradient(rgba(99, 102, 241, 0.06) 1px, transparent 1px),
            linear-gradient(90deg, rgba(99, 102, 241, 0.06) 1px, transparent 1px),
            var(--bg-brand);
    background-size: auto, auto, 40px 40px, 40px 40px, auto;
    position: relative;
    overflow: hidden;
    animation: fadeSlideLeft 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* 斜切效果：在品牌区右侧画一个白色三角，覆盖出斜角 */
.brand-area::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 0;
    width: 90px;
    height: 100%;
    background: #FFFFFF;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    animation: fadeIn 0.8s ease 0.4s both;
}

/* 沿斜面的柔和渐变过渡：左溢出 40px 覆盖到 login-area，实现真正"晕染"效果 */
.brand-area::before {
    content: '';
    position: absolute;
    right: -40px;
    top: 0;
    width: 130px;
    height: 100%;
    background: linear-gradient(163deg,
    rgba(99, 102, 241, 0.22) 0%,
    rgba(4, 133, 247, 0.12) 40%,
    rgba(4, 133, 247, 0.04) 70%,
    transparent 90%);
    animation: fadeIn 0.8s ease 0.5s both;
}

/* ========== Login Area (Right) ========== */
.login-area {
    flex: 0 0 42%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 60px 40px 90px;
    background: #FFFFFF;
    position: relative;
    overflow: hidden;
}

.brand-title {
    font-size: 56px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    line-height: 1.14;
    letter-spacing: -1px;
    font-family: var(--font-sans);
    animation: fadeSlideUp 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.15s both;
}
/* 品牌渐变文字（靛蓝→科技蓝）：仅在支持 background-clip:text 的浏览器启用，
   否则保持纯色标题（避免旧浏览器把标题框整体涂成渐变色块） */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .brand-title {
    background: linear-gradient(120deg, #6366F1 0%, #0485f7 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}
/* 标题下的品牌渐变装饰线 */
.brand-title::after {
    content: '';
    display: block;
    width: 72px;
    height: 4px;
    margin-top: 20px;
    border-radius: 2px;
    background: var(--accent-grad);
    box-shadow: 0 2px 8px var(--accent-shadow);
}

.brand-desc {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
    opacity: 0.6;
    animation: fadeSlideUp 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.3s both;
}

/* ========== Brand Geometric Decorations ========== */
.brand-geo {
    position: absolute;
    pointer-events: none;
    animation: fadeSlideLeft 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s both;
}

.brand-geo-circle-1 {
    top: 80px;
    left: 120px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(99, 102, 241, 0.40), rgba(4, 133, 247, 0.24) 55%, rgba(4, 133, 247, 0.08));
    box-shadow: 0 8px 24px rgba(4, 133, 247, 0.12);
}

.brand-geo-circle-2 {
    top: 152px;
    left: 120px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(99, 102, 241, 0.38), rgba(4, 133, 247, 0.14));
    box-shadow: 0 4px 12px rgba(4, 133, 247, 0.08);
}

.brand-geo-line {
    top: 188px;
    left: 120px;
    width: 60px;
    height: 2px;
    border-radius: 1px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.32), rgba(4, 133, 247, 0.10));
    box-shadow: 0 2px 6px rgba(4, 133, 247, 0.06);
}

/* ========== Brand 3D Decorations ========== */
.brand-3d {
    position: absolute;
    pointer-events: none;
}

.brand-3d-cube-wrap {
    bottom: 100px;
    right: 120px;
    animation: float3d 8s ease-in-out infinite;
}

.brand-3d-cube {
    width: 60px;
    height: 60px;
    transform-style: preserve-3d;
    transform: rotateX(-25deg) rotateY(45deg);
    animation: spin3d 30s linear infinite;
}

@keyframes spin3d {
    0%   { transform: rotateX(-25deg) rotateY(45deg); }
    100% { transform: rotateX(-25deg) rotateY(405deg); }
}

.brand-3d-cube-face {
    position: absolute;
    width: 60px;
    height: 60px;
    backface-visibility: hidden;
    border-radius: 4px;
}

.brand-3d-cube-front {
    transform: translateZ(30px);
    background: rgba(99, 102, 241, 0.22);
    border: 1px solid rgba(4, 133, 247, 0.28);
}

.brand-3d-cube-right {
    transform: rotateY(90deg) translateZ(30px);
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(4, 133, 247, 0.20);
}

.brand-3d-cube-top {
    transform: rotateX(90deg) translateZ(30px);
    background: rgba(99, 102, 241, 0.30);
    border: 1px solid rgba(4, 133, 247, 0.35);
}

.brand-3d-card-wrap {
    bottom: 200px;
    right: 80px;
    animation: float3d 7s ease-in-out 1s infinite;
}

.brand-3d-card {
    width: 90px;
    height: 56px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(4, 133, 247, 0.08));
    border: 1px solid rgba(4, 133, 247, 0.22);
    border-radius: 10px;
    box-shadow:
            0 20px 40px rgba(4, 133, 247, 0.10),
            0 8px 16px rgba(0, 0, 0, 0.03);
    animation: cardFloat3d 6s ease-in-out infinite;
}

.brand-3d-card::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    height: 3px;
    background: rgba(4, 133, 247, 0.2);
    border-radius: 2px;
}

.brand-3d-card::after {
    content: '';
    position: absolute;
    top: 22px;
    left: 12px;
    width: 40px;
    height: 3px;
    background: rgba(4, 133, 247, 0.12);
    border-radius: 2px;
}

@keyframes float3d {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes cardFloat3d {
    0%, 100% {
        transform: perspective(800px) rotateY(-12deg) rotateX(5deg) translateY(0);
    }
    50% {
        transform: perspective(800px) rotateY(-12deg) rotateX(5deg) translateY(-6px);
    }
}

/* ========== Login Card ========== */
.login-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 48px;
    box-shadow: var(--shadow-card-md), var(--shadow-card-lg);
    z-index: 2;
    animation: fadeSlideRight 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s both;
}

/* ========== Card Content ========== */
#form_login {
    position: relative;
}

.card-heading {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.29;
    letter-spacing: -0.5px;
    animation: fadeSlideUp 0.5s ease 0.5s both;
}

.card-subtitle {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-muted);
    margin: 0 0 28px 0;
    line-height: 1.47;
    animation: fadeSlideUp 0.5s ease 0.58s both;
}

/* ========== Form ========== */
#loginForm {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeSlideUp 0.5s ease both;
}
.form-group:nth-child(1) { animation-delay: 0.66s; }
.form-group:nth-child(2) { animation-delay: 0.74s; }
.form-group:nth-child(3) { animation-delay: 0.82s; }
.form-group:nth-child(4) { animation-delay: 0.90s; }

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.75;
    line-height: 1.38;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 8px;
    padding: 0 14px;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-focus);
    background: #FFFFFF;
}

.input-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.input-wrapper:focus-within .input-icon {
    color: var(--accent);
}

.input-wrapper input {
    flex: 1;
    height: 100%;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    /* 移动端防止 iOS 自动缩放 */
    font-size: 16px;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.input-wrapper:focus-within input::placeholder {
    opacity: 0.7;
}

/* Clear / toggle buttons inside input（SVG 矢量按钮，替代原低分辨率位图） */
.input-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
}
.input-clear svg {
    width: 14px;
    height: 14px;
}
.input-clear:hover {
    color: var(--text-primary);
    background: rgba(100, 116, 139, 0.10);
}

#username {
    padding-right: 32px;
}

#password_span, #captcha_span {
    flex: 1;
    display: flex;
    min-width: 0;
}
#password_span input, #captcha_span input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 100%;
    font-size: 16px; /* 移动端 16px 防止 iOS 自动缩放 */
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-sans);
}
#password_span input::placeholder, #captcha_span input::placeholder {
    color: var(--text-muted);
    opacity: 0.4;
}

.input-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    margin-left: 6px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.input-toggle svg {
    width: 18px;
    height: 18px;
}
/* 两个状态的图标互斥显示：默认"隐藏密码"（划线眼睛），.show 时"显示密码"（睁眼） */
.input-toggle .icon-eye { display: none; }
.input-toggle .icon-eye-off { display: block; }
.input-toggle.show .icon-eye { display: block; }
.input-toggle.show .icon-eye-off { display: none; }
.input-toggle:hover {
    color: var(--accent);
    background: rgba(4, 133, 247, 0.08);
}
.input-wrapper:focus-within .input-toggle {
    color: var(--accent);
}

.input-captcha {
    flex-shrink: 0;
    height: 44px;
    cursor: pointer;
    border-radius: 4px;
    margin-left: 8px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.input-captcha:hover { opacity: 1; }

/* ========== Nice Select ========== */
.nice-select {
    padding: 0 38px 0 14px;
    cursor: pointer;
    background: var(--bg-input);
    position: relative;
}
/* 下拉箭头：CSS 绘制（替代原位图，视网膜屏更锐利） */
.nice-select::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--text-muted);
    border-bottom: 1.5px solid var(--text-muted);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.2s ease, border-color 0.2s ease;
    pointer-events: none;
}
.nice-select.open::after {
    transform: translateY(-30%) rotate(225deg);
    border-color: var(--accent);
}
.nice-select:hover {
    background-color: #EEEEF0;
}
.nice-select:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-focus);
    background: #FFFFFF;
}
.nice-select.open {
    border-radius: 8px 8px 0 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-focus);
}
.nice-select input {
    background: none;
    cursor: pointer;
    margin: 0;
    padding: 0 22px 0 0;
    border: none;
    font-size: 16px; /* 移动端防缩放 */
}
.nice-select ul {
    position: absolute;
    left: -1px;
    top: 100%;
    right: -1px;
    display: none;
    background: #FFFFFF;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--accent);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    margin: 0;
    padding: 0;
    list-style: none;
}
.nice-select ul li {
    height: 44px; /* 移动端更大的点击目标 */
    line-height: 44px;
    padding: 0 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: background-color 0.15s ease;
}
.nice-select ul li:hover {
    background-color: #F1F5F9;
}
.nice-select ul li.on {
    background-color: #EFF6FF;
    color: var(--accent);
}

/* ========== Options Row ========== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
    animation: fadeSlideUp 0.5s ease 0.98s both;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    opacity: 0.6;
    -webkit-tap-highlight-color: transparent;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1px solid var(--border-card);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer;
    accent-color: var(--accent);
}

.check-label {
    line-height: 1.38;
}

.forgot-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.forgot-link:hover {
    color: var(--accent-hover);
    opacity: 0.85;
}

/* ========== Login Button ========== */
.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    background: var(--accent-grad);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 8px 22px var(--accent-shadow);
    margin-top: 4px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    animation: fadeSlideUp 0.5s ease 1.06s both;
}
.login-btn:hover {
    background: var(--accent-grad);
    box-shadow: 0 12px 30px var(--accent-shadow);
    transform: translateY(-1px) scale(1.01);
    filter: brightness(1.08);
    animation-name: fadeSlideUp, none;
}
.login-btn:active {
    transform: translateY(0) scale(0.99);
    box-shadow: 0 4px 14px var(--accent-shadow);
}
.login-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- 登录中状态 ---------- */
/* 点下去到页面跳转之间是同步请求，主线程被占住，这里补上转圈 + 文案，避免"点了没反应" */
.login-btn .btn-spinner {
    display: none;
    box-sizing: border-box;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: loginSpin 0.7s linear infinite;
}
.login-btn.is-loading {
    background: var(--accent-grad);
    cursor: default;
    pointer-events: none;
    transform: none;
    filter: brightness(0.94);
    box-shadow: 0 4px 14px var(--accent-shadow);
}
.login-btn.is-loading .btn-spinner {
    display: inline-block;
}
@keyframes loginSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== Card Footer ========== */
.card-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin: 28px 0 0 0;
    opacity: 0.45;
    line-height: 1.5;
    animation: fadeIn 0.5s ease 1.14s both;
}

/* ========== Page Footer ========== */
.page-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.45;
    line-height: 1.5;
    padding: 16px 0 0;
    /* 移动端安全区域 */
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}
.page-footer a {
    color: var(--text-muted);
}

/* ========== Custom Modal (for forgot password) ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease both;
}
.modal-box {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 32px 36px 28px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12), 0 4px 16px rgba(15, 23, 42, 0.08);
    text-align: center;
    animation: fadeSlideUp 0.25s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.modal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(4, 133, 247, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
}
.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}
.modal-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 24px;
    line-height: 1.5;
}
.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 40px;
    padding: 0 24px;
    background: var(--accent-grad);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px var(--accent-shadow);
    -webkit-tap-highlight-color: transparent;
}
.modal-btn:hover {
    box-shadow: 0 6px 18px var(--accent-shadow);
    transform: translateY(-1px);
    filter: brightness(1.06);
}
.modal-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--accent-shadow);
}

/* 双按钮：确认/取消 横向排列 */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 4px;
}
/* 两个按钮在弹窗内等分、可收缩，避免窄屏（如手机）溢出 */
.modal-actions .modal-btn {
    min-width: 0;
    flex: 1 1 0;
    padding: 0 16px;
}
/* 次按钮（取消）：白底描边，与主按钮（accent 渐变）形成主次对比 */
.modal-btn-secondary {
    background: #FFFFFF;
    color: var(--text-primary, #1e293b);
    border: 1px solid var(--border, #e2e8f0);
    box-shadow: none;
}
.modal-btn-secondary:hover {
    background: #f8fafc;
    color: var(--accent, #6366f1);
    border-color: var(--accent, #6366f1);
    transform: translateY(-1px);
    filter: none;
    box-shadow: none;
}
.modal-btn-secondary:active {
    transform: translateY(0);
}

/* ========== Scan Login ========== */
.scan-login-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    overflow: hidden;
    background: url(/img/qrScanLogin.svg) no-repeat top right;
    background-size: 100%;
    z-index: 2;
}

.wx-form-link {
    position: absolute;
    top: 21px;
    right: 19px;
    color: var(--accent);
    font-size: 14px;
}

/* ========== Messages ========== */
.isa_info, .isa_success, .isa_warning, .isa_error {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 480px;
    padding: 14px 20px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10), 0 1px 4px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: msgSlideDown 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    border: 1px solid transparent;
}

@keyframes msgSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.isa_info {
    color: #1E40AF;
    background: rgba(219, 234, 254, 0.88);
    border-color: rgba(147, 197, 253, 0.5);
}
.isa_success {
    color: #166534;
    background: rgba(220, 252, 231, 0.88);
    border-color: rgba(134, 239, 172, 0.5);
}
.isa_warning {
    color: #92400E;
    background: rgba(254, 243, 199, 0.88);
    border-color: rgba(252, 211, 77, 0.5);
}
.isa_error {
    color: #991B1B;
    background: rgba(254, 226, 226, 0.88);
    border-color: rgba(252, 165, 165, 0.5);
}

.isa_info svg, .isa_success svg, .isa_warning svg, .isa_error svg,
.isa-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.8;
}

/* 移动端适配 */
@media screen and (max-width: 480px) {
    .isa_info, .isa_success, .isa_warning, .isa_error {
        top: 12px;
        left: 12px;
        right: 12px;
        transform: none;
        max-width: none;
        padding: 12px 16px;
        font-size: 13px;
        border-radius: 8px;
    }

    @keyframes msgSlideDown {
        from {
            opacity: 0;
            transform: translateY(-12px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ========== Responsive ========== */

/* ---------- 平板竖屏 / 小笔记本 ---------- */
@media screen and (max-width: 1024px) {
    .brand-area {
        flex: 0 0 48%;
        padding: 0 40px 0 50px;
    }
    .brand-area::after {
        width: 70px;
    }
    .brand-area::before {
        right: -30px;
        width: 100px;
    }
    .brand-title {
        font-size: 40px;
    }
    .login-area {
        flex: 0 0 52%;
        padding: 20px 20px 20px 60px;
    }

    .login-card {
        padding: 36px;
        max-width: 400px;
    }

    .brand-geo-circle-1 { left: 60px; top: 60px; }
    .brand-geo-circle-2 { left: 60px; top: 132px; }
    .brand-geo-line     { left: 60px; top: 168px; }

    .brand-3d-cube-wrap { bottom: 60px; right: 60px; }
    .brand-3d-cube, .brand-3d-cube-face { width: 48px; height: 48px; }
    .brand-3d-cube-front { transform: translateZ(24px); }
    .brand-3d-cube-right { transform: rotateY(90deg) translateZ(24px); }
    .brand-3d-cube-top   { transform: rotateX(90deg) translateZ(24px); }
    .brand-3d-card-wrap  { bottom: 140px; right: 40px; }
    .brand-3d-card { width: 72px; height: 46px; }
}

/* ---------- 平板横屏 / 大手机横屏 ---------- */
@media screen and (max-width: 820px) {
    .login-wrapper {
        flex-direction: column;
    }

    .brand-area {
        flex: 0 0 auto;
        padding: 40px 32px 24px;
        text-align: center;
        align-items: center;
        clip-path: none;
    }

    /* 纵向布局下斜切分割无意义，关闭登录区填充三角与光带 */
    .brand-title {
        font-size: 36px;
    }
    .brand-desc {
        font-size: 14px;
    }

    .brand-geo-circle-1 { left: 32px; top: 24px; width: 48px; height: 48px; }
    .brand-geo-circle-2 { left: 32px; top: 84px; width: 18px; height: 18px; }
    .brand-geo-line     { left: 32px; top: 110px; width: 48px; }

    .brand-3d-cube-wrap { bottom: 30px; right: 32px; }
    .brand-3d-cube, .brand-3d-cube-face { width: 36px; height: 36px; }
    .brand-3d-cube-front { transform: translateZ(18px); }
    .brand-3d-cube-right { transform: rotateY(90deg) translateZ(18px); }
    .brand-3d-cube-top   { transform: rotateX(90deg) translateZ(18px); }
    .brand-3d-card-wrap  { bottom: 90px; right: 24px; }
    .brand-3d-card { width: 56px; height: 36px; }
    .brand-3d-card::before { top: 8px; left: 8px; right: 8px; }
    .brand-3d-card::after  { top: 16px; left: 8px; width: 28px; }

    /* 竖屏时品牌区取消斜切 */
    .brand-area::after,
    .brand-area::before {
        display: none;
    }

    .login-area {
        flex: 1;
        padding: 16px 20px 32px;
        align-items: flex-start;
    }
    .login-card {
        max-width: 100%;
        padding: 36px 28px;
        border-radius: 16px;
    }

    .card-heading {
        font-size: 24px;
    }
    .card-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .login-btn {
        height: 48px;
        font-size: 15px;
    }

    /* 页脚移到卡片内部，文档流自然排列 */
    .page-footer {
        position: static;
        width: 100%;
        padding: 16px 0 0;
        background: transparent;
        font-size: 12px;
    }
}

/* ---------- 手机竖屏 (主流手机) ---------- */
@media screen and (max-width: 480px) {
    .brand-area {
        padding: 32px 20px 16px;
    }
    .brand-title {
        font-size: 28px;
        letter-spacing: -0.5px;
    }
    .brand-desc {
        font-size: 13px;
    }

    .brand-geo-circle-1 { left: 20px; top: 20px; width: 40px; height: 40px; }
    .brand-geo-circle-2 { left: 20px; top: 70px; width: 14px; height: 14px; }
    .brand-geo-line     { left: 20px; top: 92px; width: 40px; }

    .brand-3d-cube-wrap,
    .brand-3d-card-wrap { display: none; }

    .login-area {
        padding: 8px 12px 24px;
    }
    .login-card {
        padding: 28px 18px;
    }

    .card-heading {
        font-size: 22px;
    }

    #loginForm {
        gap: 16px;
    }

    .form-group {
        gap: 6px;
    }

    .form-group label {
        font-size: 12px;
    }

    .input-wrapper {
        height: 46px;
        padding: 0 12px;
        border-radius: 6px;
    }

    .input-wrapper input {
        font-size: 16px; /* 移动端 16px 防止 iOS 自动缩放 */
    }

    .login-btn {
        height: 46px;
        font-size: 15px;
        letter-spacing: 3px;
    }

    .form-options {
        font-size: 12px;
    }

    .scan-login-btn {
        width: 48px;
        height: 48px;
        background-size: 100%;
    }
}

/* ---------- 小屏手机 (iPhone SE / 320-374px) ---------- */
@media screen and (max-width: 374px) {
    .brand-area {
        padding: 24px 16px 12px;
    }
    .brand-title {
        font-size: 24px;
    }
    .brand-desc {
        font-size: 12px;
    }

    .brand-geo-circle-1 { left: 16px; top: 16px; width: 32px; height: 32px; }
    .brand-geo-circle-2 { left: 16px; top: 56px; width: 12px; height: 12px; }
    .brand-geo-line     { left: 16px; top: 76px; width: 32px; }

    .brand-3d-cube-wrap,
    .brand-3d-card-wrap { display: none; }

    .login-area {
        padding: 6px 8px 20px;
    }
    .login-card {
        padding: 24px 14px;
        border-radius: 12px;
    }

    .card-heading {
        font-size: 20px;
    }
    .card-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .input-wrapper {
        height: 44px;
    }

    .login-btn {
        height: 44px;
        font-size: 14px;
    }
}
