/* 全局禁止文字选择（除输入框外） */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 允许输入框内的文字选择 */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

html {
    font-size: 16px;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #080c14;
    overflow-x: hidden;
    padding: 20px;
}

/* 压暗的酸性风格渐变背景 */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 107, 139, 0.15) 0%, transparent 35%),
        radial-gradient(circle at 80% 60%, rgba(157, 78, 221, 0.12) 0%, transparent 35%),
        radial-gradient(circle at 40% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 35%),
        radial-gradient(circle at 60% 20%, rgba(255, 209, 102, 0.08) 0%, transparent 30%),
        linear-gradient(145deg, #080b12 0%, #101524 25%, #151a2c 50%, #0e1220 75%, #080b12 100%);
}

/* 萤火虫粒子容器 */
.fireflies-container {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 萤火虫粒子 */
.firefly {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(0.5px);
    animation: firefly-float 10s ease-in-out infinite;
    box-shadow: 0 0 8px 1px currentColor;
}

/* 萤火虫动画 - 连续不断 */
@keyframes firefly-float {
    0%, 100% {
        opacity: 0.2;
        transform: translate(0, 0);
    }
    15% {
        opacity: 0.8;
    }
    35% {
        opacity: 1;
    }
    55% {
        opacity: 0.8;
    }
    75% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.2;
    }
}

/* Logo名称 - 优雅的衬线字体 */
.logo-name {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Playfair Display', 'Cinzel', serif;
    font-size: 5rem;
    font-weight: 700;
    letter-spacing: 4px;
    z-index: 5;
    text-align: center;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0.92;
    text-transform: lowercase;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    white-space: nowrap;
    width: auto;
    max-width: 95vw;
}

.logo-name.hidden {
    opacity: 0;
    visibility: hidden;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 420px;
    z-index: 10;
    position: relative;
}

/* 增强的毛玻璃登录/注册表单容器 */
.form-container {
    width: 100%;
    padding: 36px 40px 30px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.2),
        inset 0 -1px 1px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

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

/* 玻璃质感增强效果 */
.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, 
            rgba(255, 255, 255, 0.08) 0%, 
            rgba(255, 255, 255, 0.03) 50%, 
            rgba(255, 255, 255, 0.08) 100%),
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.04) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

/* 玻璃光泽效果 */
.form-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0) 100%);
    transform: translateX(-100%);
    animation: glass-shine 8s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes glass-shine {
    0% { transform: translateX(-100%); }
    20%, 100% { transform: translateX(100%); }
}

/* 表单头部 */
.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h1 {
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
    background: linear-gradient(90deg, #FF6B8B, #00D4FF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.form-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* 表单 */
.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    z-index: 1;
}

/* 密码可见性切换按钮 */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    outline: none;
    padding: 0;
    margin: 0;
    /* 移除移动端点击高亮效果 */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.password-toggle.show {
    display: flex;
}

.password-toggle i {
    color: rgba(255, 255, 255, 0.5);
    font-size: 22px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: static;
    transform: none;
    /* 移除移动端点击高亮效果 */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    pointer-events: none;
}

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

/* 移除所有焦点和激活状态的视觉反馈 */
.password-toggle:focus {
    outline: none !important;
    box-shadow: none !important;
}

.password-toggle:active {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* 输入框 */
.input-wrapper input {
    width: 100%;
    padding: 16px 56px 16px 48px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
}

.input-wrapper input:focus {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
    background: rgba(255, 255, 255, 0.09);
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.input-wrapper input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 自动填充检测动画 - 用于JavaScript检测 */
@keyframes onAutoFillStart {
    from { background: transparent; }
    to { background: transparent; }
}

.input-wrapper input:-webkit-autofill {
    animation-name: onAutoFillStart;
    animation-duration: 0.001s;
}

/* 记住登录状态 */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
}

.remember-me input {
    margin-right: 8px;
    accent-color: #00D4FF;
    cursor: pointer;
}

.remember-me label {
    cursor: pointer;
    user-select: none;
}

/* 按钮 */
.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 6px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 移除移动端点击高亮效果 */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
    outline: none;
}

.btn-login,
.btn-register {
    background: linear-gradient(90deg, #FF6B8B, #9D4EDD);
    box-shadow: 0 8px 20px rgba(255, 107, 139, 0.3);
}

.btn-login:hover:not(:disabled),
.btn-register:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(255, 107, 139, 0.4);
}

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

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

/* 移除所有焦点和激活状态的视觉反馈 */
.btn:focus {
    outline: none !important;
    box-shadow: 0 8px 20px rgba(255, 107, 139, 0.3) !important;
}

.btn-login:focus,
.btn-register:focus {
    outline: none !important;
}

.btn-login:active:not(:disabled),
.btn-register:active:not(:disabled) {
    outline: none !important;
}

.btn-text {
    display: inline-block;
}

.btn-loader {
    position: absolute;
    display: none;
}

.btn.loading .btn-text {
    visibility: hidden;
}

.btn.loading .btn-loader {
    display: inline-block;
}

/* 表单底部 */
.form-footer {
    text-align: center;
    margin-top: 22px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.form-footer p {
    margin: 0;
}

.toggle-link {
    color: #06D6A0;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    cursor: pointer;
}

.toggle-link:hover {
    color: #00D4FF;
}

/* 表单错误提示 */
.form-error {
    margin-top: 12px;
    padding: 12px 16px;
    background-color: rgba(239, 68, 68, 0.15);
    border-left: 4px solid #ef4444;
    border-radius: 6px;
    color: #fca5a5;
    font-size: 14px;
    line-height: 1.5;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast提示框 */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(150px);
    background: linear-gradient(135deg, #34a853 0%, #2d8e47 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(52, 168, 83, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    max-width: calc(100% - 40px);
    line-height: 1.5;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.toast-notification i {
    font-size: 20px;
    animation: checkmark 0.6s ease;
    flex-shrink: 0;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1) rotate(0);
    }
}

.toast-notification.error {
    background: linear-gradient(135deg, #ea4335 0%, #d33f2d 100%);
    box-shadow: 0 4px 16px rgba(234, 67, 53, 0.3);
}

/* 响应式设计 - 移动端 */
@media (max-width: 768px) {
    .container {
        padding: 32px 12px 28px;
        max-width: 94%;
    }
    
    .form-header h1 {
        font-size: 32px;
    }
    
    .logo-name {
        font-size: 3.8rem;
        letter-spacing: 3px;
    }
    
    .password-toggle {
        right: 14px;
        width: 36px;
        height: 36px;
    }
    
    .password-toggle i {
        font-size: 20px;
    }
    
    .input-wrapper input {
        padding: 14px 52px 14px 44px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 6px 16px;
        max-width: 98%;
    }
    
    .logo-name {
        font-size: 3rem;
        letter-spacing: 2px;
    }
    
    .form-container {
        padding: 28px 24px 24px;
    }
    
    .form-header h1 {
        font-size: 28px;
    }
    
    .password-toggle {
        right: 12px;
        width: 32px;
        height: 32px;
    }
    
    .password-toggle i {
        font-size: 18px;
    }
    
    .input-wrapper input {
        padding: 12px 48px 12px 42px;
    }
    
    .toast-notification {
        bottom: 20px;
        left: 20px;
        right: 20px;
        transform: translateY(150px);
        max-width: none;
    }
    
    .toast-notification.show {
        transform: translateY(0);
    }
}

/* 小屏幕额外优化 */
@media (max-width: 375px) {
    .container {
        max-width: 99%;
        padding: 16px 4px 12px;
    }
    
    .logo-name {
        font-size: 2.6rem;
        letter-spacing: 1.5px;
    }
    
    .form-container {
        padding: 24px 20px 20px;
    }
}

/* 横屏优化 */
@media (orientation: landscape) {
    .form-header h1 {
        font-size: 20px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (min-width: 769px) and (orientation: landscape) {
    .logo-name {
        font-size: 4.2rem;
    }
    
    .form-header h1 {
        font-size: 28px;
        white-space: normal;
        overflow: visible;
    }
}

/* 超大屏幕优化 */
@media (min-width: 1200px) {
    .container {
        max-width: 450px;
    }
}
