/* 全局样式 */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* 背景动画 */
.stApp {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 浮动粒子效果 */
.stApp::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 200, 255, 0.3) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(120deg); }
    66% { transform: translateY(30px) rotate(240deg); }
}

/* 卡片容器 */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(200%);
    border-radius: 24px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 48px;
    max-width: 520px;
    margin: 0 auto;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 300% 100%;
    animation: rainbowMove 4s ease infinite;
    border-radius: 24px 24px 0 0;
}

@keyframes rainbowMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.auth-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    animation: gradientBG 8s ease infinite;
    border-radius: 26px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-card:hover::after {
    opacity: 0.3;
}

.auth-card:hover {
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 12px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    transform: translateY(-12px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.6);
}

/* 页面标题 */
.auth-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleShimmer 3s ease-in-out infinite;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

@keyframes titleShimmer {
    0%, 100% { 
        background-position: 0% 50%;
        filter: brightness(1) contrast(1);
    }
    50% { 
        background-position: 100% 50%;
        filter: brightness(1.3) contrast(1.1);
    }
}

.auth-title::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { 
        opacity: 0.5;
        transform: translateX(-50%) scale(0.8);
    }
    100% { 
        opacity: 1;
        transform: translateX(-50%) scale(1.2);
    }
}

.auth-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 6px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: underlineFlow 2s ease-in-out infinite, underlineExpand 1s ease-out;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

@keyframes underlineFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes underlineExpand {
    0% { 
        width: 0;
        opacity: 0;
    }
    100% { 
        width: 120px;
        opacity: 1;
    }
}

/* 表单样式 */
.auth-form {
    margin-top: 20px;
}

/* 输入框标签 */
.auth-form label {
    font-weight: 500;
    color: #34495e;
    margin-bottom: 8px;
    display: block;
}

/* 输入框容器 */
.auth-input-container {
    position: relative;
    margin-bottom: 24px;
    transform: translateY(20px);
    opacity: 0;
    animation: slideInUp 0.6s ease-out forwards;
}

.auth-input-container:nth-child(1) { animation-delay: 0.1s; }
.auth-input-container:nth-child(2) { animation-delay: 0.2s; }
.auth-input-container:nth-child(3) { animation-delay: 0.3s; }
.auth-input-container:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideInUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 输入框图标 */
.auth-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 18px;
    z-index: 2;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.auth-input-container:hover .auth-input-icon {
    color: #764ba2;
    transform: translateY(-50%) scale(1.1);
}

/* 输入框样式 */
.auth-form .stTextInput>div>div>input {
    border-radius: 16px !important;
    border: 2px solid rgba(102, 126, 234, 0.2) !important;
    padding: 16px 20px 16px 50px !important;
    font-size: 16px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: linear-gradient(145deg, #ffffff, #f8f9ff) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em !important;
    box-shadow: 
        0 4px 12px rgba(102, 126, 234, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

.auth-form .stTextInput>div>div>input:focus {
    border-color: #667eea !important;
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.15),
        0 8px 25px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    background: linear-gradient(145deg, #ffffff, #fafbff) !important;
    transform: translateY(-2px) !important;
}

.auth-form .stTextInput>div>div>input:hover {
    border-color: rgba(102, 126, 234, 0.4) !important;
    box-shadow: 
        0 6px 20px rgba(102, 126, 234, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
    transform: translateY(-1px) !important;
}

/* 按钮样式 */
.auth-form .stButton>button {
    width: 100% !important;
    padding: 18px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%) !important;
    background-size: 200% 200% !important;
    border: none !important;
    border-radius: 16px !important;
    margin-top: 16px !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: white !important;
    text-transform: uppercase !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1) !important;
    cursor: pointer !important;
}

.auth-form .stButton>button::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent) !important;
    transition: left 0.6s ease !important;
}

.auth-form .stButton>button:hover::before {
    left: 100% !important;
}

.auth-form .stButton>button:hover {
    background-position: 100% 0% !important;
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 
        0 15px 35px rgba(102, 126, 234, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.15) !important;
    animation: buttonPulse 1.5s infinite !important;
}

.auth-form .stButton>button:active {
    transform: translateY(-2px) scale(0.98) !important;
    box-shadow: 
        0 8px 20px rgba(102, 126, 234, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1) !important;
    animation: none !important;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 
            0 15px 35px rgba(102, 126, 234, 0.4),
            0 8px 20px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 
            0 20px 45px rgba(102, 126, 234, 0.5),
            0 12px 25px rgba(0, 0, 0, 0.2);
    }
}

/* 分隔线样式 */
.auth-divider {
    text-align: center;
    margin: 32px 0 24px 0;
    position: relative;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3), rgba(102, 126, 234, 0.3), transparent);
    border-radius: 1px;
    z-index: 1;
}

.auth-divider span {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
    padding: 8px 20px;
    border-radius: 20px;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

/* 辅助链接 */
.auth-links {
    text-align: center;
    margin: 24px 0 16px 0;
    color: #64748b;
    font-size: 15px;
    font-weight: 500;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    margin-left: 8px;
}

.auth-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.auth-links a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 1px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-links a:hover {
    transform: translateY(-2px) scale(1.05);
    background-position: 100% 0;
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
}

.auth-links a:hover::before {
    opacity: 1;
}

.auth-links a:hover::after {
    width: 80%;
}

.auth-links a:active {
    transform: translateY(-1px) scale(1.02);
    transition: transform 0.1s ease;
}

/* 错误和成功消息 *.auth-message {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    animation: messageSlideIn 0.5s ease-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.auth-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    animation: borderGlow 2s ease-in-out infinite;
}

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

@keyframes borderGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.auth-message.error {
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.9), rgba(252, 165, 165, 0.8));
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-message.error::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.auth-message.success {
    background: linear-gradient(135deg, rgba(220, 252, 231, 0.9), rgba(167, 243, 208, 0.8));
    color: #059669;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.auth-message.success::before {
    background: linear-gradient(180deg, #22c55e, #059669);
}

.auth-message.info {
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.9), rgba(147, 197, 253, 0.8));
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.auth-message.info::before {
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}

/* 验证码输入框样式 */
.verification-code-input {
    letter-spacing: 8px;
    font-size: 20px !important;
    text-align: center !important;
    font-weight: 600 !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .auth-card {
        padding: 32px 24px;
        margin: 0 16px;
        max-width: calc(100vw - 32px);
    }
    
    .auth-title {
        font-size: 2rem;
        margin-bottom: 32px;
    }
    
    .auth-form .stTextInput>div>div>input {
        padding: 14px 18px 14px 46px !important;
        font-size: 15px !important;
    }
    
    .auth-form .stButton>button {
        padding: 16px !important;
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px 20px;
        margin: 0 12px;
        border-radius: 20px;
    }
    
    .auth-title {
        font-size: 1.8rem;
    }
}

/* 主要动画效果 */
@keyframes fadeInScale {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

.auth-card {
    animation: fadeInScale 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 链接样式优化 */
.auth-links {
    text-align: center;
    margin-top: 24px;
    font-size: 15px;
    color: #64748b;
    font-weight: 500;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.auth-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.auth-links a:hover {
    color: #764ba2;
    transform: translateY(-1px);
}

.auth-links a:hover::after {
    width: 100%;
}

/* 分隔线优化 */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 32px 0;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.auth-divider:before,
.auth-divider:after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.4), transparent);
}

.auth-divider:before {
    margin-right: 16px;
}

.auth-divider:after {
    margin-left: 16px;
}

/* 验证码输入框特殊样式 */
.verification-code-input {
    letter-spacing: 12px !important;
    font-size: 24px !important;
    text-align: center !important;
    font-weight: 700 !important;
    font-family: 'Courier New', monospace !important;
}

/* 加载动画 */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* 焦点环效果 */
.auth-form .stButton>button:focus-visible {
    outline: none !important;
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.3),
        0 15px 35px rgba(102, 126, 234, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.15) !important;
}