* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-active: #1e40af;
    --primary-500: #3b82f6;
    --primary-700: #1d4ed8;
    --text-900: #0f172a;
    --text-700: #334155;
    --text-500: #64748b;
    --text-400: #94a3b8;
    --text-primary: #0f172a;
    --border-light: #e2e8f0;
    --border-default: #e2e8f0;
    --border-medium: #cbd5e1;
    --success: #16a34a;
    --success-border: #bbf7d0;
    --error: #dc2626;
    --error-border: #fecaca;
    --primary-border: #bfdbfe;
    --radius-md: 8px;
    --radius-xl: 16px;
    --font-size-sm: 14px;
    --font-size-base: 15px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0ff 35%, #f0f5ff 70%, #eef2ff 100%);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation: float 8s ease-in-out infinite;
}

.circle-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 65%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
    animation-duration: 10s;
}

.circle-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 65%);
    bottom: -150px;
    left: -150px;
    animation-delay: 2s;
    animation-duration: 12s;
}

.circle-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.3) 0%, transparent 65%);
    top: 45%;
    left: 5%;
    animation-delay: 4s;
    animation-duration: 15s;
}

.circle-4 {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.2) 0%, transparent 65%);
    top: 15%;
    right: 15%;
    border-radius: 50%;
    animation: float 9s ease-in-out infinite;
    animation-delay: 1s;
}

.circle-5 {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(191, 219, 254, 0.4) 0%, transparent 65%);
    bottom: 25%;
    right: 8%;
    border-radius: 50%;
    animation: float 11s ease-in-out infinite;
    animation-delay: 3s;
}

.grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

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

.login-card {
    position: relative;
    z-index: 10;
    background: white;
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.15);
    border: 1px solid var(--border-light);
    animation: cardIn 0.5s ease;
}

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

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 20px -5px rgba(59, 130, 246, 0.35);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 18px;
}

.login-header h1 {
    /* V1716：h1 保留平台名「景沫数元标注平台」作二级灰字标题（跨页标题引用约束：register.js 从 /login <title> 提取平台名，h1 文本须与 <title> 后半段一致） */
    font-size: 15px;
    font-weight: 500;
    color: var(--text-500);
    text-align: center;
    margin-bottom: 0;
    letter-spacing: -0.5px;
}

/* V1716：新增一级标题「欢迎登录」（独立 .welcome-title 元素，不再占用 h1）27px 粗体深色居中 */
.welcome-title {
    font-size: 27px;
    font-weight: 700;
    color: var(--text-900);
    text-align: center;
    margin-bottom: 8px;
}

/* V1716：头部第二行副标题（平台名「景沫数元标注平台」）15px 灰字，继承 .login-header 居中 */
.subtitle {
    font-size: 15px;
    color: var(--text-500);
    font-weight: 400;
    margin-top: 6px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-700);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: all var(--transition-fast);
    background: white;
    color: var(--text-primary);
}

.form-group input:hover {
    border-color: var(--border-medium);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-400);
}

.form-group:last-of-type {
    position: relative;
}

.show-password {
    position: absolute;
    right: 12px;
    top: calc(50% + 10px);
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'%3E%3C/path%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.show-password:hover { opacity: 0.8; }
.show-password.active { opacity: 1; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
    height: 46px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    justify-content: center;
    width: 100%;
    border-radius: 10px;
    letter-spacing: 2px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-block {
    width: 100%;
}

.btn-text { 
    display: inline !important; 
    color: white !important;
}
.btn-loading { display: none; }

.toast {
    /* V1746：定位从视口 fixed 改为卡片内 absolute（toast div 已移入 .login-card，卡片 position:relative，top/left 50% 即相对卡片居中）；transform 动画与 .show 逻辑原样保留 */
    /* V1747：空 toast 为透明 200px×24px 块且 z-index:50，absolute 居中压在卡片正中——正好盖住账号框中间条带，导致账号框上下可点、中间无法放置光标；toast 纯提示无需交互，全程 pointer-events:none 穿透，不拦截输入框点击 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-10px);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 50;
    min-width: 200px;
    text-align: center;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.toast.success {
    color: #16a34a !important;
}

.toast.error {
    color: #dc2626 !important;
}

.toast.info {
    color: #2563eb !important;
}

@media (max-width: 480px) {
    .login-card {
        padding: 36px 24px;
        margin: 16px;
    }
    
    .login-header h1 {
        font-size: 22px;
    }
}


/* ================= V1702：v2-A 纯白极简左右分栏 ================= */
/* V1713：body 背景换为登录背景图，全屏 cover 铺满，保留 #f8fafc 底色兜底 */
body {
    background: #f8fafc url('../assets/login-bg.png') no-repeat center center / cover;
    overflow: auto;
}

/* 关闭旧版满屏渐变背景与装饰圆（v2-A 纯白极简） */
body::before { display: none; }
.login-bg-decoration { display: none; }

/* V1748：登录页加载遮罩——背景图 login-bg.png 约 1.96MB，加载期间若直接显示会逐行渐进露出很难看；遮罩先全屏遮挡（底色 #f8fafc 与 body 兜底色一致），JS 预加载图片完成后加 .hide 淡出并释放交互（见 index.html 内联 script） */
.login-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}
.login-loader.hide {
    opacity: 0;
    pointer-events: none;
}
/* V1756：遮罩中间改 CSS 转圈加载动画（替代被 CherryPy 404 的 ../logo-256.png；纯样式无资源请求）——40px 圆、3.5px border 半透明底 + 顶部主题蓝、0.8s 线性无限旋转 */
.login-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3.5px solid rgba(59, 130, 246, 0.15);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: login-spin 0.8s linear infinite;
}
@keyframes login-spin {
    to { transform: rotate(360deg); }
}

.login-page {
    display: flex;
    min-height: 100vh;
}

/* 左侧品牌区（V1719：用户验收修正——恢复左右分栏，左侧透明占位约 50% 宽，背景图透过显示、左端主体不遮挡；卡片落在右半区内居中） */
.brand-panel {
    display: flex;
    flex: 0 0 50%;
    background: transparent;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* V1713：隐藏内嵌 SVG 插画，登录主体改由背景图呈现 */
.brand-illustration {
    display: none;
    width: 100%;
    max-width: 440px;
}

.brand-illustration svg {
    width: 100%;
    height: auto;
    display: block;
}

/* 登录区（V1719：容器即右半区 50% 宽，卡片在右半区内水平+垂直居中，中心约 75% 视口宽度） */
.login-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    padding: 20px;
}

/* V1713：白底保留，加深阴影保证卡片压在背景图上时仍可读、可分辨 */
.login-panel .login-card {
    max-width: 400px;
    width: 100%;
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25);
    padding: 40px 36px;
    /* V1744：登录卡片整体上移约 120px（用户给定范围 100~150px 取中值，如仍需微调可再调）；用负 margin 而非 transform:translateY——后者与 cardIn 动画 transform 冲突会被吞掉；flex align-items:center 下负 margin 正常上移 */
    margin-top: -120px;
}

.login-header {
    margin-bottom: 28px;
}

/* V1719：撤掉"记住密码"功能——已清理 .login-options / .remember-label 全部样式（DOM 节点已从 index.html 删除，无引用残留） */

/* V1730：协议功能临时停用——已清理 .agreement-row 全部样式（DOM 节点已从 index.html 删除，无引用残留；后续恢复时连同 agreement-row 结构一并恢复） */

/* 登录按钮 disabled 态（协议未勾选时置灰） */
.btn-primary:disabled {
    background: #e2e8f0 !important;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
    transform: none;
}

/* 窄屏：隐藏品牌区，卡片居中且可读（V1713：login-panel 透明居中、右留白 20px；卡片保留白底+阴影） */
@media (max-width: 900px) {
    .brand-panel { display: none; }
    .login-panel { flex: 1; justify-content: center; background: transparent; padding: 20px; }
    .login-panel .login-card { background: #ffffff; box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25); margin-top: 0; /* V1744：窄屏恢复垂直居中，避免卡片上移后顶部溢出/裁切 */ }
}

/* V1716：标题/标签文字不可选中、指针保持默认箭头（消除点击出现文本光标的误感；label for 聚焦行为保留；V1716 补：覆盖新增一级标题 .welcome-title） */
.login-header h1,
.login-header .welcome-title,
.login-header .subtitle,
.form-group label {
    user-select: none;
    cursor: default;
}

/* ================= V1724：站内协议/隐私政策弹窗 ================= */
/* 半透明遮罩 + 居中白卡，沿用 v1034/v1175 弹窗风格；内容区 iframe 内嵌 agreement.html / privacy.html */
.v1724-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: none; align-items: center; justify-content: center; z-index: 9999; }
.v1724-mask.show { display: flex; }
.v1724-box { width: 560px; max-width: calc(100vw - 32px); background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.2); overflow: hidden; display: flex; flex-direction: column; max-height: 80vh; }
.v1724-head { padding: 20px 24px 12px; }
.v1724-title { font-size: 18px; font-weight: 600; color: #1f2937; }
.v1724-body { flex: 1; min-height: 200px; padding: 8px 24px; }
.v1724-frame { width: 100%; height: 52vh; border: none; display: block; }
.v1724-foot { padding: 12px 24px 20px; display: flex; justify-content: flex-end; }
.v1724-btn { padding: 9px 18px; border-radius: 8px; font-size: 14px; cursor: pointer; border: 1px solid #d1d5db; background: #fff; color: #374151; }
.v1724-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* V1732：Chrome 自动填充兼容——白底遮黄 + 文字色 + 过渡（消除填充区点击异常与黄底） */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    -webkit-text-fill-color: #111827;
    transition: background-color 9999s ease-in-out 0s;
}
