/* ===== 全局重置 & 基础变量 ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    /* 浅天蓝色渐变 — 统一背景 */
    background: linear-gradient(145deg, #d4e8ff 0%, #a9d0ff 60%, #7cb9ff 100%);
    padding: 12px;
    margin: 0;
    line-height: 1.4;
    color: #1e3a5f;
}

/* ===== 卡片组件 ===== */
.auth-card {
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border-radius: 32px;
    padding: 1.8rem 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 40, 80, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    transition: transform 0.25s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.auth-card:active {
    transform: scale(0.99);
}

/* ===== 品牌区 ===== */
.brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.brand img {
    max-width: 210px;
    max-height: 46px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 60, 120, 0.15));
    border-radius: 16px;
}

.brand h2 {
    font-size: 1.6rem;
    font-weight: 550;
    letter-spacing: -0.02em;
    color: #1e4a7a;
    text-shadow: 0 2px 5px rgba(255, 255, 255, 0.5);
    margin: 0;
    line-height: 1.2;
}

/* ===== 提示文字 ===== */
.hint-text {
    text-align: center;
    margin-bottom: 1.2rem;
    color: #1e4f7a;
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.9;
}

/* ===== 表单通用样式 ===== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* 输入框字段 */
.input-field {
    width: 100%;
}

.input-field input {
    width: 100%;
    padding: 0.75rem 1.2rem;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-radius: 40px;
    color: #1e3a5f;
    outline: none;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    font-weight: 400;
    box-shadow: 0 4px 8px rgba(0, 30, 60, 0.08);
}

.input-field input::placeholder {
    color: #5a7c9c;
    font-weight: 300;
    opacity: 0.8;
    font-size: 0.9rem;
}

.input-field input:focus {
    border-color: #4d8fd8;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 16px rgba(0, 60, 130, 0.15), 0 0 0 3px rgba(77, 143, 216, 0.2);
}

/* ===== 验证码组合框 (左输入右按钮) ===== */
.captcha-group {
    display: flex;
    width: 100%;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 8px rgba(0, 30, 60, 0.08);
    overflow: hidden;
}

.captcha-group:focus-within {
    border-color: #4d8fd8;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 16px rgba(0, 60, 130, 0.15), 0 0 0 3px rgba(77, 143, 216, 0.2);
}

.captcha-input {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1.2rem;
    font-size: 0.95rem;
    background: transparent;
    border: none;
    color: #1e3a5f;
    outline: none;
}

.captcha-input::placeholder {
    color: #5a7c9c;
    font-weight: 300;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 验证码按钮基础样式 */
.captcha-btn {
    flex: 0 0 auto;
    padding: 0.75rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 570;
    border: none;
    border-left: 2px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    border-radius: 0 40px 40px 0;
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.6);
    min-width: 130px;
    text-align: center;
    
    /* 确保文字完全居中 */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    
    /* 文字溢出处理 */
    overflow: hidden;
    text-overflow: ellipsis;
}

.captcha-btn:hover {
    transform: translateY(-1px);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.6), 0 4px 8px rgba(0, 60, 130, 0.15);
}

.captcha-btn:active {
    transform: translateY(1px);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.4);
}

/* 验证码按钮禁用状态 */
.captcha-btn:disabled {
    opacity: 0.9;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

/* 验证码按钮不同状态的颜色 */
.captcha-btn.status-gold {
    background: #ffd966;
    color: #1e4a7a;
}

.captcha-btn.status-red {
    background: #dc3545;
    color: white;
}

.captcha-btn.status-grey {
    background: #6c757d;
    color: white;
}

/* ===== 按钮样式 ===== */
.btn-submit {
    background: #3490f0;
    border: none;
    padding: 0.75rem 1.2rem;
    font-size: 1rem;
    font-weight: 570;
    color: white;
    border-radius: 40px;
    margin-top: 0.3rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 12px 20px -8px rgba(30, 100, 180, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.4);
    letter-spacing: 0.3px;
}

.btn-submit:hover {
    background: #4b9eff;
    transform: translateY(-2px);
    box-shadow: 0 16px 24px -8px #1e6dc0;
}

.btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 8px 12px -6px #1e6dc0;
    background: #2b7be0;
}

/* ===== 辅助链接 ===== */
.action-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.2rem 0 0.2rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.action-links a {
    color: #1e4f7a;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 2px;
    border-bottom: 1.5px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    opacity: 0.9;
}

.action-links a:hover {
    color: #0f3b5e;
    border-bottom-color: #1e4f7a;
    opacity: 1;
}

/* ===== 社交登录区 ===== */
.sso-section {
    margin-top: 1.5rem;
    text-align: center;
}

.sso-section p {
    color: #1e4f7a;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-weight: 500;
    opacity: 0.8;
}

.sso-section p::before,
.sso-section p::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(30, 79, 122, 0.2);
}

.sso-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0 0.5rem;
}

.sso-icons a {
    display: inline-flex;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    padding: 5px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 10px rgba(30, 79, 122, 0.12);
}

.sso-icons a:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-4px) scale(1.03);
    border-color: #7cb9ff;
}

.sso-icons img {
    width: 34px;
    height: 34px;
    border-radius: 34px;
    display: block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    background: white;
    object-fit: cover;
}

/* ===== 关闭注册提示 ===== */
.closed-message {
    text-align: center;
    margin: 1.2rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 40px;
    color: #1e4a7a;
    font-weight: 500;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

/* ===== 顶部提示信息弹窗 ===== */
.message.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    z-index: 10000;
    
    /* 使用Flexbox实现完美居中 */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* 文字样式优化 */
    text-align: center;
    line-height: 1.4;
    font-size: 0.95rem;
    
    /* 基础样式 */
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* 错误状态 */
.message.popup.error {
    background: rgba(220, 53, 69, 0.95);
    color: white;
}

/* 成功状态 */
.message.popup.success {
    background: rgba(40, 167, 69, 0.95);
    color: white;
}

/* ===== 移动端优化 ===== */
@media (max-width: 420px) {
    .auth-card {
        padding: 1.5rem 1.2rem;
        border-radius: 28px;
    }

    .brand {
        margin-bottom: 1.2rem;
    }

    .brand h2 {
        font-size: 1.5rem;
    }

    .hint-text {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .input-field input,
    .captcha-input {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    .captcha-btn {
        padding: 0.7rem 0.9rem;
        font-size: 0.85rem;
        min-width: 115px;
    }

    .btn-submit {
        padding: 0.7rem 1rem;
        font-size: 0.95rem;
    }

    .action-links {
        gap: 1.2rem;
        font-size: 0.85rem;
        margin: 1rem 0 0.2rem;
    }

    .sso-icons {
        gap: 0.9rem;
    }

    .sso-icons img {
        width: 32px;
        height: 32px;
    }

    .sso-section {
        margin-top: 1.2rem;
    }
    
    .message.popup {
        height: 45px;
        font-size: 0.9rem;
    }
}

@media (max-width: 340px) {
    .auth-card {
        padding: 1.2rem 0.8rem;
    }

    .sso-icons {
        gap: 0.6rem;
    }

    .action-links {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .sso-icons img {
        width: 30px;
        height: 30px;
    }

    .captcha-btn {
        padding: 0.7rem 0.7rem;
        min-width: 105px;
        font-size: 0.8rem;
    }
}