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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 背景装饰粒子 */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: floatBubble 20s ease-in-out infinite;
    pointer-events: none;
}
body::before {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}
body::after {
    width: 400px;
    height: 400px;
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

@keyframes floatBubble {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 40px) scale(0.9); }
}

/* 背景漂浮粒子 */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}
.particle:nth-child(1) { left: 10%; animation-duration: 12s; animation-delay: 0s; }
.particle:nth-child(2) { left: 25%; animation-duration: 14s; animation-delay: 2s; width: 8px; height: 8px; }
.particle:nth-child(3) { left: 40%; animation-duration: 16s; animation-delay: 4s; }
.particle:nth-child(4) { left: 55%; animation-duration: 13s; animation-delay: 1s; width: 4px; height: 4px; }
.particle:nth-child(5) { left: 70%; animation-duration: 15s; animation-delay: 3s; }
.particle:nth-child(6) { left: 85%; animation-duration: 11s; animation-delay: 5s; width: 10px; height: 10px; }
.particle:nth-child(7) { left: 50%; animation-duration: 17s; animation-delay: 2.5s; width: 5px; height: 5px; }
.particle:nth-child(8) { left: 15%; animation-duration: 13.5s; animation-delay: 4.5s; }

@keyframes particleFloat {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

.password-container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    max-width: 420px;
    width: 100%;
    padding: 45px 35px 35px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 锁图标 */
.lock-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
    animation: pulseLock 2s ease-in-out infinite;
}

@keyframes pulseLock {
    0%, 100% { box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 8px 50px rgba(102, 126, 234, 0.6), 0 0 0 8px rgba(102, 126, 234, 0.1); }
}

h1 {
    color: #1a1a2e;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.sub-title {
    color: #888;
    font-size: 13px;
    margin-bottom: 28px;
    letter-spacing: 0.5px;
}

.password-input-wrapper {
    position: relative;
    margin-bottom: 18px;
}

.password-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e8ecf1;
    border-radius: 14px;
    font-size: 22px;
    text-align: center;
    letter-spacing: 12px;
    transition: all 0.3s;
    outline: none;
    background: #f7f8fc;
    font-weight: 600;
    color: #1a1a2e;
}

.password-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.password-input::placeholder {
    letter-spacing: 2px;
    color: #b0b8c8;
    font-weight: 400;
    font-size: 15px;
}

/* 验证码 */
#captchaSection {
    display: none;
    margin-top: 16px;
    padding: 12px 14px;
    background: #f7f8fc;
    border-radius: 12px;
    border: 1px dashed #d0d5e0;
}
#captchaSection .captcha-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
#captchaSection .captcha-row input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e8ecf1;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    background: white;
    transition: border-color 0.3s;
}
#captchaSection .captcha-row input:focus {
    border-color: #667eea;
}
#captchaSection .captcha-row img {
    width: 110px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #e0e4ec;
    cursor: pointer;
    background: #fff;
    flex-shrink: 0;
}
#captchaSection .captcha-hint {
    font-size: 11px;
    color: #999;
    margin-top: 8px;
    text-align: left;
}
#captchaSection .captcha-hint i {
    margin-right: 4px;
    color: #667eea;
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    margin-top: 6px;
    letter-spacing: 1px;
}

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

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

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0) scale(0.98);
}

.submit-btn:disabled {
    background: #c0c6d4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-btn:disabled::before {
    display: none;
}

.submit-btn i {
    margin-right: 8px;
}

/* ===== 手机数字键盘 ===== */
.num-keyboard {
    display: none;
    gap: 8px;
    margin-top: 18px;
    user-select: none;
    -webkit-user-select: none;
}

.num-keyboard .row {
    display: flex;
    gap: 8px;
}

.num-keyboard .row .key {
    flex: 1;
    height: 50px;
    border: none;
    border-radius: 12px;
    background: #f0f2f7;
    color: #1a1a2e;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.num-keyboard .row .key:active {
    background: #d5d9e6;
    transform: scale(0.94);
}

.num-keyboard .row .key.key-delete {
    background: #fee8e8;
    color: #e74c3c;
}

.num-keyboard .row .key.key-delete:active {
    background: #fcc8c8;
}

.num-keyboard .row .key.key-clear {
    background: #fef6e0;
    color: #e67e22;
}

.num-keyboard .row .key.key-clear:active {
    background: #fce8b8;
}

.num-keyboard .row .key i {
    font-size: 18px;
}

/* ========== 手机端显示键盘 ========== */
@media (max-width: 768px) {
    .num-keyboard {
        display: flex;
        flex-direction: column;
    }

    .password-container {
        padding: 30px 20px 20px;
        border-radius: 20px;
    }

    .lock-icon {
        width: 60px;
        height: 60px;
        font-size: 26px;
        margin-bottom: 16px;
    }

    h1 {
        font-size: 20px;
    }

    .password-input {
        font-size: 24px;
        padding: 14px 16px;
        letter-spacing: 14px;
    }

    .submit-btn {
        font-size: 16px;
        padding: 14px;
    }

    .num-keyboard .row .key {
        height: 46px;
        font-size: 20px;
        border-radius: 10px;
    }
}

@media (max-width: 400px) {
    .num-keyboard .row .key {
        height: 40px;
        font-size: 18px;
    }
    .password-input {
        font-size: 20px;
        letter-spacing: 10px;
        padding: 12px 14px;
    }
    .password-container {
        padding: 24px 16px 16px;
    }
    .lock-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    h1 {
        font-size: 18px;
    }
}

/* ===== 锁定遮罩 ===== */
.lockout-overlay {
    position: fixed;top:0;left:0;width:100%;height:100%;overflow:hidden;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lockout {
    position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:300px;
    max-width: 90vw;
    padding: 28px 24px;
    border-radius: 20px;
    background: #fff;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from { transform:translate(-50%,-50%) scale(0.8); opacity: 0; }
    to { transform:translate(-50%,-50%) scale(1); opacity: 1; }
}

.lockout .lockout-icon {
    font-size: 48px;
    color: #f59e0b;
    margin-bottom: 12px;
}

.lockout-title {
    font-weight: 700;
    color: #1a1a2e;
    font-size: 18px;
}

.lockout-desc {
    color: #666;
    font-size: 14px;
    margin-top: 6px;
}

.lockout-bar {
    margin-top: 14px;
    height: 6px;
    background: #f0f2f7;
    border-radius: 999px;
    overflow: hidden;
}

.lockout-bar > div {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f59e0b, #f97316);
    border-radius: 999px;
    transition: width 0.25s linear;
}

.lockout .lockout-time {
    font-size: 32px;
    font-weight: 700;
    color: #f59e0b;
    margin-top: 8px;
}

.is-locked .submit-btn,
.is-locked #passwordInput,
.is-locked #captchaInput,
.is-locked .num-keyboard .key {
    pointer-events: none;
    opacity: 0.5;
}

/* 消息提示（layer 已接管，仅保留作为 fallback） */
.message {
    display: none;
    }