* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1419 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 科技感背景容器 */
.tech-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

/* 网格背景 */
.grid-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}

/* 粒子效果 */
.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8),
                0 0 20px rgba(0, 255, 255, 0.6),
                0 0 30px rgba(0, 255, 255, 0.4);
    animation: float 15s infinite ease-in-out;
}

/* 各粒子实例的尺寸与位置（还原原先的内联样式） */
.particle:nth-of-type(1) {
    width: 4px;
    height: 4px;
    left: 10%;
    top: 20%;
    animation-delay: 0s;
}

.particle:nth-of-type(2) {
    width: 6px;
    height: 6px;
    left: 20%;
    top: 60%;
    animation-delay: 2s;
}

.particle:nth-of-type(3) {
    width: 3px;
    height: 3px;
    left: 30%;
    top: 40%;
    animation-delay: 4s;
}

.particle:nth-of-type(4) {
    width: 5px;
    height: 5px;
    left: 40%;
    top: 80%;
    animation-delay: 1s;
}

.particle:nth-of-type(5) {
    width: 4px;
    height: 4px;
    left: 50%;
    top: 30%;
    animation-delay: 3s;
}

.particle:nth-of-type(6) {
    width: 6px;
    height: 6px;
    left: 60%;
    top: 70%;
    animation-delay: 5s;
}

.particle:nth-of-type(7) {
    width: 3px;
    height: 3px;
    left: 70%;
    top: 50%;
    animation-delay: 2.5s;
}

.particle:nth-of-type(8) {
    width: 5px;
    height: 5px;
    left: 80%;
    top: 25%;
    animation-delay: 1.5s;
}

.particle:nth-of-type(9) {
    width: 4px;
    height: 4px;
    left: 90%;
    top: 65%;
    animation-delay: 4.5s;
}

.particle:nth-of-type(10) {
    width: 6px;
    height: 6px;
    left: 15%;
    top: 85%;
    animation-delay: 0.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.8; }
    25% { transform: translateY(-100px) translateX(50px); opacity: 1; }
    50% { transform: translateY(-50px) translateX(-50px); opacity: 0.6; }
    75% { transform: translateY(-150px) translateX(25px); opacity: 0.9; }
}

/* 光线扫描效果 */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.5), transparent);
    animation: scan 8s linear infinite;
}

@keyframes scan {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* 圆形光环效果 */
.circle-glow {
    position: absolute;
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 50%;
    animation: pulse 10s infinite ease-in-out;
}

/* 圆形光环实例的位置和尺寸 */
.circle-glow:nth-of-type(1) {
    width: 300px;
    height: 300px;
    left: -150px;
    top: -150px;
    animation-delay: 0s;
}

.circle-glow:nth-of-type(2) {
    width: 200px;
    height: 200px;
    right: -100px;
    bottom: -100px;
    animation-delay: 2s;
}

.circle-glow:nth-of-type(3) {
    width: 150px;
    height: 150px;
    right: 20%;
    top: 10%;
    animation-delay: 4s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.6; }
}

/* 角落装饰 */
.corner-decoration {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px solid rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.corner-decoration.top-left {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
}

.corner-decoration.top-right {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none;
}

.corner-decoration.bottom-left {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
}

.corner-decoration.bottom-right {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
}

/* 数据流效果 */
.data-stream {
    position: absolute;
    width: 2px;
    background: linear-gradient(to bottom, transparent, rgba(0, 255, 255, 0.8), transparent);
    animation: dataFlow 5s linear infinite;
}

/* 数据流实例的位置和高度 */
.data-stream:nth-of-type(1) {
    left: 15%;
    height: 100px;
    animation-delay: 0s;
}

.data-stream:nth-of-type(2) {
    left: 35%;
    height: 150px;
    animation-delay: 1.5s;
}

.data-stream:nth-of-type(3) {
    left: 55%;
    height: 80px;
    animation-delay: 3s;
}

.data-stream:nth-of-type(4) {
    left: 75%;
    height: 120px;
    animation-delay: 4.5s;
}

.data-stream:nth-of-type(5) {
    left: 90%;
    height: 90px;
    animation-delay: 2.5s;
}

@keyframes dataFlow {
    0% { transform: translateY(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

.back-home-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: rgba(0, 255, 255, 0.15);
    color: #00ffff;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 255, 255, 0.2),
                inset 0 0 10px rgba(0, 255, 255, 0.1);
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.back-home-btn:hover {
    background: rgba(0, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.4),
                inset 0 0 15px rgba(0, 255, 255, 0.2);
}

.back-home-btn:active {
    transform: translateY(0);
}

.login-container {
    background: rgba(10, 14, 39, 0.85);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(0, 255, 255, 0.1),
                inset 0 0 30px rgba(0, 255, 255, 0.05);
    width: 400px;
    max-width: 90%;
    border: 1px solid rgba(0, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    z-index: 10;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
        rgba(0, 255, 255, 0.3),
        transparent,
        rgba(0, 255, 255, 0.3),
        transparent,
        rgba(0, 255, 255, 0.3));
    background-size: 400% 400%;
    animation: gradientBorder 8s ease infinite;
    border-radius: 17px;
    z-index: -1;
}

@keyframes gradientBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #00ffff;
    font-size: 26px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    font-weight: 700;
}

.login-header p {
    color: #a0b0c0;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #00ffff;
    font-weight: bold;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
    background: rgba(0, 255, 255, 0.05);
    color: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3),
                inset 0 0 10px rgba(0, 255, 255, 0.1);
    background: rgba(0, 255, 255, 0.1);
}

.form-group input::placeholder {
    color: rgba(160, 176, 192, 0.6);
}

/* 输入框图标样式 */
.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
    z-index: 1;
}

.input-with-icon input {
    padding-left: 40px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.3) 0%, rgba(0, 200, 255, 0.2) 100%);
    color: #00ffff;
    border: 1px solid rgba(0, 255, 255, 0.5);
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2),
                inset 0 0 15px rgba(0, 255, 255, 0.1);
}

.btn-login:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.4) 0%, rgba(0, 200, 255, 0.3) 100%);
    box-shadow: 0 5px 25px rgba(0, 255, 255, 0.4),
                inset 0 0 20px rgba(0, 255, 255, 0.2);
}

.btn-login:active {
    transform: translateY(0);
}

.error-message {
    color: #ff6b6b;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.auto-logout-message {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.1) 100%);
    color: #ffc107;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 193, 7, 0.3);
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2),
                inset 0 0 10px rgba(255, 193, 7, 0.05);
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 自定义弹窗样式 ===== */

/* Alert弹窗遮罩 - 垂直水平居中 */
.custom-alert-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10000 !important;
    backdrop-filter: blur(10px);
}

.custom-alert-overlay[style*="flex"] {
    display: flex !important;
}

/* Alert弹窗主体 */
.custom-alert-modal {
    background: rgba(10, 14, 39, 0.95);
    border-radius: 20px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 255, 255, 0.1),
        inset 0 0 30px rgba(0, 255, 255, 0.05);
    min-width: 380px;
    max-width: 500px;
    animation: modalFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    border: 1px solid rgba(0, 255, 255, 0.2);
    backdrop-filter: blur(20px);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Alert头部 */
.alert-header {
    display: flex;
    align-items: center;
    padding: 28px 28px 20px 28px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1) 0%, rgba(0, 200, 255, 0.05) 100%);
}

/* Alert图标 */
.alert-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    margin-right: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.2);
}

.alert-icon.success {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.2) 0%, rgba(0, 255, 0, 0.1) 100%);
    color: #00ff00;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.alert-icon.error {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2) 0%, rgba(255, 107, 107, 0.1) 100%);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.alert-icon.warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 193, 7, 0.1) 100%);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.alert-icon.info {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 200, 255, 0.1) 100%);
    color: #00ffff;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

/* Alert标题 */
.alert-title {
    font-size: 20px;
    font-weight: 700;
    color: #00ffff;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Alert消息 */
.alert-message {
    padding: 28px;
    font-size: 15px;
    line-height: 1.7;
    color: #a0b0c0;
    word-break: break-word;
    background: rgba(10, 14, 39, 0.95);
}

/* Alert底部按钮 */
.alert-footer {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    padding: 20px 28px;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1) 0%, rgba(0, 200, 255, 0.05) 100%);
}

/* Alert按钮 */
.alert-btn {
    padding: 12px 32px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 100px;
    box-shadow: 0 2px 8px rgba(0, 255, 255, 0.2),
                inset 0 0 10px rgba(0, 255, 255, 0.1);
}

.alert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 255, 255, 0.4),
                inset 0 0 15px rgba(0, 255, 255, 0.2);
}

.alert-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 255, 255, 0.2);
}

.alert-btn:not(.secondary):not(.primary) {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.3) 0%, rgba(0, 200, 255, 0.2) 100%);
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.alert-btn:not(.secondary):not(.primary):hover {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.4) 0%, rgba(0, 200, 255, 0.3) 100%);
}

/* 数学验证弹窗样式 */
.math-verify-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    /* 默认隐藏，显示时由 JS 设置为 flex */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.math-verify-content {
    background: rgba(10, 14, 39, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(0, 255, 255, 0.1),
                inset 0 0 30px rgba(0, 255, 255, 0.05);
    min-width: 400px;
    max-width: 500px;
    animation: modalFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    border: 1px solid rgba(0, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    margin: auto;
}

.math-verify-header {
    display: flex;
    align-items: center;
    padding: 28px 28px 20px 28px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1) 0%, rgba(0, 200, 255, 0.05) 100%);
}

.math-verify-body {
    padding: 28px;
    font-size: 15px;
    line-height: 1.7;
    color: #a0b0c0;
    background: rgba(10, 14, 39, 0.95);
    text-align: center;
}

.math-question {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #00ffff;
    text-align: center;
}

.math-question input {
    width: 120px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s;
    background: rgba(0, 255, 255, 0.05);
    color: #fff;
}

.math-question input:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3),
                inset 0 0 10px rgba(0, 255, 255, 0.1);
    background: rgba(0, 255, 255, 0.1);
}

.math-question input::placeholder {
    color: rgba(160, 176, 192, 0.6);
}

.math-error {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    padding: 8px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    /* 默认隐藏，错误时由 JS 显示 */
    display: none;
}

.math-verify-footer {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 20px 28px;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1) 0%, rgba(0, 200, 255, 0.05) 100%);
}

