/* 全局样式 */
body {
    font-family: 'Noto Sans SC', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #E5F6E8, #F0F9F1);
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 新增背景渐变动画，减慢速度 */
@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    /* 应用背景渐变动画，减慢速度到 30s */
    animation: gradientAnimation 30s ease infinite;
    background-size: 400% 400%;
}

h1 {
    margin-top: 20px;    
    font-size: 32px;  
    text-align: center;
    color: #558B6E;
    /* 移除滚动动画，添加上下浮动动画 */
    animation: float 5s ease-in-out infinite alternate;
    margin-bottom: 20px;
}

/* 新增标题浮动动画 */
@keyframes float {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-10px);
    }
}

h2 {
    margin-top: 20px;
    margin-bottom: 20px;
    color: #558B6E;
    animation: fadeIn 1s ease-in-out;
}

/* 书签列表样式 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-gap: 20px;
    animation: fadeIn 1s ease-in-out;
}

.card {
    background-color: #F5FAF6;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.2s ease;
    animation: fadeIn 1s ease-in-out;
    border: 1px solid #e0e0e0;
    /* 新增卡片加载时的缩放动画 */
    animation: cardScale 0.5s ease-out;
}

/* 卡片缩放动画 */
@keyframes cardScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.card a {
    display: block;
    padding: 20px;
    text-decoration: none;
    color: #558B6E;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #558B6E;
}

.card-desc {
    font-size: 14px;
    color: rgba(85, 139, 110, 0.8);
}

.card:hover {
    transform: scale(1.03);
    background-color: #E5F6E8;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.3);
    border-color: #007BFF;
    /* 移除卡片悬停时的旋转动画 */
    /* animation: cardRotate 0.5s ease; */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}


/* 添加表单基础样式 */
/* 新增表单样式 */
.auth-section {
    margin-bottom: 2rem;
}

/* 修改表单容器样式 */
.form-container {
    display: flex;
    flex-direction: row;  /* 改为行排列 */
    align-items: flex-end; /* 底部对齐 */
    gap: 1rem;
}

/* 调整表单组宽度 */
.form-group {
    flex: 1;  /* 自动填充剩余空间 */
    min-width: 0;  /* 允许缩小 */
}

/* 调整登录按钮宽度 */
.login-btn {
    width: auto;  /* 改为自动宽度 */
    min-width: 100px;  /* 设置最小宽度 */
    flex-shrink: 0;  /* 禁止缩小 */
}

.form-group input {
    width: 90%;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 0.375rem;
    outline: none;
}

.form-group input:focus {
    border-color: #4ade80;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
}

.login-btn {
    width: 90%;
    background-color: #22c55e;
    color: white;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background-color: #16a34a;
}

.message {
    color: #ef4444;
    font-weight: 500;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* 书签区域样式 */
#bookmarks {
    background-color: #dcfce7;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
}

.bookmark-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bookmark-header h2 {
    font-size: 1.125rem;
    font-weight: bold;
    color: #57534e;
}

.logout-btn {
    background-color: #bbf7d0;
    color: #57534e;
    font-weight: bold;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.logout-btn:hover {
    background-color: #86efac;
}

#bookmarkList {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

@media (min-width: 768px) {
    #bookmarkList {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    #bookmarkList {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1280px) {
    #bookmarkList {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1536px) {
    #bookmarkList {
        grid-template-columns: repeat(7, 1fr);
    }
}

.bookmark {
    background-color: #fef9c3;
    padding: 0.5rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

.bookmark:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.bookmark a {
    color: #4b5563;
    font-size: 0.875rem;
}

.bookmark a:hover {
    color: #4ade80;
}

.no-bookmarks {
    color: #4b5563;
    font-size: 0.875rem;
}


.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4285f4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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