/* ===== 全局重置 & 基础 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    background: #0a0c0f;
    color: #e0e0e0;
    text-align: center;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    background-image: url('../png/背景.webp');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
}

/* ===== 通用容器 ===== */
.container {
    background: rgba(20, 22, 36, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 40px 36px 44px 36px;
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(51, 102, 255, 0.1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== 标题 ===== */
h2 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #6699ff, #3366ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

p {
    color: #aaa;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ===== 返回首页按钮 ===== */
.btn-return {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
    border-radius: 30px;
    text-decoration: none;
    font-size: 13px;
    position: absolute;
    top: 16px;
    right: 16px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.btn-return:hover {
    background: rgba(51, 102, 255, 0.2);
    color: #fff;
    border-color: rgba(51, 102, 255, 0.3);
}

/* ===== 表单元素 ===== */
input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0 12px 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}
input:focus {
    border-color: #3366ff;
    background: rgba(51, 102, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(51, 102, 255, 0.12);
}
input::placeholder {
    color: #666;
}

/* ===== 通用按钮样式 ===== */
button {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* ===== 获取验证码按钮（透明毛玻璃） ===== */
#getCodeBtn {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease !important;
}

#getCodeBtn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 4px 20px rgba(51, 102, 255, 0.2) !important;
    transform: translateY(-2px) !important;
}

#getCodeBtn:active:not(:disabled) {
    transform: translateY(0) !important;
}

#getCodeBtn:disabled {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== 完成注册按钮（保留渐变） ===== */
#registerBtn {
    background: linear-gradient(135deg, #3366ff, #5588ff);
    color: white;
}
#registerBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 102, 255, 0.3);
}
#registerBtn:active:not(:disabled) {
    transform: translateY(0);
}
#registerBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== 副按钮（返回修改） ===== */
#backBtn {
    background: rgba(255, 255, 255, 0.06);
    color: #aaa;
    margin-top: 4px;
}
#backBtn:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
    color: #fff;
}

/* ===== 消息框 ===== */
.msg {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    display: none;
}
.msg.success {
    display: block;
    background: rgba(46, 125, 50, 0.25);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #81c784;
}
.msg.error {
    display: block;
    background: rgba(198, 40, 40, 0.25);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ef9a9a;
}

/* ===== 步骤切换 ===== */
.step2 {
    display: none;
}

/* ===== 跳转页 Spinner ===== */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    border-top: 3px solid #3366ff;
    width: 36px;
    height: 36px;
    animation: spin 0.9s linear infinite;
    margin: 20px auto 12px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.jump-link {
    color: #3366ff;
    text-decoration: none;
    font-weight: 500;
}
.jump-link:hover {
    text-decoration: underline;
}

/* ===== 提示文本 ===== */
.hint-text {
    color: #777;
    font-size: 13px;
    margin: 4px 0 12px 0;
    text-align: left;
}

/* ===== 光效控制区域（右上角固定） ===== */
.glow-toggle-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 12, 15, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 12px 6px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.toggle-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    user-select: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.toggle-switch .toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease, background 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    transform: translateX(20px);
    background: #ffffff;
}

.toggle-switch:has(input:checked) {
    background: #3366ff;
}

.toggle-switch:hover {
    opacity: 0.9;
    transform: scale(1.02);
}
.toggle-switch:active .toggle-slider {
    transform: scale(0.9);
}
.toggle-switch:has(input:checked):active .toggle-slider {
    transform: translateX(20px) scale(0.9);
}

.glow-type-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.glow-type-btn:hover {
    background: rgba(51, 102, 255, 0.3);
    transform: scale(1.1);
    border-color: #3366ff;
}
.glow-type-btn:active {
    transform: scale(0.9);
}

/* ===== 光效（恢复原始亮度） ===== */
#glow {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 999999 !important;
    mix-blend-mode: soft-light;
    will-change: background;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#glow.active {
    opacity: 1;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .glow-toggle-container {
        top: 72px;
        right: 10px;
        padding: 4px 10px 4px 12px;
        gap: 6px;
    }
    .toggle-label {
        font-size: 11px;
    }
    .toggle-switch {
        width: 38px;
        height: 21px;
    }
    .toggle-switch .toggle-slider {
        width: 17px;
        height: 17px;
        top: 2px;
        left: 2px;
    }
    .toggle-switch input[type="checkbox"]:checked + .toggle-slider {
        transform: translateX(17px);
    }
    .glow-type-btn {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }
}

@media (max-width: 520px) {
    .container {
        padding: 24px 16px 28px 16px;
        border-radius: 16px;
        max-width: 100%;
        margin: 0 10px;
    }
    h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    p {
        font-size: 13px;
        margin-bottom: 12px;
    }
    .btn-return {
        font-size: 11px;
        padding: 4px 10px;
        top: 10px;
        right: 10px;
    }
    input, button {
        font-size: 14px;
        padding: 10px 12px;
        margin: 6px 0 10px 0;
        min-height: 44px;
    }
    .hint-text {
        font-size: 12px;
    }
    .msg {
        font-size: 13px;
        padding: 10px 12px;
    }
    .spinner {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 380px) {
    body {
        padding: 8px;
    }
    .container {
        padding: 18px 12px 20px 12px;
        border-radius: 12px;
    }
    h2 {
        font-size: 16px;
    }
    .btn-return {
        font-size: 10px;
        padding: 3px 8px;
        top: 8px;
        right: 8px;
    }
    input, button {
        font-size: 13px;
        padding: 8px 10px;
        min-height: 40px;
    }
}