/**
 * 登录/注册页面样式 - App-like Design
 * 特点：全屏融合、无边框、紧凑布局
 */

/* 登录页面禁止全局滚动 */
html:has(.login-container),
html:has(.login-container) body {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
}

/* 登录页面时隐藏外层容器的滚动 */
.login-container~*,
body:has(.login-container) .app-container {
    overflow: hidden !important;
}

/* ========== 背景容器 - 全屏无边框 ========== */
.login-container {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    /* 渐变首尾与全局背景 #0D0D0D 一致，无缝融合 */
    background: linear-gradient(180deg, #0D0D0D 0%, #141420 30%, #1a1a2e 50%, #141420 70%, #0D0D0D 100%);
    position: relative;
    overflow: hidden;
}

/* 动态光效背景 - 远离顶部边缘 */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 光效位置避开顶部和底部，只在中间区域 */
    background:
        radial-gradient(ellipse 60% 40% at 50% 35%, rgba(255, 224, 51, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 50% 35% at 25% 60%, rgba(147, 51, 234, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 75% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    animation: backgroundPulse 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* 浮动装饰圆点 - 简化 */
.login-container::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(255, 224, 51, 0.08) 0px, transparent 3px),
        radial-gradient(circle at 85% 30%, rgba(147, 51, 234, 0.1) 0px, transparent 2px),
        radial-gradient(circle at 70% 80%, rgba(255, 224, 51, 0.06) 0px, transparent 4px);
    pointer-events: none;
}

/* ========== 登录卡片 - 无边框融合 ========== */
.login-card {
    width: 100%;
    max-width: 400px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    padding: 24px 28px;
    box-shadow: none;
    position: relative;
    z-index: 1;
    animation: cardFadeIn 0.5s ease-out;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

/* 移除顶部光泽 */
.login-card::before {
    display: none;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 头部区域 - 紧凑化 ========== */
.login-header {
    text-align: center;
    margin-bottom: 16px;
}

.login-logo {
    font-size: 40px;
    margin-bottom: 6px;
    display: inline-block;
    animation: logoFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(255, 224, 51, 0.15));
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.login-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 2px;
    letter-spacing: -0.3px;
}

.login-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
    font-weight: 400;
}

/* ========== 表单区域 - 紧凑化 ========== */
.login-form {
    margin-bottom: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
    letter-spacing: 0.2px;
}

/* 输入框 - 紧凑风格 */
.form-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 15px;
    color: #ffffff;
    text-align: left;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    box-shadow: none;
}

.form-input:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.form-input:focus {
    outline: none;
    border-color: rgba(255, 224, 51, 0.4);
    background: rgba(255, 224, 51, 0.02);
    box-shadow: 0 0 0 3px rgba(255, 224, 51, 0.08);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: normal;
    font-weight: 400;
}

/* 表单提示 */
.form-hint {
    display: none;
    font-size: 12px;
    margin-top: 4px;
    text-align: center;
    transition: all 0.2s ease;
}

.form-hint.success,
.form-hint.error {
    display: block;
}

.form-hint.success {
    color: #4ade80;
}

.form-hint.error {
    color: #f87171;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

/* ========== 登录按钮 - 简洁风格 ========== */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #0a0a12;
    background: linear-gradient(135deg, #FFE033 0%, #FFC800 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(255, 224, 51, 0.25);
    margin-top: auto;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 30px rgba(255, 224, 51, 0.4),
        0 4px 12px rgba(255, 200, 0, 0.5);
}

.btn-login:hover::before {
    left: 100%;
}

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

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

/* ========== 底部区域 - 紧凑化 ========== */
.login-footer {
    text-align: center;
    padding-top: 16px;
    padding-bottom: env(safe-area-inset-bottom, 16px);
    border-top: none;
    margin-top: 12px;
}

.login-tip {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.login-tip strong {
    color: #FFE033;
    font-weight: 600;
}

.login-link {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.link-primary {
    color: #FFE033;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.link-primary::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #FFE033;
    transition: width 0.3s ease;
}

.link-primary:hover {
    color: #fff;
}

.link-primary:hover::after {
    width: 100%;
}

.forgot-password {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 6px;
}

.login-brand {
    margin-top: 12px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.5px;
}

/* ========== 额度组件 ========== */
.quota-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 224, 51, 0.1);
    border: 1px solid rgba(255, 224, 51, 0.25);
    border-radius: 100px;
    font-size: 13px;
    color: #FFE033;
    font-weight: 500;
}

.quota-badge.low {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.25);
    color: #f87171;
}

.quota-warning {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.1), rgba(248, 113, 113, 0.05));
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
}

.quota-warning-title {
    font-size: 15px;
    font-weight: 600;
    color: #f87171;
    margin: 0 0 6px;
}

.quota-warning-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* ========== 响应式适配 ========== */
@media (max-width: 440px) {
    .login-card {
        padding: 32px 20px 20px;
    }

    .login-logo {
        font-size: 36px;
    }

    .login-title {
        font-size: 18px;
    }

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

    .form-input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .btn-login {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* 超小屏幕优化（如 iPhone SE） */
@media (max-height: 600px) {
    .login-card {
        padding-top: 24px;
    }

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

    .login-logo {
        font-size: 32px;
        margin-bottom: 4px;
    }

    .login-title {
        font-size: 16px;
    }

    .login-subtitle {
        font-size: 11px;
    }

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

    .form-group label {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .form-input {
        padding: 8px 10px;
        font-size: 14px;
        border-radius: 10px;
    }

    .btn-login {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 10px;
    }

    .login-footer {
        padding-top: 12px;
        margin-top: 8px;
    }

    .login-tip {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .login-link {
        font-size: 12px;
    }
}

/* ========== 记住密码复选框 ========== */
.remember-group {
    display: flex !important;
    align-items: center;
    margin-bottom: 12px;
    margin-top: 4px;
}

.remember-group .remember-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease;
    margin-bottom: 0;
    pointer-events: auto;
}

.remember-group .remember-label:hover {
    color: rgba(255, 255, 255, 0.8);
}

.remember-group .remember-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #FFE033;
    cursor: pointer;
    border-radius: 4px;
    pointer-events: auto;
    -webkit-appearance: checkbox;
    appearance: checkbox;
}