@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

body, html {
    height: 100%;
    margin: 0;
    font-family: 'Poppins', 'Segoe UI', 'Microsoft YaHei', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(-45deg, #23a6d5, #23d5ab, #ee7752, #e73c7e, #9b59b6);
    background-size: 500% 500%;
    animation: gradientBG 20s ease infinite;
    overflow-y: auto; /* 允许在内容过多时滚动 */
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
    z-index: 0;
}

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

.main-container {
    position: relative;
    z-index: 1;
    background-color: rgba(255, 255, 255, 0.12);
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    margin: 20px;
    transition: all 0.5s ease-in-out;
    overflow: hidden;
}

.main-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    opacity: 0.5;
    z-index: -1;
    animation: shimmer 12s infinite linear;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

h2 {
    color: #fff;
    text-align: center;
    margin-top: 0;
    margin-bottom: 35px;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.input-group {
    position: relative;
    margin-bottom: 25px;
    transition: transform 0.3s ease;
}

.input-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.input-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background-image: linear-gradient(45deg, #8e44ad, #9b59b6, #3498db);
    background-size: 200% auto;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.5s ease;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    animation: gradientMove 3s ease infinite;
}

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

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.btn:active {
    transform: translateY(1px);
}

#error-message {
    color: #ffb8b8;
    text-align: center;
    margin-top: 20px;
    height: 20px;
    font-weight: 400;
    transition: all 0.3s ease;
}

.link-container {
    text-align: center;
    color: #fff;
}

.link-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.link-list a {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 18px 15px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.link-list a::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #8e44ad, #3498db, #2ecc71, #f1c40f);
    z-index: -2;
    border-radius: 14px;
    background-size: 400% 400%;
    animation: borderGlow 6s ease infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.link-list a:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.link-list a:hover::before {
    opacity: 1;
}

.fade-out {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
}

.fade-in {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

#login-form, #link-section {
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out, transform 0.6s ease-in-out;
}

/* 添加加载动画 */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.btn.loading {
    position: relative;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 输入框聚焦效果 */
.input-group:focus-within {
    transform: translateY(-2px);
}

/* 错误信息动画 */
#error-message.show {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        padding: 40px 30px;
        margin: 15px;
    }
    
    h2 {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    .link-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 35px 25px;
        margin: 10px;
        border-radius: 20px;
    }
    
    h2 {
        font-size: 26px;
        margin-bottom: 25px;
    }
    
    .input-group input {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .btn {
        padding: 14px;
        font-size: 16px;
    }
    
    .link-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .link-list a {
        padding: 16px 12px;
    }
}

/* 适配小屏幕设备 */
@media (max-height: 700px) {
    body, html {
        align-items: flex-start;
        padding: 20px 0;
    }
    
    .main-container {
        margin: 10px;
        padding: 30px 25px;
    }
    
    h2 {
        margin-bottom: 20px;
    }
    
    .input-group {
        margin-bottom: 20px;
    }
}