/* ========================================
   广东北江中学校园网 - 基础样式
   白色简洁风格 + 蓝紫配色
   竖屏手机适配 (max-width: 480px)
   ======================================== */

/* CSS变量定义 */
:root {
    /* 主色调 - 蓝紫色系 */
    --primary-indigo: #6366f1;
    --primary-violet: #8b5cf6;
    --primary-purple: #a855f7;
    
    /* 渐变色 */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-light: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    --gradient-button: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    
    /* 背景色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    /* 文字色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-white: #ffffff;
    
    /* 边框色 */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* 间距 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    
    /* 动画时长 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 重置样式 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 移动端容器 */
.mobile-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--bg-primary);
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
}

/* ========================================
   登录页面样式
   ======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    background: var(--bg-primary);
}

/* Logo区域 */
.logo-section {
    text-align: center;
    padding: var(--space-2xl) 0;
}

.logo-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: var(--space-lg);
}

.school-logo {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    position: relative;
    z-index: 2;
    box-shadow: var(--shadow-md);
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: var(--gradient-primary);
    border-radius: 50%;
    opacity: 0.2;
    filter: blur(20px);
    z-index: 1;
    animation: pulse-glow 3s ease-in-out infinite;
}

.school-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.school-slogan {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 登录表单区域 */
.login-form-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form {
    width: 100%;
}

/* 输入组 */
.input-group {
    margin-bottom: var(--space-lg);
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-md);
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-wrapper input {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-md) 48px;
    font-size: 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--primary-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-indigo);
}

.input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

/* 密码可见性切换 */
.toggle-password {
    position: absolute;
    right: var(--space-md);
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--primary-indigo);
}

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

/* 记住我和忘记密码 */
.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-sm);
    margin-right: var(--space-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    position: relative;
}

.checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform var(--transition-fast);
    position: absolute;
    top: 1px;
}

.checkbox-wrapper input:checked + .checkmark {
    background: var(--gradient-primary);
    border-color: transparent;
}

.checkbox-wrapper input:checked + .checkmark::after {
    transform: rotate(45deg) scale(1);
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--primary-indigo);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.forgot-link:hover {
    color: var(--primary-purple);
}

/* 登录按钮 */
.login-btn {
    width: 100%;
    padding: var(--space-md);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-white);
    background: var(--gradient-button);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-loader {
    opacity: 1;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
}

/* 分割线 */
.divider {
    display: flex;
    align-items: center;
    margin: var(--space-lg) 0;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.divider span {
    padding: 0 var(--space-md);
}

/* 访客登录按钮 */
.guest-btn {
    width: 100%;
    padding: var(--space-md);
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-indigo);
    background: transparent;
    border: 2px solid var(--primary-indigo);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition-fast);
}

.guest-btn svg {
    width: 20px;
    height: 20px;
}

.guest-btn:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

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

.guest-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* 注册区域 */
.register-section {
    margin-top: var(--space-lg);
    padding: var(--space-md) 0;
}

.register-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
}

.register-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.register-link.student {
    color: var(--primary-indigo);
    background: rgba(99, 102, 241, 0.1);
}

.register-link.student:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.register-link.teacher {
    color: var(--primary-violet);
    background: rgba(139, 92, 246, 0.1);
}

.register-link.teacher:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

.divider-dot {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* 底部区域 */
.footer-section {
    text-align: center;
    padding-top: var(--space-lg);
    margin-top: auto;
}

.copyright {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.tech-support {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ========================================
   Toast提示样式
   ======================================== */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-white);
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease;
    pointer-events: auto;
    min-width: 200px;
    text-align: center;
}

.toast.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast.info {
    background: var(--gradient-primary);
}

.toast.hiding {
    animation: toast-out 0.3s ease forwards;
}

/* ========================================
   响应式调整
   ======================================== */
@media (max-width: 480px) {
    .mobile-container {
        max-width: 100%;
    }
    
    .login-page {
        padding: var(--space-md);
    }
    
    .logo-section {
        padding: var(--space-xl) 0;
    }
    
    .school-logo {
        width: 80px;
        height: 80px;
    }
    
    .school-name {
        font-size: 1.5rem;
    }
}

/* 小屏幕手机 */
@media (max-width: 360px) {
    html {
        font-size: 14px;
    }
    
    .school-logo {
        width: 70px;
        height: 70px;
    }
}

/* ========================================
   通用工具类
   ======================================== */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
