/* ============================================================
   典泉官网 - 登录/注册页公共样式
   主色调: 帝王紫 #5D3FD3
   ============================================================ */

:root {
    --purple:       #5D3FD3;
    --purple-dark:  #4A2FB8;
    --purple-light: #7B61FF;
    --purple-pale:  #f0edff;
    --gold:         #D4A017;
    --gold-light:   #F5C842;
    --green:        #22C55E;
    --red:          #EF4444;
    --gray-bg:      #f4f6fb;
    --gray-border:  #e8e8f0;
    --text-dark:    #1a1a2e;
    --text-mid:     #4a4a6a;
    --text-light:   #8888aa;
    --shadow-sm: 0 2px 8px rgba(93,63,211,0.08);
    --shadow-md: 0 6px 24px rgba(93,63,211,0.12);
    --shadow-lg: 0 16px 48px rgba(93,63,211,0.18);
    --radius:    16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
}

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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, sans-serif;
    color: var(--text-dark);
    background: var(--gray-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img { max-width: 100%; height: auto; }
a { text-decoration: none; }

/* ====== 全屏渐变主区域 ====== */
.auth-page-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2D1B8B 0%, #5D3FD3 50%, #7B5FE5 100%);
    padding: 52px 24px;
    position: relative;
    overflow: hidden;
}

/* 背景装饰圆 */
.auth-page-wrap::before,
.auth-page-wrap::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}
.auth-page-wrap::before {
    width: 560px; height: 560px;
    bottom: -180px; left: -160px;
}
.auth-page-wrap::after {
    width: 340px; height: 340px;
    top: -100px; right: -90px;
}
/* 第三个装饰圆 */
.auth-deco-circle {
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    top: 50%; right: 8%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ====== 内容纵向居中容器 ====== */
.auth-page-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 480px;
    gap: 24px;
    position: relative;
    z-index: 1;
}

/* ====== 卡片上方：Logo + slogan ====== */
.auth-hero {
    text-align: center;
    color: #fff;
}

.auth-hero-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 12px;
}

.auth-hero-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.auth-hero-icon i {
    font-size: 24px;
    color: #fff;
}

.auth-hero-icon svg {
    display: block;
}

.auth-hero-name {
    font-size: 36px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 3px;
}

.auth-hero-slogan {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.8;
}

/* ====== 白色卡片 ====== */
.auth-card {
    width: 100%;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

/* 顶部紫色强调线 */
.auth-card-top-bar {
    height: 5px;
    background: linear-gradient(135deg, var(--purple), var(--purple-light));
}

.auth-card-body {
    padding: 36px 40px 40px;
}

/* 卡片标题区 */
.auth-card-header {
    text-align: center;
    margin-bottom: 28px;
}

/* section-label 徽章 */
.auth-section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--purple-pale);
    color: var(--purple);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.auth-card-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 6px;
    line-height: 1.2;
}

.auth-card-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* ====== 通用表单组件 ====== */
.auth-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.auth-group label,
.auth-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-mid);
}

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

.auth-input {
    width: 100%;
    padding: 12px 44px 12px 44px;
    border: 2px solid var(--gray-border);
    border-radius: var(--radius-xs);
    font-size: 0.95rem;
    color: var(--text-dark);
    background: #fff;
    transition: border-color 0.2s;
    font-family: inherit;
    outline: none;
}
.auth-input::placeholder { color: var(--text-light); font-size: 0.9rem; }
.auth-input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(93,63,211,0.08);
}
.auth-input.input-validation-error {
    border-color: var(--red);
    background: #fff5f5;
}

.auth-icon-left {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s;
}
.auth-input:focus ~ .auth-icon-left { color: var(--purple); }

.auth-pwd-toggle {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--text-light);
    font-size: 15px; cursor: pointer;
    padding: 4px 6px; line-height: 1;
    transition: color 0.2s;
}
.auth-pwd-toggle:hover { color: var(--purple); }

.auth-error {
    font-size: 0.8rem;
    color: var(--red);
    display: block;
}

/* 提示框 */
.auth-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    margin-bottom: 18px;
}
.auth-alert-danger  { background: #fff5f5; border: 1px solid #fed7d7; color: var(--red); flex-direction: column; align-items: flex-start; }
.auth-alert-success { background: #f0fff4; border: 1px solid #c6f6d5; color: #15803d; }
.auth-sms-login-link { display: inline-block; margin-top: 4px; color: #5D3FD3; font-weight: 600; text-decoration: none; font-size: 0.9rem; }
.auth-sms-login-link:hover { text-decoration: underline; }

/* 提交按钮 */
.auth-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--purple), var(--purple-light));
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(93,63,211,0.3);
    transition: all 0.3s ease;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}
.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(93,63,211,0.4);
}
.auth-submit-btn:active { transform: translateY(0); }
.auth-submit-btn:disabled {
    background: #ccc; cursor: not-allowed;
    transform: none; box-shadow: none;
}

/* 底部跳转引导 */
.auth-guide {
    text-align: center;
    padding-top: 18px;
    border-top: 1px solid var(--gray-border);
    font-size: 0.9rem;
    color: var(--text-light);
}
.auth-guide a {
    color: var(--purple);
    font-weight: 700;
    margin-left: 4px;
    transition: color 0.2s;
}
.auth-guide a:hover { color: var(--purple-dark); }

/* ====== 卡片下方：统计数字 ====== */
.auth-page-stats {
    display: flex;
    width: 100%;
    gap: 12px;
}

.auth-stat-item {
    flex: 1;
    text-align: center;
    padding: 14px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(6px);
}

.auth-stat-number {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 5px;
}

.auth-stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.72);
}

/* ====== 算术验证码弹窗（登录/注册共用） ====== */
.captcha-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.captcha-content {
    background: #fff;
    padding: 32px;
    border-radius: 20px;
    width: 360px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    animation: captchaIn 0.3s ease-out;
}

@keyframes captchaIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.captcha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.captcha-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--purple);
}

.close-captcha {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-captcha:hover {
    color: var(--text-dark);
    background: var(--gray-border);
}

.captcha-body p {
    font-size: 0.88rem;
    color: var(--text-mid);
    margin-bottom: 14px;
}

.captcha-image-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

#captchaImage {
    flex: 1;
    min-width: 150px;
    max-width: 280px;
    height: 54px;
    object-fit: contain;
    border-radius: var(--radius-xs);
    border: 1px solid var(--gray-border);
    background: #f8f8fc;
}

.refresh-captcha {
    background: rgba(93, 63, 211, 0.08);
    color: var(--purple);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.refresh-captcha:hover {
    background: var(--purple);
    color: #fff;
}

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

.captcha-input {
    flex: 1;
    padding: 11px 14px;
    border: 2px solid var(--gray-border);
    border-radius: var(--radius-xs);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.captcha-input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(93, 63, 211, 0.08);
}

.confirm-captcha-btn {
    background: linear-gradient(135deg, var(--purple), var(--purple-light));
    color: #fff;
    border: none;
    border-radius: var(--radius-xs);
    padding: 11px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s;
}

.confirm-captcha-btn:hover {
    box-shadow: 0 4px 12px rgba(93, 63, 211, 0.35);
}

.captcha-error {
    font-size: 0.82rem;
    color: var(--red);
    margin-top: 10px;
    min-height: 18px;
}

/* ====== 淡入动画 ====== */
.fade-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
    .auth-page-wrap { padding: 36px 16px; }
    .auth-card-body { padding: 28px 24px 32px; }
    .auth-hero-name { font-size: 30px; }
    .auth-card-title { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .auth-page-wrap { padding: 28px 12px; }
    .auth-page-inner { gap: 18px; }
    .auth-card-body { padding: 24px 18px 28px; }
    .auth-hero-name { font-size: 26px; }
    .auth-card-title { font-size: 1.35rem; }
    .auth-input { font-size: 0.95rem; }
    .auth-submit-btn { padding: 13px 20px; }
}
