@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --cyan: #00e5ff;
    --cyan-dim: rgba(0, 229, 255, 0.5);
    --cyan-glow: rgba(0, 229, 255, 0.15);
    --purple: #a855f7;
    --purple-glow: rgba(168, 85, 247, 0.12);
    --bg: #050810;
    --card: rgba(10, 14, 26, 0.85);
    --border: rgba(0, 229, 255, 0.18);
    --text: #c8d4e8;
    --text-dim: rgba(200, 212, 232, 0.4);
    --input-bg: rgba(0, 0, 0, 0.4);
    --input-focus-bg: rgba(0, 0, 0, 0.55);
}

body {
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ==================== 背景 ==================== */

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    animation: grid-pan 25s linear infinite;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 85%);
}

.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
}

.bg-glow--cyan {
    background: var(--cyan);
    top: -100px;
    left: -100px;
    opacity: 0.07;
    animation: float-a 12s ease-in-out infinite alternate;
}

.bg-glow--purple {
    background: var(--purple);
    bottom: -100px;
    right: -100px;
    opacity: 0.05;
    animation: float-b 14s ease-in-out infinite alternate;
}

.scanline {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 3px,
        rgba(0, 229, 255, 0.01) 3px,
        rgba(0, 229, 255, 0.01) 4px
    );
}

.light-sweep {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan-dim), transparent);
    z-index: 2;
    pointer-events: none;
    animation: sweep 8s ease-in-out infinite;
}

.particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--cyan);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--cyan);
    animation: drift 18s linear infinite;
}

.particle--purple {
    background: var(--purple);
    box-shadow: 0 0 6px var(--purple);
}

/* ==================== 登录卡片 ==================== */

.login-container {
    position: relative;
    z-index: 10;
    width: 440px;
    max-width: 92vw;
    padding: 48px 40px 40px;
    background: var(--card);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.6),
        0 0 80px rgba(0, 229, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    animation: card-in 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition: transform 0.3s ease-out;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    box-shadow: 0 0 8px var(--cyan);
}

.corner {
    position: absolute;
    width: 14px;
    height: 14px;
    pointer-events: none;
}
.corner--tl { top: 8px; left: 8px; border-top: 1.5px solid var(--cyan-dim); border-left: 1.5px solid var(--cyan-dim); border-radius: 4px 0 0 0; }
.corner--tr { top: 8px; right: 8px; border-top: 1.5px solid var(--cyan-dim); border-right: 1.5px solid var(--cyan-dim); border-radius: 0 4px 0 0; }
.corner--bl { bottom: 8px; left: 8px; border-bottom: 1.5px solid var(--cyan-dim); border-left: 1.5px solid var(--cyan-dim); border-radius: 0 0 0 4px; }
.corner--br { bottom: 8px; right: 8px; border-bottom: 1.5px solid var(--cyan-dim); border-right: 1.5px solid var(--cyan-dim); border-radius: 0 0 4px 0; }

/* ==================== Logo 区 ==================== */

.brand {
    text-align: center;
    margin-bottom: 36px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 16px;
    position: relative;
    animation: pulse-ring 3s ease-in-out infinite;
}

.brand-mark svg {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 0 6px var(--cyan)) drop-shadow(0 0 12px var(--cyan-glow));
    animation: icon-glow 4s ease-in-out infinite;
}

.brand-mark::before {
    content: '';
    position: absolute;
    inset: -5px;
    border: 1px solid rgba(0, 229, 255, 0.08);
    border-radius: 20px;
}

.brand-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 4px;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.brand-subtitle {
    font-size: 10px;
    letter-spacing: 5px;
    color: rgba(0, 229, 255, 0.45);
    text-transform: uppercase;
    margin-top: 6px;
    font-weight: 500;
}

/* ==================== 表单 ==================== */

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.5px;
    color: rgba(0, 229, 255, 0.55);
    text-transform: uppercase;
}

.input-wrap {
    position: relative;
}

.input-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: rgba(0, 229, 255, 0.3);
    pointer-events: none;
    transition: color 0.3s, filter 0.3s;
    z-index: 2;
}

.form-group input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: var(--input-bg);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    outline: none;
    -webkit-autofill: none;
}

.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
    caret-color: var(--cyan);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.15);
    letter-spacing: 0.5px;
}

.form-group input:focus {
    border-color: rgba(0, 229, 255, 0.4);
    background: var(--input-focus-bg);
    box-shadow:
        0 0 0 3px rgba(0, 229, 255, 0.05),
        0 0 16px rgba(0, 229, 255, 0.08);
}

.input-wrap:focus-within svg {
    color: var(--cyan);
    filter: drop-shadow(0 0 4px var(--cyan));
}

.input-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    box-shadow: 0 0 4px var(--cyan);
    transition: width 0.4s ease, left 0.4s ease;
}

.input-wrap:focus-within::after {
    width: 100%;
    left: 0;
}

/* ==================== 按钮 ==================== */

.form-actions {
    margin-top: 30px;
}

.btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #003d7a 0%, #0099cc 50%, #00d4ff 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    cursor: pointer;
    font-size: 14px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 20px rgba(0, 229, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

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

.btn:hover {
    box-shadow:
        0 0 24px rgba(0, 229, 255, 0.4),
        0 0 40px rgba(0, 229, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
    border-color: rgba(0, 229, 255, 0.5);
}

.btn:hover::before {
    left: 120%;
}

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

.btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

/* ==================== 提示框 ==================== */

.alert {
    padding: 12px 16px;
    margin-bottom: 22px;
    border-radius: 8px;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-align: center;
    animation: shake 0.4s ease-in-out;
}

.alert-danger {
    background: rgba(255, 45, 85, 0.08);
    color: #ff6b8a;
    border: 1px solid rgba(255, 45, 85, 0.18);
}

/* ==================== 底部信息 ==================== */

.footer-info {
    text-align: center;
    margin-top: 28px;
    font-size: 9px;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.1);
    text-transform: uppercase;
    font-weight: 600;
}

.footer-info span {
    color: rgba(0, 229, 255, 0.2);
}

/* ==================== 动画 ==================== */

@keyframes grid-pan {
    from { background-position: 0 0; }
    to   { background-position: 60px 60px; }
}

@keyframes float-a {
    from { transform: translate(0, 0); }
    to   { transform: translate(80px, 60px); }
}

@keyframes float-b {
    from { transform: translate(0, 0); }
    to   { transform: translate(-80px, -60px); }
}

@keyframes sweep {
    0%, 100% { top: 0; opacity: 0; }
    10%      { opacity: 0.4; }
    50%      { top: 100vh; opacity: 0.4; }
    60%      { opacity: 0; }
}

@keyframes drift {
    0%   { transform: translate(0, 100vh) scale(0); opacity: 0; }
    8%   { opacity: 0.6; }
    92%  { opacity: 0.6; }
    100% { transform: translate(60px, -100vh) scale(1.5); opacity: 0; }
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.1); }
    50%      { box-shadow: 0 0 0 8px rgba(0, 229, 255, 0); }
}

@keyframes icon-glow {
    0%, 100% { filter: drop-shadow(0 0 5px var(--cyan)) drop-shadow(0 0 10px var(--cyan-glow)); }
    50%      { filter: drop-shadow(0 0 10px var(--cyan)) drop-shadow(0 0 20px rgba(0, 229, 255, 0.25)); }
}

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

@keyframes ripple {
    to { transform: scale(2.5); opacity: 0; }
}

/* ==================== 响应式 ==================== */

@media (max-width: 480px) {
    .login-container {
        padding: 36px 24px 32px;
    }

    .brand-title {
        font-size: 20px;
    }

    .brand-mark {
        width: 56px;
        height: 56px;
    }
}
