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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    overflow: hidden;
    width: 100%;
    height: 100vh;
}

/* 背景动画 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    z-index: -1;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 60px 70px, white, transparent),
        radial-gradient(1px 1px at 50px 50px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(2px 2px at 90px 10px, white, transparent);
    background-size: 200px 200px;
    animation: stars 60s linear infinite;
    opacity: 0.6;
}

@keyframes stars {
    from { transform: translateY(0); }
    to { transform: translateY(-200px); }
}

.clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><path fill="rgba(255,255,255,0.05)" d="M0,300 Q300,200 600,300 T1200,300 L1200,600 L0,600 Z"/></svg>');
    background-size: 100% 100%;
    animation: clouds 30s ease-in-out infinite;
}

@keyframes clouds {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-50px); }
}

/* 容器 */
.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* 登录框 */
.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.6s ease-out;
}

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

/* Logo */
.logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo h1 {
    font-size: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 2px;
}

.subtitle {
    color: #666;
    font-size: 14px;
    letter-spacing: 1px;
}

/* 表单容器 */
.form-container {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.form-container.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-container h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 600;
}

/* 输入框组 */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
    background: white;
}

.input-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
}

/* 记住我 */
.remember-group,
.agreement-group {
    margin-bottom: 20px;
}

.remember-group label,
.agreement-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.remember-group input[type="checkbox"],
.agreement-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.agreement-group a {
    color: #667eea;
    text-decoration: none;
}

/* 按钮 */
.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

.btn-guest {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-guest:hover {
    background: #667eea;
    color: white;
}

/* 切换文本 */
.switch-text {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-top: 16px;
}

.switch-text a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.switch-text a:hover {
    text-decoration: underline;
}

/* 快速登录 */
.quick-login {
    margin-top: 24px;
}

.divider {
    text-align: center;
    margin-bottom: 16px;
    position: relative;
    color: #999;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e0e0e0;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

/* 页脚 */
.footer {
    position: absolute;
    bottom: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    max-width: 600px;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    opacity: 1;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .login-box {
        padding: 30px 24px;
        max-width: 100%;
        margin: 0 10px;
    }
    
    .logo h1 {
        font-size: 28px;
    }
    
    .form-container h2 {
        font-size: 20px;
    }
    
    .footer {
        font-size: 11px;
        padding: 0 20px;
    }
}

/* 竖屏适配 */
@media screen and (orientation: portrait) {
    .container {
        padding: 10px;
    }
    
    .login-box {
        max-width: 100%;
    }
}

/* 横屏适配 */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .login-box {
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .logo {
        margin-bottom: 20px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .input-group {
        margin-bottom: 12px;
    }
    
    .footer {
        position: relative;
        margin-top: 20px;
    }
}

/* 用户协议弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: white;
    margin: 2% auto;
    padding: 0;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.4s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 22px;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 32px;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.8;
    color: #333;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.update-time {
    color: #999;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: right;
}

.modal-body h3 {
    color: #667eea;
    font-size: 18px;
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

.modal-body p {
    margin-bottom: 12px;
    text-align: justify;
}

.modal-body ul {
    margin: 12px 0;
    padding-left: 30px;
}

.modal-body li {
    margin-bottom: 8px;
}

.final-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 16px;
    margin-top: 24px;
    border-radius: 4px;
    color: #856404;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-secondary {
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

/* 弹窗移动端适配 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 20px 16px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 20px 16px;
        font-size: 14px;
    }
    
    .modal-body h3 {
        font-size: 16px;
        margin-top: 20px;
    }
    
    .modal-footer {
        padding: 16px;
        flex-direction: column-reverse;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0;
    }
}

@media screen and (orientation: landscape) and (max-height: 600px) {
    .modal-content {
        margin: 1% auto;
        max-height: 95vh;
    }
}

