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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, rgba(121, 163, 206, 0.8), rgba(173, 216, 230, 0.8));
    background-size: 600% 600%;
    animation: gradientShift 20s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    color: #e0e0e0;
    /* 初始化鼠标位置变量 */
    --mouse-x: 50%;
    --mouse-y: 50%;
}

/* 全局鼠标柔和光效 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.15) 15%,
        rgba(255, 255, 255, 0.08) 30%,
        rgba(255, 255, 255, 0.03) 50%,
        rgba(255, 255, 255, 0) 70%
    );
    z-index: 3;
    opacity: 0.8;
}

/* 流动光线 (保持原有效果) */
body::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200% 100%;
    opacity: 0.3;
    animation: slide 2s infinite linear;
}

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

@keyframes slide {
    0% { background-position: -100% center; }
    100% { background-position: 200% center; }
}

/* 居中表单容器 */
.form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.form-content {
    width: 100%;
}

/* 提示信息 */
#message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 15px 20px;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
}

#message.success {
    background-color: #d4edda;
    color: #155724;
}

#message.error {
    background-color: #f8d7da;
    color: #721c24;
}

.container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

h1 {
    text-align: center;
    color: #000000;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #0055ff;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    outline: none;
    box-sizing: border-box;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder {
    color: #ccc;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(107, 176, 247, 0.5);
}

button {
    width: 100%;
    padding: 14px;
    background: #6bb0f7;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
    box-sizing: border-box;
}

button:hover {
    background: #5aa0e7;
}

.switch-form {
    text-align: center;
    margin-top: 20px;
}

.switch-form a {
    color: #8ec5fc;
    text-decoration: none;
    font-weight: 500;
}

.switch-form a:hover {
    text-decoration: underline;
}

.error {
    background: rgba(229, 62, 62, 0.2);
    color: #e53e3e;
    border: 1px solid rgba(229, 62, 62, 0.3);
}

.success {
    background: rgba(56, 161, 105, 0.2);
    color: #38a169;
    border: 1px solid rgba(154, 230, 180, 0.3);
}

/* ----------- 手机端适配（屏幕宽度 ≤ 768px）----------- */
@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .form-container {
        max-width: 100%;
        width: 100%;
        padding: 20px 15px;
        border-radius: 12px;
        min-height: auto;
    }

    .form-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"] {
        padding: 14px 12px;
        font-size: 16px;
    }

    button {
        padding: 16px;
        font-size: 17px;
    }

    .switch-form a {
        font-size: 15px;
    }
    
    #message {
        left: 10px;
        right: 10px;
        transform: none;
        min-width: auto;
    }
}

/* 可选：超小屏进一步优化 */
@media (max-width: 480px) {
    .form-container {
        padding: 15px 10px;
    }

    .form-title {
        font-size: 22px;
    }

    input[type="text"],
    input[type="password"],
    input[type="email"] {
        padding: 12px;
        font-size: 15px;
    }

    button {
        padding: 14px;
        font-size: 16px;
    }
}

.captcha-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.captcha-controls {
    display: flex;
    gap: 10px;
}

.captcha-controls input {
    flex: 1;
}

.captcha-controls button {
    width: auto;
    padding: 12px 16px;
}

/* 移动端验证码控件垂直排列 */
@media (max-width: 768px) {
    .captcha-controls {
        flex-direction: column;
    }
    
    .captcha-controls button {
        width: 100%;
        margin-top: 10px;
        padding: 16px;
    }
}

.password-strength {
    margin-top: 10px;
}

.strength-meter {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 0.3s, background-color 0.3s;
}

.strength-fill.weak {
    background-color: #e53e3e;
}

.strength-fill.medium {
    background-color: #dd6b20;
}

.strength-fill.strong {
    background-color: #38a169;
}

.strength-text {
    font-size: 14px;
    color: #aaff00;
}

.strength-text.weak {
    color: #e53e3e;
}

.strength-text.medium {
    color: #dd6b20;
}

.strength-text.strong {
    color: #38a169;
}

.password-requirements {
    margin-top: 15px;
    font-size: 14px;
    color: #aaff7f;
}

.password-requirements ul {
    list-style: none;
    padding-left: 0;
}

.password-requirements li {
    margin-bottom: 5px;
    padding-left: 20px;
    position: relative;
}

.password-requirements li::before {
    content: "✗";
    color: #e53e3e;
    position: absolute;
    left: 0;
}

.password-requirements li.valid {
    color: #9ae6b4;
}

.password-requirements li.valid::before {
    content: "✓";
    color: #38a169;
}

.match-success {
    color: #9ae6b4;
    font-size: 14px;
    margin-top: 5px;
}

.match-error {
    color: #feb2b2;
    font-size: 14px;
    margin-top: 5px;
}

.feedback {
    font-size: 14px;
    margin-top: 5px;
}

.feedback.error {
    color: #feb2b2;
}

.feedback.success {
    color: #9ae6b4;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    input[type="text"],
    input[type="password"],
    input[type="email"],
    button {
        min-height: 44px;
    }
}