/* ============================================
   登录页面样式
   ============================================ */

.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 40%, #2a1810 100%);
}

.login-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 100, 50, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(50, 100, 255, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    position: relative;
    width: 420px;
    max-width: 90vw;
    background: rgba(20, 25, 40, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 140, 60, 0.15);
    border-radius: 16px;
    padding: 40px 36px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 80px rgba(255, 100, 50, 0.05);
}

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

.login-logo {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(255, 120, 50, 0.3));
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: #f0f0f5;
    margin: 0 0 6px;
    letter-spacing: 1px;
}

.login-subtitle {
    font-size: 13px;
    color: #8a8aa0;
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-field {
    position: relative;
}

.login-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.5;
    pointer-events: none;
}

.login-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e8;
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.login-input:focus {
    outline: none;
    border-color: rgba(255, 140, 60, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.login-input::placeholder {
    color: #5a5a70;
}

.login-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #e85d2a 0%, #c44518 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    letter-spacing: 2px;
    margin-top: 4px;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(232, 93, 42, 0.3);
}

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

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

.login-error {
    background: rgba(230, 60, 60, 0.12);
    border: 1px solid rgba(230, 60, 60, 0.25);
    border-radius: 8px;
    padding: 10px 14px;
    color: #ff8080;
    font-size: 13px;
    text-align: center;
    display: none;
}

.login-error.show {
    display: block;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.login-hint {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    color: #6a6a80;
    text-align: center;
    line-height: 1.8;
}

.login-hint code {
    color: #e0a070;
    background: rgba(255, 140, 60, 0.08);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
}

/* 登录验证中状态 (防止用户误操作) */
.login-verifying {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0 0;
    gap: 12px;
}

.login-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 140, 60, 0.15);
    border-top-color: #e85d2a;
    border-radius: 50%;
    animation: login-spin 0.8s linear infinite;
}

@keyframes login-spin {
    to { transform: rotate(360deg); }
}

.login-verifying-text {
    font-size: 14px;
    color: #d0d0e0;
    margin: 0;
    font-weight: 500;
}

.login-verifying-sub {
    font-size: 12px;
    color: #6a6a80;
    margin: 0;
}

/* 登录后用户信息区域 */
.user-info-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.user-info-area:hover {
    background: rgba(255, 140, 60, 0.1);
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e85d2a, #c44518);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    color: #d0d0e0;
    white-space: nowrap;
}

.user-role-tag {
    font-size: 10px;
    color: #8a8aa0;
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 6px;
    border-radius: 3px;
}

.user-dropdown {
    position: absolute;
    top: 38px;
    right: 0;
    width: 180px;
    background: rgba(30, 35, 50, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    display: none;
    overflow: hidden;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-item {
    padding: 10px 16px;
    font-size: 13px;
    color: #c0c0d0;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.user-dropdown-item.danger {
    color: #ff8080;
}

.user-dropdown-item.danger:hover {
    background: rgba(230, 60, 60, 0.1);
}

.user-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 4px 0;
}

/* 隐藏主界面（未登录时） */
.app-locked #app {
    display: none !important;
}

/* 确保登录遮罩无法被绕过 */
.app-locked .login-overlay {
    display: flex !important;
    pointer-events: all !important;
}

/* 防止任何元素从登录遮罩上方穿透 */
.app-locked .hero-banner,
.app-locked .main-wrapper,
.app-locked .sidebar,
.app-locked .nav-item {
    display: none !important;
}

/* 登录遮罩确保全屏覆盖，阻止滚动和交互 */
body.app-locked {
    overflow: hidden !important;
    height: 100vh !important;
}
