/* ============================================================
   小逸科技 · 登录页视觉主题 (xy-login.css)
   仅覆盖样式，不改动任何 DOM 结构与逻辑
   背景图：/assets/img/xy-login-bg.jpg
   ============================================================ */

:root {
    --xy-red: #e0342f;
    --xy-red-deep: #8c1410;
    --xy-ink: #0a0a0c;
    --xy-glass: rgba(18, 18, 21, 0.62);
    --xy-line: rgba(255, 255, 255, 0.12);
    --xy-text: #f2f3f5;
    --xy-sub: #9aa0a6;
}

html, body {
    background-color: var(--xy-ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    color: var(--xy-text);
}

body {
    background-image: url('/assets/img/xy-login-bg.jpg');
    background-size: cover;
    background-position: center 16%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: #06070a;
}

/* 压暗遮罩：保证任何分辨率下文字都够清楚 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(6, 6, 8, 0.10) 0%, rgba(6, 6, 8, 0.34) 48%, rgba(6, 6, 8, 0.80) 100%),
        linear-gradient(180deg, rgba(6, 6, 8, 0.35) 0%, rgba(6, 6, 8, 0.05) 34%, rgba(6, 6, 8, 0.72) 100%);
}

/* 顶部细光带 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

/* ---------- 加载层 ---------- */
#pageLoader {
    background: #08080a;
}
.app-loading__loader {
    border-top-color: var(--xy-red);
}
.app-loading__loader:before {
    border-color: rgba(255, 255, 255, 0.12);
}
.app-loading__title {
    color: #8b8f95;
    letter-spacing: 4px;
    font-size: 12px;
}

.top-loading-bar {
    background: rgba(255, 255, 255, 0.08);
}
.loading-progress {
    background: linear-gradient(90deg, var(--xy-red-deep), var(--xy-red), #ff7a6e);
    box-shadow: 0 0 12px rgba(224, 52, 47, 0.65);
}

/* ---------- 布局 ---------- */
.login-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
}

/* ---------- 玻璃登录面板 ---------- */
.login-box {
    position: relative;
    width: 100%;
    max-width: 430px;
    padding: 38px 30px 32px;
    border-radius: 26px;
    background: var(--xy-glass);
    border: 1px solid var(--xy-line);
    box-shadow:
        0 40px 90px rgba(0, 0, 0, 0.62),
        0 2px 0 rgba(255, 255, 255, 0.06) inset,
        0 0 0 1px rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: blur(26px) saturate(135%);
    backdrop-filter: blur(26px) saturate(135%);
    padding-bottom: 58px;
    overflow: hidden;
}

/* 顶部赤红渐隐线 */
.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 14%;
    right: 14%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--xy-red), #ff8b7f, var(--xy-red), transparent);
    opacity: 0.95;
}

/* 面板内极淡的斜向高光 */
.login-box::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -30%;
    width: 70%;
    height: 90%;
    pointer-events: none;
    background: radial-gradient(closest-side, rgba(224, 52, 47, 0.20), transparent 72%);
}

/* ---------- 标题 ---------- */
.login-title {
    position: relative;
    font-size: 1.55rem;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffffff;
    margin-bottom: 10px;
    padding-left: 14px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.login-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    border-radius: 3px;
    background: linear-gradient(180deg, #ff6a5e, var(--xy-red-deep));
    box-shadow: 0 0 14px rgba(224, 52, 47, 0.8);
}

/* 副标题 */
.login-title::after {
    content: 'XIAOYI · SECURE CONSOLE';
    display: block;
    margin-top: 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 3.2px;
    color: rgba(255, 255, 255, 0.34);
    text-shadow: none;
}

/* ---------- 注册链接 ---------- */
.login-link {
    position: absolute;
    left: 22px;
    bottom: 16px;
    display: inline-block;
    margin-top: 0;
    padding: 5px 12px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.62);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    transition: all 0.22s ease;
}

.login-link:hover {
    color: #ffffff;
    border-color: rgba(224, 52, 47, 0.75);
    background: rgba(224, 52, 47, 0.14);
    box-shadow: 0 0 18px rgba(224, 52, 47, 0.25);
}

/* ---------- Tab ---------- */
.login-form {
    margin-top: 26px;
}

.login-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 0 0 22px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.login-tab {
    flex: 1;
    padding: 9px 10px;
    border-radius: 11px;
    font-size: 0.83rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.48);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.24s ease;
}

.login-tab.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(224, 52, 47, 0.92), rgba(120, 16, 12, 0.92));
    box-shadow: 0 8px 22px rgba(224, 52, 47, 0.30), 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.login-tab:hover:not(.active) {
    color: rgba(255, 255, 255, 0.82);
}

/* ---------- 表单 ---------- */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.50);
    margin-bottom: 7px;
}

.form-input {
    width: 100%;
    padding: 13px 15px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.055);
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.22s ease;
    -webkit-appearance: none;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

.form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.085);
    border-color: rgba(224, 52, 47, 0.85);
    box-shadow: 0 0 0 4px rgba(224, 52, 47, 0.14), 0 0 26px rgba(224, 52, 47, 0.16) inset;
}

/* 浏览器自动填充时别变成白底 */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: 0 0 0 1000px #17171a inset;
    caret-color: #ffffff;
}

.password-toggle {
    color: rgba(255, 255, 255, 0.42);
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: rgba(255, 255, 255, 0.85);
}

.form-group.has-error .form-input {
    border-color: rgba(255, 99, 90, 0.85);
    box-shadow: 0 0 0 4px rgba(255, 99, 90, 0.12);
}

.error-message {
    color: #ff8a80;
    font-size: 0.72rem;
    margin-top: 6px;
    letter-spacing: 0.3px;
}

/* ---------- 登录按钮 ---------- */
.login-button {
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    border: none;
    border-radius: 14px;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #ffffff;
    background: linear-gradient(135deg, #3a3a3e, #242427);
    cursor: not-allowed;
    transition: all 0.24s ease;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
}

.login-button.active {
    background: linear-gradient(135deg, #ff4f43 0%, #d0261f 45%, #8c1410 100%);
    cursor: pointer;
    box-shadow: 0 16px 38px rgba(224, 52, 47, 0.42), 0 1px 0 rgba(255, 255, 255, 0.28) inset;
}

.login-button.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 44px rgba(224, 52, 47, 0.52), 0 1px 0 rgba(255, 255, 255, 0.32) inset;
}

.login-button.active:active {
    transform: translateY(0);
}

.login-button.loading {
    background: linear-gradient(135deg, #4a4a4f, #2a2a2e);
    cursor: not-allowed;
}

.login-button.error {
    background: linear-gradient(135deg, #ff5b4f, #b21f18);
    cursor: not-allowed;
}

/* ---------- 通知条 ---------- */
.new-user-toast {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

/* ============================================================
   电脑端：左图右卡
   ============================================================ */
@media (min-width: 900px) {
    body {
        background-position: 24% center;
    }

    body::before {
        background:
            linear-gradient(90deg, rgba(6, 6, 8, 0.00) 0%, rgba(6, 6, 8, 0.10) 42%, rgba(6, 6, 8, 0.62) 66%, rgba(6, 6, 8, 0.90) 100%);
    }

    .login-wrapper {
        justify-content: flex-end;
        align-items: center;
        padding: 40px 6vw 40px 40px;
    }

    .login-box {
        max-width: 432px;
        margin-right: 0;
    }

    /* 电脑端左侧加一段品牌竖排水印，避免左边空掉 */
    .login-wrapper::before {
        content: '小逸科技  ·  XIAOYI CLOUD SERVICE';
        position: absolute;
        left: 4vw;
        bottom: 5vh;
        font-size: 11px;
        letter-spacing: 4px;
        color: rgba(255, 255, 255, 0.42);
        text-transform: uppercase;
        pointer-events: none;
    }
}

@media (min-width: 1400px) {
    .login-wrapper {
        padding-right: 10vw;
    }
    .login-box {
        max-width: 460px;
    }
}

/* ============================================================
   手机端：整屏图 + 底部卡片
   ============================================================ */
@media (max-width: 899px) {
    body {
        background-position: center 12%;
    }

    body::before {
        background:
            linear-gradient(180deg, rgba(6, 6, 8, 0.42) 0%, rgba(6, 6, 8, 0.06) 30%, rgba(6, 6, 8, 0.62) 62%, rgba(6, 6, 8, 0.92) 100%);
    }

    .login-wrapper {
        align-items: flex-end;
        padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
    }

    .login-box {
        max-width: 100%;
        padding: 26px 20px 58px;
        border-radius: 24px;
        background: rgba(14, 14, 17, 0.70);
    }

    .login-title {
        font-size: 1.35rem;
    }

    .login-title::after {
        font-size: 9px;
        letter-spacing: 2.6px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 1rem; /* 防止 iOS 聚焦放大 */
    }
}

@media (max-height: 700px) and (max-width: 899px) {
    .login-box {
        padding: 20px 18px 16px;
    }
    .login-form {
        margin-top: 16px;
    }
    .login-tabs {
        margin-bottom: 14px;
    }
}
