/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #F7FAFC;
    color: #2D3748;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 果冻效果动画 */
@keyframes jelly {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(0.95, 1.05);
    }
    50% {
        transform: scale(1.05, 0.95);
    }
    75% {
        transform: scale(0.98, 1.02);
    }
}

.jelly-effect {
    animation: jelly 0.6s ease-in-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #E2E8F0;
}

::-webkit-scrollbar-thumb {
    background: #A0AEC0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

/* 导航栏样式 */
#navbar {
    background-color: rgba(247, 250, 252, 0);
    backdrop-filter: blur(0px);
}

#navbar.scrolled {
    background-color: rgba(247, 250, 252, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(22, 93, 255, 0.1);
    border-radius: 0 0 20px 20px;
}

/* 快速导航按钮 */
.quick-nav-btn {
    transition: all 0.3s ease;
    border-radius: 20px;
}

.quick-nav-btn:hover {
    animation: jelly 0.6s ease-in-out;
    box-shadow: 0 0 20px rgba(22, 93, 255, 0.3);
}

/* 收藏卡片样式 */
.collection-card {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.collection-card:hover {
    animation: jelly 0.6s ease-in-out;
    border-color: rgba(22, 93, 255, 0.5);
    box-shadow: 0 8px 30px rgba(22, 93, 255, 0.15);
}

.collection-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #2D3748;
}

.collection-card p {
    color: #718096;
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.collection-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.collection-card .tag {
    background-color: rgba(22, 93, 255, 0.1);
    color: #165DFF;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.collection-card .visit-btn {
    background-color: #165DFF;
    color: #FFFFFF;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.collection-card .visit-btn:hover {
    background-color: #2563EB;
    box-shadow: 0 0 15px rgba(22, 93, 255, 0.4);
    transform: translateY(-1px);
    animation: jelly 0.6s ease-in-out;
}

/* 留言项样式 */
.message-item {
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.message-item:hover {
    border-color: rgba(22, 93, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.message-item .message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.message-item .message-name {
    font-weight: 600;
    color: #2D3748;
}

.message-item .message-time {
    font-size: 0.75rem;
    color: #A0AEC0;
}

.message-item .message-content {
    color: #4A5568;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 表单样式增强 */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

/* 回到顶部按钮 */
#back-to-top {
    transition: all 0.3s ease;
    border-radius: 50%;
    background-color: #165DFF;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(22, 93, 255, 0.4);
    animation: jelly 0.6s ease-in-out;
}

/* 标签筛选按钮 */
.filter-btn {
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 25px;
    padding: 6px 18px;
}

.filter-btn.active {
    background-color: #165DFF;
    box-shadow: 0 0 15px rgba(22, 93, 255, 0.3);
}

.filter-btn:hover {
    animation: jelly 0.6s ease-in-out;
}

/* 状态提示样式 */
.status-success {
    color: #48BB78;
}

.status-error {
    color: #F56565;
}

.status-loading {
    color: #63B3ED;
}

/* 骨架屏样式 */
.skeleton {
    background: linear-gradient(90deg, rgba(226, 232, 240, 0.3) 25%, rgba(226, 232, 240, 0.6) 50%, rgba(226, 232, 240, 0.3) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 15px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    #intro {
        padding-top: 16px;
    }
    
    .collection-card {
        padding: 20px;
    }
    
    .message-item {
        padding: 16px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 自定义滚动行为 */
html {
    scroll-behavior: smooth;
}

/* 确保所有链接都有平滑滚动 */
a[href^="#"] {
    scroll-behavior: smooth;
}

/* 移动端菜单动画 */
#mobile-menu {
    transition: all 0.3s ease;
    border-radius: 0 0 20px 20px;
}

#mobile-menu.open {
    display: block;
    animation: slideDown 0.3s ease-out;
    background-color: rgba(247, 250, 252, 0.95);
    backdrop-filter: blur(10px);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 导航链接动画 */
.nav-link,
.mobile-nav-link {
    position: relative;
    color: #2D3748;
}

.nav-link::after,
.mobile-nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #165DFF;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.mobile-nav-link:hover::after {
    width: 100%;
}

/* 按钮禁用状态 */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 确保粒子背景不影响其他元素 */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.1;
}

/* 主内容区域定位 */
section {
    position: relative;
    z-index: 1;
}

/* 优化文本渲染 */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 表单提交按钮状态 */
#submit-btn.loading {
    position: relative;
}

#submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #FFFFFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* 留言列表滚动条 */
#message-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(160, 174, 192, 0.5) rgba(247, 250, 252, 0.3);
}

#message-list::-webkit-scrollbar {
    width: 6px;
}

#message-list::-webkit-scrollbar-track {
    background: rgba(247, 250, 252, 0.3);
    border-radius: 10px;
}

#message-list::-webkit-scrollbar-thumb {
    background: rgba(160, 174, 192, 0.5);
    border-radius: 10px;
}

#message-list::-webkit-scrollbar-thumb:hover {
    background: rgba(113, 128, 150, 0.7);
}

/* 标签筛选激活状态 */
.filter-btn.active {
    background-color: #165DFF;
    box-shadow: 0 0 15px rgba(22, 93, 255, 0.3);
}

/* 确保卡片内链接正常工作 */
.collection-card a {
    text-decoration: none;
    color: inherit;
}

/* 优化图片加载 */
img {
    loading: lazy;
    max-width: 100%;
    height: auto;
    border-radius: 15px;
}

/* 确保容器居中 */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 表单样式更新 */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

input[type="text"],
input[type="email"],
textarea {
    border-radius: 15px;
    background-color: #FFFFFF;
    border: 2px solid #E2E8F0;
    color: #2D3748;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: #165DFF;
    box-shadow: 0 0 0 4px rgba(22, 93, 255, 0.1);
    transform: scale(1.01);
}

label {
    color: #4A5568;
    font-weight: 500;
    font-size: 0.9rem;
}

/* 提交按钮样式 */
#submit-btn {
    border-radius: 25px;
    padding: 14px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #165DFF;
    color: #FFFFFF;
    border: none;
}

#submit-btn:hover {
    background-color: #2563EB;
    box-shadow: 0 0 20px rgba(22, 93, 255, 0.3);
    animation: jelly 0.6s ease-in-out;
}

/* 标签按钮样式 */
.filter-btn {
    background-color: #EDF2F7;
    color: #4A5568;
    border: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-btn.active {
    background-color: #165DFF;
    color: #FFFFFF;
}

/* 快速导航按钮样式 */
.quick-nav-btn {
    background-color: #FFFFFF;
    color: #2D3748;
    border: 2px solid #E2E8F0;
    font-weight: 600;
    font-size: 1rem;
}

.quick-nav-btn:hover {
    background-color: #165DFF;
    color: #FFFFFF;
    border-color: #165DFF;
}

/* 留言卡片样式 */
.bg-gray-800 {
    background-color: rgba(255, 255, 255, 0.8) !important;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.bg-gray-800 h3 {
    color: #2D3748;
    font-weight: 700;
}

/* 头像样式 */
.w-24.h-24.rounded-full {
    border-radius: 50% !important;
    box-shadow: 0 0 20px rgba(22, 93, 255, 0.2);
    transition: all 0.3s ease;
}

.w-24.h-24.rounded-full:hover {
    animation: jelly 0.6s ease-in-out;
    box-shadow: 0 0 30px rgba(22, 93, 255, 0.3);
}

/* 标题样式 */
h1, h2, h3 {
    color: #2D3748;
    font-weight: 700;
}

/* 段落样式 */
p {
    color: #4A5568;
}

/* 导航链接颜色 */
.nav-link,
.mobile-nav-link {
    color: #2D3748;
}

.nav-link:hover,
.mobile-nav-link:hover {
    color: #165DFF;
}

/* Logo样式 */
.text-white {
    color: #2D3748 !important;
}

.text-cyan-400 {
    color: #165DFF !important;
}

/* 粒子背景透明度调整 */
#particles-js {
    opacity: 0.15;
}