/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4361ee;
    --primary-light: #4895ef;
    --secondary-color: #3a0ca3;
    --text-color: #2d3748;
    --text-light: #718096;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 0.5rem;
    --transition: all 0.3s ease;
}

/* 深色主题 */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #4361ee;
        --primary-light: #4895ef;
        --secondary-color: #7209b7;
        --text-color: #f7fafc;
        --text-light: #a0aec0;
        --background-color: #1a202c;
        --card-background: #2d3748;
        --border-color: #4a5568;
        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    }
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    /* 禁止页面横向滚动 */
    overflow-x: hidden !important;
    width: 100% !important;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    /* 添加背景图样式，确保图片铺满整个页面 */
    background-image: url('../picture/header-mobile.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* 登录容器样式 */
.login-container {
    position: relative;
    width: 100%;
    max-width: 960px;
    /* 修改：去掉固定高度，让容器自适应内容 */
    min-height: 500px;
    height: auto;
    display: flex;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background-color: var(--card-background);
    transition: var(--transition);
}

/* 左侧欢迎区域 */
.welcome-section {
    width: 50%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNmZmYiIG9wYWNpdHk9IjAuMSIvPgogIDxwYXRoIGQ9Ik0wIDBoMjAwdjIwMEgweiIgZmlsbD0ibm9uZSIvPgogIDxwYXRoIGQ9Ik0xMCAxMGgyMHYyMEgxMHoiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iMC4yIi8+CiAgPHBhdGggZD0iTTUwIDMwaDIwdjIwSDUwek03MCA3MGgyMHYyMEg3MHoiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iMC4yIi8+CiAgPHBhdGggZD0iTTEzMCAxMDBoMjB2MjBIMTMwem01MCAzMmgxMHYxMEgxODB6IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMyIvPgogIDxwYXRoIGQ9Ik0xMCA1MGgyMHYyMEgxMHoiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iMC4xNSIvPgogIDxwYXRoIGQ9Ik0xMzAgMzBoMjB2MjBIMTMwem01MCAxMDBoMjB2MjBIMTgwem0tMTAgMTB2MTAiIGZpbGw9IiNmZmYiIGZpbGwtb3BhY2l0eT0iMC4xIi8+Cjwvc3ZnPg==');
    opacity: 0.3;
}

.welcome-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    z-index: 1;
    position: relative;
}

.welcome-section p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
    z-index: 1;
    position: relative;
}

/* 右侧表单区域 */
.form-section {
    width: 50%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* 修改：添加最小高度，确保表单内容有足够空间 */
    min-height: 500px;
}

.logo {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    justify-content: center;
}

.logo h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 700;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: var(--card-background);
    color: var(--text-color);
    transition: var(--transition);
}

.input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.input.pwd {
    position: relative;
}

/* 按钮样式 */
.btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(67, 97, 238, 0.3);
}

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

/* 链接样式 */
.form-links {
    margin-top: 1rem;
    text-align: center;
}

.form-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.form-links a:hover {
    text-decoration: underline;
}

/* 错误提示样式 */
.errorBox {
    display: none;
    padding: 0.5rem;
    background-color: #fed7d7;
    color: #c53030;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* 返回首页按钮样式 */
.btn-back-home {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1rem;
}

.btn-back-home:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(67, 97, 238, 0.3);
}

/* 注释掉社交登录样式 */
/*
.social-login {
    margin-top: 1.5rem;
}

.social-login p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--border-color);
    color: var(--text-color);
    transition: var(--transition);
    cursor: pointer;
}

.social-button:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
*/

/* 响应式设计 */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        height: auto;
    }
    
    .welcome-section {
        width: 100%;
        padding: 2rem;
        text-align: center;
    }
    
    .welcome-section h1 {
        font-size: 2rem;
    }
    
    .form-section {
        width: 100%;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container {
    animation: fadeIn 0.6s ease-out;
}

.form-section {
    animation: fadeIn 0.6s ease-out 0.2s both;
}

/* 工具类 */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

/* 适配原HTML结构的样式 */
.p1 {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.p3 {
    margin-bottom: 1.5rem;
}

.main-title {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* 移动端特定样式 */
@media (max-width: 640px) {
    .p1 {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .input {
        padding: 0.6rem 0.8rem;
    }
    
    .btn {
        padding: 0.6rem 0.8rem;
    }
}

/* 原样式兼容性支持 */
.top {
    display: none;
}

.pc, .bg, .p9, .p5, .p6, .p4 {
    display: none;
}

/* 修改版权信息样式，使其永远固定在底部 */
.copyright {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    text-align: center !important;
    color: var(--text-light) !important;
    font-size: 0.875rem !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    padding: 0.75rem 1rem !important;
    margin: 0 !important;
    border-top: 1px solid var(--border-color) !important;
    z-index: 1000 !important;
}

/* 为深色主题优化版权信息样式 */
@media (prefers-color-scheme: dark) {
    .copyright {
        background: rgba(45, 55, 72, 0.9) !important;
        border-top-color: var(--border-color) !important;
    }
}

/* 确保在移动端和小屏幕上不显示版权信息 */
@media (max-width: 768px) {
    .copyright {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .copyright {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .copyright {
        position: fixed !important;
        bottom: 0 !important;
        font-size: 0.75rem !important;
        padding: 0.5rem !important;
        line-height: 1.4 !important;
    }
}

@media (max-width: 640px) {
    .copyright {
        position: fixed !important;
        bottom: 0 !important;
        font-size: 0.7rem !important;
        padding: 0.4rem !important;
    }
}