/**
 * 认证页面专用样式（登录/注册）
 * 独立于 main.css，避免全站布局样式冲突
 */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body.auth-body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

ul, ol {
    list-style: none;
}

a {
    color: #1890ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0052cc;
}

img {
    max-width: 100%;
    height: auto;
}

input, button {
    font-family: inherit;
    font-size: inherit;
}

/* ==================== 认证卡片 ==================== */
.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    animation: authFadeIn 0.5s ease;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Logo 区域 ==================== */
.auth-logo {
    text-align: center;
    margin-bottom: 8px;
}

.auth-logo a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 26px;
    font-weight: 700;
    color: #1890ff;
    text-decoration: none;
    letter-spacing: 1px;
}

.auth-logo a:hover {
    color: #0052cc;
}

.auth-logo .logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.auth-subtitle {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-bottom: 32px;
}

/* ==================== 表单 ==================== */
.auth-form .form-group {
    margin-bottom: 22px;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    display: flex;
    align-items: center;
    z-index: 1;
}

.auth-input-wrapper .input-icon svg {
    width: 18px;
    height: 18px;
}

.auth-input-wrapper input {
    width: 100%;
    height: 46px;
    padding: 0 44px 0 44px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fafafa;
    transition: all 0.3s;
    outline: none;
}

.auth-input-wrapper input::placeholder {
    color: #bbb;
}

.auth-input-wrapper input:focus {
    border-color: #1890ff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.12);
}

/* 密码显示/隐藏切换 */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #bbb;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    z-index: 1;
}

.password-toggle:hover {
    color: #666;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

/* ==================== 密码强度 ==================== */
.password-strength {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.password-strength-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    transition: background 0.3s;
}

.password-strength-bar.weak {
    background: #ff4d4f;
}

.password-strength-bar.medium {
    background: #faad14;
}

.password-strength-bar.strong {
    background: #52c41a;
}

.password-strength-text {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    min-height: 16px;
}

/* ==================== 按钮 ==================== */
.auth-btn {
    width: 100%;
    height: 46px;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 2px;
}

.auth-btn-login {
    background: linear-gradient(135deg, #1890ff 0%, #0052cc 100%);
}

.auth-btn-login:hover {
    background: linear-gradient(135deg, #0052cc 0%, #003a99 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(24, 144, 255, 0.3);
}

.auth-btn-register {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
}

.auth-btn-register:hover {
    background: linear-gradient(135deg, #e55a28 0%, #ff6b35 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.3);
}

/* ==================== 底部链接 ==================== */
.auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 13px;
    color: #999;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.auth-footer a {
    color: #1890ff;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ==================== 错误提示 ==================== */
.auth-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 22px;
    font-size: 13px;
    color: #ff4d4f;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-error svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.field-error {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 6px;
    padding-left: 4px;
}

/* ==================== 表单选项行 ==================== */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    font-size: 13px;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    cursor: pointer;
}

.auth-checkbox input {
    width: 14px;
    height: 14px;
    accent-color: #1890ff;
    cursor: pointer;
}

.auth-options a {
    color: #1890ff;
}

/* ==================== 分割线 ==================== */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #ccc;
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    padding: 0 16px;
}

/* ==================== 验证码样式 ==================== */
.captcha-wrapper {
    display: flex;
    align-items: center;
}

.captcha-wrapper .captcha-image {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 44px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.captcha-wrapper .captcha-image:hover {
    border-color: #1890ff;
    box-shadow: 0 0 8px rgba(24, 144, 255, 0.2);
}

.captcha-wrapper input {
    padding-right: 140px !important;
}

/* ==================== 响应式 ==================== */
@media (max-width: 480px) {
    body.auth-body {
        padding: 16px;
        align-items: flex-start;
        padding-top: 40px;
    }

    .auth-card {
        padding: 36px 24px;
        border-radius: 12px;
    }

    .auth-logo a {
        font-size: 22px;
    }

    .auth-input-wrapper input {
        height: 44px;
    }

    .auth-btn {
        height: 44px;
    }
}
