/* 基础样式 */
:root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 221.2 83.2% 53.3%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 221.2 83.2% 53.3%;
    --radius: 0.5rem;
}

/* Ghibli颜色主题 */
:root {
    --ghibli-blue: #4AA7DE;
    --ghibli-green: #7BB661;
    --ghibli-yellow: #F9CF58;
    --ghibli-pink: #F6A1B4;
    --ghibli-teal: #62B6B7;
    --ghibli-navy: #1A3C6C;
    --ghibli-cream: #F8F0E5;
    --ghibli-dark: #121212;
    --ghibli-light: #F5F5F7;
}

/* 基本元素样式 */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--ghibli-light);
    color: var(--ghibli-dark);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    margin-top: 0;
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 网格布局 */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0.5rem 1rem;
}

.btn-primary {
    background-color: var(--ghibli-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--ghibli-navy);
}

.btn-secondary {
    background-color: white;
    color: var(--ghibli-navy);
    border: 1px solid rgba(26, 60, 108, 0.2);
}

.btn-secondary:hover {
    background-color: rgba(74, 167, 222, 0.1);
}

/* 图库样式 */
#galleryGrid {
    width: 100%;
    margin: 0 auto;
}

/* 修复瀑布流布局样式 */
.gallery-item {
    width: 100%; /* 默认为单列 */
    margin-bottom: 24px;
    break-inside: avoid;
    display: block; /* 确保元素是块级元素 */
}

/* 响应式布局调整 */
@media (min-width: 640px) {
    .gallery-item {
        width: calc(50% - 12px); /* 2列 */
    }
}

@media (min-width: 992px) {
    .gallery-item {
        width: calc(33.333% - 16px); /* 3列 */
    }
}

@media (min-width: 1200px) {
    .gallery-item {
        width: calc(25% - 18px); /* 4列 */
    }
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

/* 分页样式 */
.pagination-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    margin: 0 0.25rem;
    border-radius: 0.25rem;
    background-color: white;
    border: 1px solid rgba(74, 167, 222, 0.2);
    color: var(--ghibli-navy);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.pagination-button:hover {
    background-color: rgba(74, 167, 222, 0.1);
}

.pagination-button.active {
    background-color: var(--ghibli-blue);
    color: white;
    border-color: var(--ghibli-blue);
}

/* 实用类 */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.space-x-4 > * + * {
    margin-left: 1rem;
}

.rounded-full {
    border-radius: 9999px;
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.fixed {
    position: fixed;
}

.bottom-8 {
    bottom: 2rem;
}

.right-8 {
    right: 2rem;
}

.p-3 {
    padding: 0.75rem;
}

.bg-ghibli-blue {
    background-color: var(--ghibli-blue);
}

.text-white {
    color: white;
}

/* 动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* 加载指示器 */
#loadingSpinner {
    text-align: center;
    padding: 3rem 0;
}

/* 返回顶部按钮 */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--ghibli-blue);
    color: white;
    border-radius: 9999px;
    padding: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

#back-to-top:hover {
    background-color: var(--ghibli-navy);
    transform: translateY(-3px);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* 头部导航 */
header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(74, 167, 222, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Infinite Scroll 状态样式 */
.page-load-status {
    margin-top: 2rem;
    text-align: center;
    color: #4AA7DE;
}

.infinite-scroll-request {
    animation: fadeIn 0.3s;
}

.infinite-scroll-last,
.infinite-scroll-error {
    display: none;
    padding: 1rem 0;
    color: #666;
}

/* 加载动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
} 