/* =====================================================
   登录页面专用样式 - 暗黑双面板布局
   左侧：广告展示区 / 动态渐变背景
   右侧：登录组件区（微信扫码 / 手机验证码 / 密码）
   ===================================================== */

/* ==================== CSS 变量 ==================== */
:root {
    --login-bg: #050505;
    --panel-bg: rgba(25, 25, 25, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-glow: rgba(124, 58, 237, 0.3);
    --input-bg: #141414;
    --input-border: rgba(255, 255, 255, 0.06);
    --input-focus-border: rgba(124, 58, 237, 0.5);
    --input-focus-bg: #1a1a1a;
    --text-primary: #f5f5f5;
    --text-secondary: #a1a1a1;
    --text-tertiary: #666;
    --text-muted: #555;
    --radius-xl: 28px;
    --radius-lg: 16px;
    --radius-md: 12px;
}

/* ==================== 页面背景 ==================== */
.login-page-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--login-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    overflow: hidden;
    color: var(--text-primary);
}

/* 全局环境氛围光 */
.login-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.login-ambient .glow-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    will-change: transform, opacity;
    pointer-events: none;
}

.login-ambient .glow-blob-1 {
    width: 50vw; height: 50vw;
    background: rgba(88, 28, 135, 0.15);
    top: -20%; left: -10%;
    animation: ambientFloat 20s infinite alternate ease-in-out;
}

.login-ambient .glow-blob-2 {
    width: 40vw; height: 40vw;
    background: rgba(30, 58, 138, 0.12);
    bottom: -10%; right: -5%;
    animation: ambientFloat 25s infinite alternate-reverse ease-in-out;
}

@keyframes ambientFloat {
    0% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    33% { transform: translate(10%, -10%) scale(1.15); opacity: 0.55; }
    66% { transform: translate(-5%, 5%) scale(0.9); opacity: 0.45; }
    100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
}

/* ==================== 主登录卡片 ==================== */
.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1000px;
    height: 600px;
    display: flex;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
}

/* ==================== 左侧展示区 ==================== */
.login-showcase {
    width: 50%;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

/* 动态渐变背景 */
.login-showcase-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(-45deg, #2d1454, #0f2847, #4a1232, #0e3d2a, #2d1454);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 0%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 100%; }
    100% { background-position: 0% 50%; }
}

/* 左侧叠加光球 */
.login-showcase-blobs {
    position: absolute;
    inset: 0;
    opacity: 0.55;
    pointer-events: none;
}

.login-showcase-blobs .blob-1 {
    position: absolute;
    width: 280px; height: 280px;
    background: rgba(147, 51, 234, 0.55);
    border-radius: 50%;
    filter: blur(80px);
    top: -60px; left: -60px;
    animation: blobPulse 8s ease-in-out infinite;
}

.login-showcase-blobs .blob-2 {
    position: absolute;
    width: 320px; height: 320px;
    background: rgba(59, 130, 246, 0.5);
    border-radius: 50%;
    filter: blur(80px);
    bottom: -40px; right: -60px;
    animation: blobPulse 10s ease-in-out infinite 2s;
}

@keyframes blobPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.15); opacity: 0.6; }
}

/* 左侧文字内容 */
.login-showcase-content {
    position: relative;
    z-index: 20;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-sizing: border-box;
}

.login-showcase-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 48px;
}

.login-showcase-brand .brand-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 16px;
    color: #000;
    color: #be00ff;
    font-weight: 900;
}

.login-showcase-brand .brand-text {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.login-showcase-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    margin: 0 0 16px;
}

.login-showcase-desc {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    max-width: 280px;
    margin: 0;
}

.login-showcase-footer {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

/* 左侧柔化覆盖层 */
.login-showcase-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.08);
    pointer-events: none;
    z-index: 10;
}

/* 广告内容展示 */
.login-showcase-ad {
    position: absolute;
    inset: 0;
    z-index: 5;
}

.login-showcase-ad img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-showcase-ad video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-showcase-ad-link {
    display: block;
    width: 100%;
    height: 100%;
}

/* ==================== 右侧登录区 ==================== */
.login-form-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: rgba(10, 10, 10, 0.9);
    box-sizing: border-box;
    overflow-y: auto;
}

.login-form-wrapper {
    width: 100%;
    max-width: 340px;
}

/* 头部标题区 */
.login-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 36px;
}

.login-header-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    margin: 0;
}

.login-header-bar {
    height: 3px;
    width: 32px;
    background: var(--accent);
    border-radius: 2px;
    margin-top: 8px;
}

.login-header-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    transition: color 0.2s;
    white-space: nowrap;
}

.login-header-toggle:hover {
    color: var(--accent);
}

/* Admin 后台标识 */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.admin-badge i {
    font-size: 14px;
}

/* 环境标识 */
.env-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    background: #1a1a1a;
    color: #666;
    font-size: 11px;
    border-radius: 10px;
    border: 1px solid #333;
    vertical-align: middle;
}

/* ==================== 微信扫码区 ==================== */
.wechat-qr-container {
    text-align: center;
    padding: 8px 0;
}

.wechat-icon {
    margin-bottom: 12px;
    color: #07c160;
}

.qr-code-box {
    display: inline-block;
    padding: 16px;
    background: #fff;
    border-radius: 6dvb;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15);
    margin-bottom: 16px;
    position: relative;
}

.qr-code-inner {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
    overflow: hidden;
    position: relative;
}

.qr-code-inner img {
    max-width: 100%;
    max-height: 100%;
}

/* QR loading 转圈 */
.qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #888;
    font-size: 12px;
    position: absolute;
    inset: 0;
    background: #f9f9f9;
    z-index: 5;
    border-radius: 14px;
}

.qr-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--accent, #7c3aed);
    border-radius: 50%;
    animation: qrSpin 0.8s linear infinite;
}

@keyframes qrSpin {
    to { transform: rotate(360deg); }
}

/* 已扫码遮罩 */
.qr-scanned-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 10;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.qr-scanned-hint {
    font-size: 12px;
    font-weight: 400;
    color: #888;
}

/* 已过期遮罩 */
.qr-expired-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 10;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.qr-refresh-btn {
    margin-top: 4px;
    padding: 6px 20px;
    background: var(--accent, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.qr-refresh-btn:hover {
    background: var(--accent-hover, #6d28d9);
}

/* 倒计时文字 */
.qr-countdown-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 4px;
}

.qr-status-text {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 4px;
}

.qr-expire-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== 表单样式 ==================== */
.login-form-group {
    margin-bottom: 20px;
}

.login-form-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    margin-left: 2px;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.2s;
    pointer-events: none;
}

.login-input-wrap:focus-within .input-icon {
    color: var(--accent);
}

.login-form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 42px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.login-form-input:focus {
    border-color: var(--input-focus-border);
    background: var(--input-focus-bg);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-form-input::placeholder {
    color: #444;
}

/* 无图标输入框 */
.login-form-input.no-icon {
    padding-left: 16px;
}

/* 验证码行 */
.code-input-row {
    display: flex;
    gap: 10px;
}

.code-input-row .login-input-wrap {
    flex: 1;
}

.send-code-btn {
    height: 48px;
    padding: 0 18px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.send-code-btn:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--input-focus-bg);
    color: #fff;
}

.send-code-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 登录按钮 */
.login-button {
    width: 100%;
    height: 48px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 24px var(--accent-glow);
    margin-top: 6px;
}

.login-button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 12px 32px var(--accent-glow);
}

.login-button:active:not(:disabled) {
    transform: scale(0.98);
}

.login-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==================== 底部信息 ==================== */
.login-footer {
    margin-top: 32px;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.login-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* 开发环境提示 */
.dev-hint {
    margin-top: 16px;
    padding: 10px 14px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    font-size: 12px;
    color: #a78bfa;
}

/* ==================== 消息提示 ==================== */
.error-message,
.success-message {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

/* ==================== 加载动画 ==================== */
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #333;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: loginSpin 0.8s linear infinite;
}

@keyframes loginSpin {
    to { transform: rotate(360deg); }
}

/* ==================== 分割线 ==================== */
.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.login-divider span {
    padding: 0 14px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

/* ==================== 隐藏模式 ==================== */
.hidden-mode {
    display: none !important;
}

/* ==================== 入场动画 ==================== */
.animate-fade-in {
    animation: loginFadeIn 0.5s ease-out forwards;
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 响应式 ==================== */
@media (max-width: 860px) {
    .login-card {
        max-width: 440px;
        height: auto;
        min-height: 500px;
        flex-direction: column;
    }

    .login-showcase {
        display: none;
    }

    .login-form-panel {
        width: 100%;
        padding: 36px 28px;
    }
}
