/* 登录页面样式 - 与主站 styles.css 保持一致 */

/* 复用主站 CSS 变量 */
:root {
    --primary-color: #7180f5;
    --primary-dark: #697ae4;
    --text-color: #1a1a2e;
    --text-light: #6b7280;
    --bg-light: #f8fafc;
    --white: #fff;
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px rgba(113, 128, 245, 0.2);
    --border-radius: 16px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --error-color: #ef4444;
    --success-color: #22c55e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    color: var(--text-color);
    line-height: 1.7;
    background: var(--gradient-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(113, 128, 245, 0.05) 0%, transparent 70%);
    pointer-events: none;
    animation: backgroundPulse 15s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* 顶部标题区 */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.login-header .logo-area img {
    height: 40px;
}

.login-header .logo-area h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
}

.login-header .subtitle {
    font-size: 16px;
    color: var(--text-light);
}

/* 登录卡片 */
.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    position: relative;
    animation: cardFadeIn 0.5s ease-out;
}

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

/* 表单区域 */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

/* 输入框统一样式 */
.form-input {
    height: 44px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.8);
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
    width: 100%;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(113, 128, 245, 0.1);
}

.form-input.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 图形验证码行 */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-row .form-input {
    flex: 1;
    min-width: 0;
}

.captcha-row #captchaImg {
    height: 44px;
    max-width: 120px;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid #d1d5db;
    object-fit: contain;
}

.captcha-row #refreshCaptcha {
    height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    background: rgba(113, 128, 245, 0.08);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.captcha-row #refreshCaptcha:hover {
    border-color: var(--primary-color);
    color: var(--white);
    background: var(--primary-color);
    box-shadow: 0 2px 8px rgba(113, 128, 245, 0.3);
}

/* 短信验证码行 */
.sms-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sms-row .form-input {
    flex: 1;
    min-width: 0;
}

.sms-row #sendSmsBtn {
    width: 120px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    background: rgba(113, 128, 245, 0.05);
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.sms-row #sendSmsBtn:hover {
    background: rgba(113, 128, 245, 0.1);
}

.sms-row #sendSmsBtn:disabled {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

/* 登录按钮 */
.btn-primary {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 8px;
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(113, 128, 245, 0.3);
    margin-top: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(113, 128, 245, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 底部提示 */
.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-light);
}

.login-footer .back-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--primary-color);
    font-weight: 500;
    transition: var(--transition);
}

.login-footer .back-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Toast 提示 */
#toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--error-color);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

#toast.show {
    opacity: 1;
    pointer-events: auto;
}

#toast.success {
    background: var(--success-color);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

/* 响应式 */
@media (max-width: 768px) {
    .login-card {
        padding: 32px 16px;
        margin: 0 16px;
        max-width: calc(100% - 32px);
    }

    .login-header .logo-area h1 {
        font-size: 24px;
    }

    .captcha-row #captchaImg {
        height: 44px;
    }

    .sms-row #sendSmsBtn {
        width: 100px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px 16px;
    }

    .login-header {
        margin-bottom: 24px;
    }

    .captcha-row {
        gap: 6px;
    }

    .sms-row {
        gap: 6px;
    }
}
